[solved] How to refresh variables

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
BigOlFrog
Newbie
Posts: 1
Joined: Sun Mar 03, 2019 10:43 pm
Contact:

[solved] How to refresh variables

#1 Post by BigOlFrog »

Hello, I am making a adventure game where I am planning on having characters have a simple schedule based on a time variable. I was thinking on how I could update their location based on when the time variable has been updated (a number added to it).

I have two variables for time which is dtime and day which are both tied to the screen so it updates. They both have a limited number amount (e.g day%7 and dtime%6) and change the time state depending on the number. The only time when time is changed is when an action happens (fights or character events).

So I was thinking maybe I have to make a function for whenever a action happens (that changes time) it would update the schedules and bring you back to that location or label you just were.

I was wondering would I go about doing this.
Thanks.

[edit]
I figured it out.
what I did is I made a variable called mc_location which is the label pretty much, but it changes depending on what label you are on. Anyways what I do is use a label called refresh and update/change all the characters location from what time it is and use "jump expression [mc_location]" to go back to that label/location.
I also have a mc_rollback in case I need a second layer.

Post Reply

Who is online

Users browsing this forum: Google [Bot]