I'm starting to learn Twine, and I thought I'd go about making a small framework to familiarize myself with the system.
What I'm trying to do is set up a Datamap called "Door" that has a key/value pair of "openCondition",$doorUnlocked.
Now what this does is set "openCondition" to whatever $doorUnlocked was when "Door" was created. That's fine, but what I need is "openCondition" to be a reference to $doorUnlocked so that when $doorUnlocked changes, "openCondition" changes as well.
Is this something that can even be done in Harlowe? If so how?
If not, does it work in Sugarcube or any other format?
Thank you for your time.
Comments
To add to the following information from the Stack Exchange thread. There is a further complication to what you are trying to do, and that is that each time passage traversal occurs the current state of all known story variable is 'copied/cloned'. The original is associated with the previous passage in the History System while the copy is made available to the new passage about to be shown.
This copying process causes internal object references to break, because the 'child' objects they reference to are also being copied. Which results in references that were originally pointing to the same object to now each be pointing to their own unique copy of that object.
This is why it is generally better store the 'property name' or 'index' of the associated object instead of the reference to that object. ... this technique is not effected by passage traversal.