Making a day system, having some issues

So, it’s been a while since I’ve tried my hand at this, and while it’s not inherently important I’d like to see if I can’t get it to work.

So, in my game I’m trying to make a time system. After certain scene it adds +1 to the time, marking it as the next day (Up to 7, for days of the week), before resetting to one.

My issue is I’m not 100% sure as how to set it up.

I’ve been playing with it and currently have it set up like this-

*if date = 1
*set day “Monday”
*finish
*if date = 2
*set day “Tuesday”
*finish
*if date = 3
*set day “Wednesday”
*finish
*if date = 4
*set day “Thursday”
*finish
*if date = 5
*set day “Friday”
*finish
*if date = 6
*set day “Saturday”
*finish
*if date = 7
*set day “Sunday”
*finish
I can’t do it without the *finish, it won’t let me put it in any other way. I’ve tried *elseif and that threw issues at me too. I don’t think the *finish part is correct, as it’s not a scene, but a setting, so if I try to stick it anywhere it just skips past. Am I being dumb about this?

It will only ever happen after certain scenes, correct?
Will these scenes occur at set moments within the story or can one get the scene from a ‘pool’.
Like
A) scene 1, 2, 3, switch, 4, 5, switch etc
Or
B) start 4 3 switch 1 5 switch 2?

Because if it is A, as far as i understood it just using
*set day “tuesday”
after the scene should be easiest.

My intention is to use them after certain options, showing a progression of time, but then looping back to previous options. I also have a setting I’d like to implement during time, too (like morning, afternoon, evening), and once evening hits to change it to the next day.

I have no idea if I explained that correctly but for a short while in the game you’re working your way through the day. Now, I could just plain ignore that and just do the morning/afternoon/evening, but if I can make it show up that it’s Monday-Sunday, I’d like to try.

My goal is to be able to make a plan for say, Sunday, work your way up to it and then actually do what it was that you wanted, or forget it, so events are entirely up to the player.

The command *finish will go to the next scene in the scene list.

Mhnn, okay, so, correct me if I understood the intention wrong.
You want your game to go like this:

Start (monday, morning)
I
choice
I         I       I        I
A(morning)  B(m) C(m) D(m) (we'll take A)
I
choice
I I I
B(noon) C(noon) D(noon) (we'll take D)
I I
B (evening) C(e) (we take B)
I
C (night)
I
next day
I
choice
A B C D etc

as in: you have the intro and then scenes that have different version according to what time of day it is and you switch the day once one is through all scenes?

That’s pretty much it, yeah.

Then the best thing I can think of would be this:

*create time 0
*create day "monday"
---
then in the first scene at the choice where to go:
*label monday
*choice
   *hide_reuse #go a
      *if time =0
         *goto a_morning
      *elseif time =1
         *goto a_noon
      *elseif time =2
         *goto a_evening
      *else
         *goto a_night
   *hide_reuse #go b
         *goto b_morning
      *elseif time =1
         *goto b_noon
      *elseif time =2
         *goto b_evening
      *else
         *goto b_night
etc
then at the labels:
*label a_morning
*set time +1
TEXT and Stuff
*if time =4
   *finish
*else
   *goto monday

And then in the next scene:
*set time 0
*set day "tuesday"

Making play can be accomplished by having variables for certain activities like. Let’s say going to the movies on saturday evening.

*create sat_movies false

Saturday's choice would look like this:

*label saturday
*choice
   *hide_reuse #go a
   etc
   *hide_reuse #go b
   etc
   *if ((sat_movies) and (time =2)) #go movies
      *goto movie_night
   *hide_reuse #go c
   etc
   *hide_reuse #go d
    etc

And assuming movie night would last till the next day, instead of going back to the saturday label and the choices, end it with finish and proceed to sunday.

1 Like

I think I can make that work! Thanks!

good luck :slight_smile:

I clicked this because I thought it would be an interesting concept but my noob brain just nope’d the fudge out of here after trying to understand all that code… :joy:

He wanted a neat trick that enabled options for certain days of week. Is that right?

Someone else or I could write a more detailed version of the example code later if you like.

I think I’m not quite there yet, so I don’t want you to go through that extra work for me…
But thank you so much for offering!

This is a basic example from me. Assuming there’re 2 activities that can be chosen (water the crops every day, except when farming the crops every 7th date), this is how it should look.

*create date 0
*create day "sunday"

--------------------------
*label daily
What would you like to do?
*choice
   *selectable_if ((date modulo 7) != 0) #Water the crops
      You watered your crops. Splish splash.
      *goto timer
   *selectable_if ((date modulo 7) = 0) #Farm the crops
      Time to bring out that scythe. Obviously, you also replanted the field.
      *goto timer
---------------------------------
*label timer
*set date +1
*if date >= 31
   *set date 0
   *goto timer

<<Assuming one month is 30 days, we also need to reflect that in our day cycles.
The easiest way to do this is simply to let the cycle go +1 +1 and
"loops back to 0" when it reaches sunday.>>
*if day = "sunday"
   *set day "monday"
   *goto daily
*elseif day = "monday"
   *set day "tuesday"
   *goto daily
.
.
.
*elseif day = "saturday"
   *set day "sunday"
   *goto daily

<<Optional bug catcher>>
*else
   *bug You're not supposed to be in here. Bug at day cycle.

Feel free! I searched a bit earlier and couldn’t really find anything on the topic, so more examples/ways to do it the better!

I’m going to flesh out what I said above

SCENE 1 First Monday

Text with some choices
*label monday
*choice
   *hide_reuse #Option A
         *goto a_morning
      *elseif time =1
         *goto a_noon
      *elseif time =2
         *goto a_evening
      *else
         *goto a_night
   *hide_reuse #Option B
         *goto b_morning
      *elseif time =1
         *goto b_noon
      *elseif time =2
         *goto b_evening
      *else
         *goto b_night
   *hide_reuse #C
         *goto c_morning
      *elseif time =1
         *goto c_noon
      *elseif time =2
         *goto c_evening
      *else
         *goto c_night
   *hide_reuse #D
         *goto d_morning
      *elseif time =1
         *goto d_noon
      *elseif time =2
         *goto d_evening
      *else
         *goto d_night
      *if (time <=1) #Sleep in
         Text
         *set time +1
         *goto monday
      *if (time =2) #go to bed
         Text
         *finish

*label a_morning
Storytext
*choice
   #spent more time here
      text
      *goto moretime
   #do something else
      text
      *goto monday

*label moretime
*set time +1
text on what you do now it's midday
*choice
   #spent more time here
      text
      *goto moretime1
   #do something else
      text
      *goto monday

*label moretime1
*set time +1
text and now it's the evening, and the player can pick to do something on tuesday
*choice
   #do x on tuesday
      *set tuesday_x true
      *goto next
   #don't do thing
      *goto next
*label next
more text
*choice
   #spent more time here
      text
      *goto moretime2
   #do something else
      text
      *goto monday

*label moretime2
text and it's now night
*finish

SCENE Tuesday
*set day "tuesday"

It’s not much more (will edit once my brain cooperates)

Hum So is for That kind of thing that gotoref is for!

*temp day
*set day "Monday"
*gotoref day

*label day
This label will not be displayed, as we're using the variable value method.

*label Monday
This label WILL be displayed as "Monday" is the VALUE of the variable 'text'

*choice
  #normal choice here
     *gosub_scene Normal stuff
    *return
  #Monday choices here
    *gosub_scene Monday stuff
    *return

Not necessarily, assuming monday 2 will be different from monday 1. So one fares better, likely with having the days as scenes instead of the activities.

1 Like

I’ve done a bit more messing with the code and I might have figured out a bit more, using the *gosub command.

Basically, what I did was this

*label time
*if daysn = 1
    *set days "Monday"
*if daysn = 2
    *set days "Tuesday
*if etc.
*return


Then, during the choices/texts, something like this

text text text text text
*choice
    #choice A
      *set daysn + 1
      *gosub time
      *goto next_part
    #choice B
       *set dayns +2
       *gosub time
       *goto next_part

*label next_part
Today is !{days}

In doing so, making choice A show up as Monday, and choice B will show up as Tuesday, all it takes is adding an extra command when necessary- though be aware! *set needs to go before *gosub or it’s going to mess it up.

I think you need to

*set dayns 2(etc)

not +2 etc cause the plus would keep adding and adding.