Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to refresh passage

edited March 2017 in Help! with 2.0
Just like the title said, how i can refresh current passage without go to another passage ? here's my scenario:

i have button to fast forward time by 1 hour and its show current time in here
::StoryCaption
<<button "">>
<<set $gameDate.setHours($gameDate.getHours() + 1)>>
<<display "Clock">>
<</button>>

and here's in passage home, the WORK menu will be visible if current time is between 06:00 AM and 08:30 AM
::Home
<<set $today = GameDays[$gameDate.getDay()]>>
<<if $today neq "Sunday" and $today neq "Saturday">>
	<<if $gameDate.getHours() gte 6>>
		<<if$gameDate.getHours() lte 8 and $gameDate.getMinutes() lte 30>>
			<span class="block-menu">
				[[Work|Office]]
			</span>
		<<endif>>
	<<endif>>
<<endif>>

this thing is really works but i must go to another passage and back to home when time is match, how i can show the WORK menu whenever i press the fast forward button and the time is match without leaving current passage?

thx before, and sorry for my bad english.

Comments

  • You could just link the current passage to itself in the button.

    <<button "">>
    <<set $gameDate.setHours($gameDate.getHours() + 1)>>
    <<display "Clock">>
    <<goto "Home">>
    <</button>>
  • edited March 2017
    Claretta wrote: »
    You could just link the current passage to itself in the button.
    Agreed. That's probably what I'd suggest as it keeps the history from becoming out-of-sync with the player's actions.

    Claretta wrote: »
    <<goto "Home">>
    While that would work, I don't think hard coding the passage name is necessarily what caberg needs.

    Something like one of the following would, I believe, be the answer:
    → Using a backtick expression
    <<button "">>
    <<set $gameDate.setHours($gameDate.getHours() + 1)>>
    <<display "Clock">>
    <<goto `passage()`>>
    <</button>>
    
    → Using a temporary variable
    <<button "">>
    <<set $gameDate.setHours($gameDate.getHours() + 1)>>
    <<display "Clock">>
    <<set _passage to passage()>>
    <<goto _passage>>
    <</button>>
    
  • @Claretta and @TheMadExile , thx a bunch for this .. its what i need
Sign In or Register to comment.