Hey again !
I'm still trying to figure out how to do stuff, and I can't find a good way to do what I want...
I'm on Harlowe 2.0 and Twine 2.1.0
Alright, so here is the thing, I'm trying to do a loop which will return to
[[Room]]
every once in a while.
When it does, I'd like Harlowe to check what is new to the story, thanks to variables (when stuff happens, I create a variable named $StuffA, and give it the value 1)
That way, I can do, inside
Room
(if: $StuffA is 1)[Oh you did this !]
The thing is, once the program has said to you that you did StuffA once, you don't really want to hear about it again.
So I thought about doing :
(if: $StuffA is 1 and $said is 0)[Oh, you did this ! (set: $said to 1)]
It would work that way, I guess. But it implies for me to create a new variable $said, for each event that occurs in my story, which isn't convenient.
Does anyone know of a better way ?...
Thanks a lot !
Comments
I'm not sure where the loop part is, though.
Well, I'm calling a loop the fact to go back again and again to the room. I'm sorry if I'm not expressing myself correctly, I am not english
Another issue I have : Even when the "(if:) is false, and doesn't appear, it takes place within the screen.
Like this :
In my code, there are two (if:) above "Contact someone" and "Look up your info". When you play, you don't see them, but they take place anyway.
Thanks for your help !
So:
The above code will output: If $StuffA is 1 and with no leading white space or line breaks if $StuffA is not 1.
You'll need to include line breaks in the hook in you want line breaks in the output. NOTE that line breaks inside hooks only work in Harlowe 2.x, not in Harlowe 1.x.
1. Initialize the empty array and any other variables within your startup tagged Passage.
2. Test for the message and identifier in your Room Passage. note: You can rename the $seen variable to whatever makes sense to your store, you can also change the String identifier values being stored within the array to something more meaningful to you.