Hi Everyone,
I am really new to Twine and I have been following some tutorials to start my story. I am using Harlowe story format.
The problem I am having at the moment is that the value of the variables I set with the links, get reset some how when I go back to the previous passage, even though the previous passage does not have any macro resetting the variable values.
Is there a way for Twine to remember when I change a variable until I change it again?
Does it work with the following syntax?
(link: "whatever")[(set: $variable to false) (goto:"previousPassage")]
If not, what how can I express it so that when someone clicks on a link, it changes the value of the variable, and then it REMEMBERS the change when the person leaves that passage or goes back to a previous one?
Any help you can offer would be greatly appreciated. I haven't been able to solve this myself, nor find any answers on the forum (which is not easy to use, btw).
Thanks.
Comments
THEN IN 2nd Passage
[/quote]
The last three lines of your 2nd Passage are missing end square brackets ]
[code]
[/code]
In 1st Passage you assign both the peter and jason datamaps to the same variable $dmName02. Change the assignment of the jason datamap to be $dmName03 and the code appears works.
hi greyelf,
thank you. I was obviously making mistakes in the code. sorry about that. If I made so many mistakes in the brief example, i probably made a lot more in the main one i was using, and that's why it wasn't working.
I have now redone a lot of my work and worked out another method for achieving what I wanted, though it would be too complicated for me to try to explain it here, though it was more along the lines of what Claretta suggested, and using more if statements with other variables. It all works now and the change in variables stick.
I appreciate all the help you all gave. Thank you very much, and sorry for the extra work I caused by not checking thoroughly my example case.
Ignore if I've gotten Twine and another system mixed up.
Or at least they are meant to but I did notice that datamaps in Harlowe don't work this way.
eg. Create the following three passages: (Init, Start, Next Passage)
note: I am use TWEE notation. If you go to the next passage and then use the built-in undo button to go back the changes should undo but don't.