[RM2K3] WAIT IN A PARALLEL PROCESS

Posts

Pages: 1
I want to create a timer in the RPG Maker 2003 game. It works fine with Parallel Process and a Wait, when the wait is over, the player return to try again if he want to but the player can also lose by enemies and the player will also return to try again. At that moment, I put the trigger switch off so the timer stops running. However, when the player choose to try again, after he lost the first time by enemies, the timer continues where it left off.

For example, the wait in the parallel process takes 60 seconds, when the player loses by enemies at 28 seconds and tries again, the timer starts with 32 seconds it has left but I want to make sure that the timer start at 60 seconds again.

Does someone know how I can fix this problem?
Don't use a wait like that. Start a timer, enter a loop with a short wait and see if the timer either ran out or the player met the success conditions. For example:


Timer A Set 60 seconds
Timer A start

Loop Start
Wait 0.5 seconds
If Switch 1 "Success" is ON
Goto END
Endif
If Timer A Time Left == 0 seconds
Message "FAILURE"
Teleport Player to Start of Maze
Goto END
Endif
RepeatLoop

Label END
Timer A stop

Once this event starts it'll start a timer that you can set to show to the player and if it runs in battle. Twice every second it'll see if the player either succeeded via a switch or if they ran out of time (and repeat the check until either occurs). If the player fails do as needed to bring them back to their initial state then end itself by stopping the timer. If the player succeeds just stop the timer.
Thanks! It works better but when the player has to return because of some other reason, the timer won't start a second time. I first stopped the Parallel Proces switch and the Timer A but when I want to try it again, the timer doesn't go a second time.

And is there a way to put the timer in the middle top? Or does it always needs to be on the upperleft corner?
If you want the timer to end set the Success switch to ON. Add it to any non-timer failure events. If it's in a common event with a parallel process here's my suggestion of how to work it:



Common Event - Parallel Process on Switch 2 "TIMER GO" is ON


Timer A Set 60 seconds
Timer A start
Switch 1 "End Timer" = OFF

Loop Start
Wait 0.5 seconds
If Switch 1 "End Timer" is ON
Goto END
Endif
If Timer A Time Left == 0 seconds
Message "FAILURE"
Teleport Player to Start of Maze
Goto END
Endif
RepeatLoop

Label END
Timer A stop
Switch 2 "TIMER GO" = OFF

This should make it easier to trigger on or off. Set the "TIMER GO" switch to ON when you want it to start and it'll start going (and now it resets itself even! That was an oversight). When you want it to turn off set the "End Timer" switch to ON which will make the common event exit the loop, turn off the timer, then make the common event turn off the "TIMER GO" switch so it can end properly. That might do it, this is all from memory at work.

I don't know of any way to move the timer though. I think Timer A goes in the upper left and Timer B goes in the upper right but beyond that, nope. Maybe there's a hack/patch but I've never used those and wouldn't know where to start either.
author=GreatRedSpirit
If you want the timer to end set the Success switch to ON.


Your first line did the job. I needed the jump out of the loop, even if the player loses by some other reason. Thank you! This is really much better. I already filled the top right and the top left corner so I need to find another way for the timer but I thank for your help. :)
Glad to hear it works. One alternative is to make your own timer to show to the player. You can get the number of seconds left on timer 1/2 and put it into a variable (it's under 'Other') and then use that value to show a depleting bar or so.
Pages: 1