Please add a getParent() function
thank you
Like this?
var getParent = function(o){
return o.loc;
}
No. In QuestJS, location is stored as a string so that doesn't work. I'm looking for a way to get a reference to the parent object.
var getParent = function(o){
return w[o.loc];
}
Whoa 🤯 !!!!! This needs to be put in the documentation immediately.
I would submit a pull request for this, but I don't know which file ThePix would add this to.
Just do what I do for now: always check the Issues when using the search bar in this repo.
NOTE: Based upon my history (especially with QuestJS), I wouldn't be surprised if there is already a function that's just called something else that does this same thing.
I would put it near the part where it says that loc is now a string. The ability to get the ref with w[o.loc] seems pretty important info there. I'll see If I can do it.
OK I found its already there. It's on this page: https://github.com/ThePix/QuestJS/wiki/General-notes However I think this demonstrates a serious issue with the docs. Personally I've found them frustrating to navigate. I think we could use a unique page for the W object. Also for some reason cloning the wiki keeps giving me errors??? Has anyone else tried it?
However I think this demonstrates a serious issue with the docs. Personally I've found them frustrating to navigate.
Yeah, the docs could definitely use an upgrade or two. The way the GitHub wiki works is what makes things difficult sometimes, though, I think.
I finally figured out to just search from the top of the page using GitHub's search bar for the entire repo. That finds what I'm looking for in the code and the wiki; so, it's much better.
Also for some reason cloning the wiki keeps giving me errors??? Has anyone else tried it?
I recall issues with document names after having cloned it, but that was a few years ago. I'll try again and see what happens on my end.
The problem (not the wiki one) is that some items do not have a simple parent. Ropes, items straddling multiple rooms, backscene, some merchandise. It is rare, but the game engine has to allow for those rare occasions.