Another newbie question.
Is it possible to store the name of the current passage the player is in, into a string variable?
And if so is there an expression to be able to compare players current passage with the one stored in the string regarding the above question?
I hope that makes sense.
Comments
(and so then the comparison of that stored variable to the current passage would just be )
...it's also possible you could do whatever you're trying to do with the previous() or visited() functions in Twine 1.4, which might be a little simpler, depending.
...it's also possible you could do whatever you're trying to do with the previous() or visited() functions in Twine 1.4, which might be a little simpler, depending.
Im getting an error with this "<<if>> bad condition: missing ; before statement" when I used the Any chance of a demo being whipped up?
I presume the checking bit would be like <<if $location eq state.history[0].passage.Room A>>[/code] ?
Here is what I am hoping to do, so correct me if this is a bad method or a better method can be used. I want to keep it simple as possible.
I want to create many rooms/passages that will have some enemies and other things or new options inside. I thought if I have one single passage that checks specific rooms/passages with a lot of IF Statements, it would be easier to keep track of which locations/passages have what if its all in one place. It saves time searching through individual passages to find what I am looking for if I want to make changes. I will still use tags and comments for reference, but still can be time intensive to look. So player enters room A, it matches in the check and he is given a link with a new option to choose or there is an event that happens.
I hope this makes sense. I plan to use the update macro /with footer script so for every passage the player goes to, the game will run that check passage and try to match players current location/passage and output something if there is a match.
Thanks.
The $location value itself will be set to a simple string -- if you know exactly the passage you want to match against, you can just say so (like in the above, where it's compared to "foo" and "bar" passages). It's only if you want to check the stored location against the current passage you'd need to say
<<if $location eq state.history[0].passage.title>>
, so it sounds like that's unnecessary for what you're doing.