Going back to a certain spot in a passage from another

This may be a bit confusing at least it is for me.The way I have my game set up is the character is in different rooms throughout the day. you click on the character image and it takes you to an event page that has all the events for that character on it.

The event page is set up with if staetments.

<<if $var is1>>
text here
<<set $var to 2>>
<<else if $var is 2>>
More text
<<set $var to 3>>
<<else if $var is 3>>

now I have one passage that that takes you to $var 1 in the morning and at afternoon i have another passage taking you to $var 2 then evening taking you to $var 3. my problem is the next day i want to be able to repeat the process going back to those variables but it only goes to the next variable in line. So like morning comes the person might not be in the same spot so id have to creat a differnt Variable but the afternoon one would be in the same location so i would want it to go back to $var 2

If your project current has the equivalent of a “go to sleep” option, that is used to progress from the end of one day to the start of the next day, and which likely updates the variables that represent the current “day” and/or “time”. Then reset the value of the $var variable to 1 when that option is used.

eg.

You are in your bedroom, and it is late at night, what do you want to do?
<<link "Go to sleep" "Next Morning">>
	/* Reset the  event related variable */
	<<set $var to 1>>
<</link>>

yea i have a sleep time out that hits if you are still trying to do things at the night cycle.

It's late and you need sleep. Time to call it a day.

<<sleepPic>>
<span class="textenter"><<click "Continue">><<goto "Sleep">><</click>></span>

then the actual sleep one

<<Dream>>
<<addDay 1>>



<span class="textenter"><<click "Wake up">><<goto "yourroom">><</click>></span>

As explained in the <<click>> macro’s documentation…

This macro has been deprecated and should no longer be used. See the <<link>> macro for its replacement.

…which means it is no longer supported, so you should not be using it in a new project.

There is also no need to use a <<goto>> macro call in either of those <<click>> macro (or better yet <<link>> macro) use-cases, as both of those macro support passing a Target Passage Name as an argument.
eg.

<span class="textenter"><<link "Continue" "Sleep">><</link>></span>

You could place the <<set $var to 1>> macro call in either:

  • the contents of the Sleep Passage
  • the body of the Wake up <<link>> macro call.
1 Like