Howdy, Stranger!

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

Displaying a future date

Using Sugarcube 2, how should I go about displaying a certain future date based on a variable that changes as play advances? For example, if my story was written to start today, August 30 2016, and advance one day per turn, how can I display "September 2 2016" when $turn == 4?

I don't need the start date to change; that'll be set. I'm just wanting an in-game calendar that advances with play. Past discussions of date and time have focused on the actual date and/or time, not an in-game progression.

Comments

  • edited August 2016
    I had a somewhat similar problem in my game, I wanted to display the date on the left in the sidebar, to do this I made a "StoryCaption" passage and put the following code into there.
    <<if $day == 1>>Monday
    <<elseif $day == 2>>Tuesday
    <<elseif $day == 3>>Wednesday
    <<elseif $day == 4>>Thursday
    <<elseif $day == 5>>Friday
    <<elseif $day == 6>>Saturday
    <<elseif $day == 7>>Sunday
    <</if>>
    
    <<if $day gte 8>><<set $day == 1>><</if>>
    

    and whenever I wanted to progress the game forward I would write:
    <<set $day += 1>>
    

    I guess you could do the same thing and replace the days of the week with the specific dates.
Sign In or Register to comment.