RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
(resolved) [RPGXP] Is it possible to have 2 timers running at once?

0 Members and 2 Guests are viewing this topic.

**
Rep:
Level 87
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 Most Mature Member2010 Favourite Staff 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 87
Trainer Orange.
Thank you, it works perfectly.