Forum rules - please read before posting.

Help with making a day, time system!

So I'm trying to make a time system where the player wakes up at 7:00AM and when he does a action in game like (Study) the time progresses by a hour, each hour would have Npc's in different places, and such. I'm not that smart, so if you could do it step by step that would be the best!

Comments

  • If you create a global integer variable, you can keep track of the current time. When the day starts, set it to 7. When the player performs an action (like studying), add 1 to the time variable and run an actionlist that teleports the NPCs to their new places.

    You can structure this actionlist by chaining variable checks. If the Time variable is 7, teleport the NPCs to certain places. If it is not, check if the Time variable is 8. If it is 8, teleport the NPCs to a different set of places. If it is not 8, check if the time variable is 9, etc, etc, etc.

  • I think I know how to do the bottom part, but I'm still not too sure on the top part, still very new, sorry to ask but could you go a little bit more into detail on the top part, I did the global integer variable, and have it set to 7, also how would i have it effect the menu displaying the time, again sorry!

  • edited February 3

    Welcome to the community, @SmithIan.

    The Variable: Set Action can be used to update a Variable's value.

    If you have this refer to your Integer, set the Method to Increase By Value and then Statement += to 1 to increase its value by 1.

    You'll then need to run further Actions that update the NPCs. You could run these as part of the same ActionList, but it'd be cleaner to place them in a separate ActionList that gets run after the Variable gets updated.

    To display a Global variable's value in a Menu, add a Label element and set its Label text to the variable's Replacement token, as listed in the Variables Manager. At runtime this token will be replaced with the variable's current value. A tutorial on this concept can be found here.

    A similar thread on the topic of scheduling can also be found here.

  • Ty for the reply ChrisiceBox, managed to figure it out in the end, :D

Sign In or Register to comment.

Howdy, Stranger!

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

Welcome to the official forum for Adventure Creator.