Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

common event problem(xp)

im not 100% sure but i think i have a problem, i have a comment event that i run in the background that waits 12 sets of 999(10 min or so) then does its thing then starts over, but im thinking that it starts over every time i go to a new map, so basicly im asking if it does start over and if it does is there any way that you can tell me how to stop this, because i really need an event that runs once every ten min(and i dont want the user to see the timer)
 
I had this problem when I created a day/night system. My solution was to record a variable after every wait. Then, I created conditional branches so it would continue from the place it left off (about). Like this:

Code:
@>Conditional Branch: Variable [0001: Yada] == 1

     @>Wait 999 frames

     @>Control Variable: [0001: Yada] == 2

 :   Branch End

@>Conditional Branch: Variable [0001: Yada] == 2

     @>Wait 999 frames

     @>Control Variable: [0001: Yada] == 3

 :   Branch End

Other than that, I haven't been able to find a way to keep a parallel common event from resetting when the player changes maps.
 

Zeriab

Sponsor

That's not a good idea Guardian since parallel common events restart when you go to a new map.
You should instead use a variable and decrement it every X amount of frames.
When it is less or equal to 0 you know that 10 minutes (or whatever) have passed and you can do what you want to happen after 10 minutes before (or after) setting the variable to the amount of frames you want to wait.
For reference here is a generic variable based timer which works across maps.
securewaitcf1.gif


*hugs*
- Zeriab
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top