(resolved) [RPGXP] Is it possible to have 2 timers running at once?

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 86
Trainer Orange.
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?
« Last Edit: May 03, 2011, 01:28:57 AM by neutral12 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
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.

**
Rep:
Level 86
Trainer Orange.
Thank you, it works perfectly.