Greetings to you all,
Im trying to create a simple way to countdown days and change a variable to continue with the story, here is an example, I created this:
Then on the story I did this:
Basically, what I’m trying to do, is to set a variable after certain number of cycles (or sleep) and I want it to be this way so I can add multiple events at the same time
Script does countdown the days, but it doesn’t change the variable, how can I accomplish this?
Or it there a better way?
Thanks!
Im trying to create a simple way to countdown days and change a variable to continue with the story, here is an example, I created this:
Code:
class current_event:
def __init__(self, daystopass, variabletochange, changeto):
self.daystopass = daystopass
self.variabletochange = variabletochange
self.changeto = changeto
Code:
$ current_events_ongoing = []
e "With 3 nights I should be fine"
$ nightsleep = current_event( 3, "current_story_state", 2)
$ current_events_ongoing.append(nightsleep)
$ current_story_state = 1
label night_cycle:
if current_story_state == 2:
e "Im well rested!"
jump end_story
else:
e "I need more sleep"
jump sleep_again
label sleep_again:
e "Im going to bed"
python:
for event in current_events_ongoing:
event.daystopass -= 1
if event.daystopass <= 0:
event.variabletochange = event.changeto
current_events_ongoing.remove(event)
jump night_cycle
label end_story
e "Thanks for the sleep"
Basically, what I’m trying to do, is to set a variable after certain number of cycles (or sleep) and I want it to be this way so I can add multiple events at the same time
Script does countdown the days, but it doesn’t change the variable, how can I accomplish this?
Or it there a better way?
Thanks!