The RPG Maker Resource Kit

RMRK RPG Maker Creation => XP => Topic started by: neutral12 on May 02, 2011, 10:25:49 PM

Title: (resolved) [RPGXP] Is it possible to have 2 timers running at once?
Post by: neutral12 on May 02, 2011, 10:25:49 PM
I am not sure if this is just me. But in RPGXP, it seems that you can only have 1 timer running at a time. But what if I want two different timers running at once? Can this be done?
Title: Re: [RPGXP] Is it possible to have 2 timers running at once?
Post by: modern algebra on May 02, 2011, 10:51:59 PM
Not without manually eventing it. It's very easy to do an invisible timer. All you need is a parallel process event with some wait frames, a variable, and a conditional branch. Ie. you set a variable to the number of seconds you want the timer. So Variable = 120 (for two minutes)

In the parallel process:
Wait: 60 frames
Variable -= 1
Conditional Branch: Variable <= 0
  # Timer runs out
Branch END


If you want it to be visible, then you will need to do some picture eventing. This isn't hard so much as tedious; all it would involve is some modding and dividing of the variable and a method to show each digit. Ie. If you have 114 second left on the timer, you want to show 01:54. To get seconds, you first mod by 10. That will give you 4 and then you show it using Conditional Branches (ie. if var == 0 Show Picture 0, etc...). Youw ould then get the 10 seconds, which you do by modding the original by 60 and dividing by 10. You get minutes by dividing by 60 and modding by 10. You get the tens by dividing by 600.
Title: (Resolved) [RPGXP] Is it possible to have 2 timers running at once?
Post by: neutral12 on May 03, 2011, 01:28:42 AM
Thank you, it works perfectly.