[RM2K3] TIMER ENDING BATTLE

Posts

Pages: first prev 12 last
author=hedge1
You have two issues:
1.) The timer runs out and boots you out of the battle.
2.) How to activate a switch in battle based upon a timer.

The first is solved with the code I provided above. Your players will have 83 minutes to complete a battle before being "booted out," which should be plenty enough time for any normal situation.

As for #2, you now have a known counter (which I've split into hours, minutes, and seconds, but you could easily leave at seconds only) available to you in battle that also can count down while in battle. So make a new battle page, have the trigger be every turn, and have the trigger call the above code. The trigger will adjust the timer appropriately and increment your counter. Then add a check to the trigger to flip a switch when a certain value is reached on the counter and voilĂ , you're golden.


I will have to test it out when I get to my computer, but I'm visual so it's hard for me to picture this working for some reason.

What happens when the timer hits 0 during battle? Does it add a bunch of time to the clock? Will the player see this happening? Sorry, I'm just trying to understand the process a bit more.


There are essentially two timers being worked here. The first is the conventional timer you're thinking of that counts down and exits the battle when it reaches zero. The second is a custom counter or sorts you store in a variable of your choosing (or in the case of the code I provided, stored in three variables for hours, minutes, and seconds).

The first timer you would want to hide as it will not provide valuable visual feedback to the player. There really isn't a way to avoid this. It just exists because all other common events stop running when you enter a battle, so the only way to keep tracking time is with the default timer built into the system.

The custom counter, meanwhile, is your real timer. You can count that up or down (in my example, I counted up since I used this to track time spent by the player in the game) and run scripts when certain numbers are reached. So for you, you would probably count down and when it hits zero, reset it and flip your switch.

In battle, because the custom counter code won't automatically trigger every second, you instead reference the first timer every battle turn. On that turn how much time has elapsed from the battle timer is checked and added/subtracted from your counter and then the first timer is reset and the process repeats itself. This way you can accurately keep time in or out of battle and run scripts from that time keeping. Hopefully that makes sense.

Just to be 100% clear, you won't be able to display a seconds timer in the battle because there is no parallel process in the battle. If you still want to show something to the player, I would recommend showing a number of objects, like 10 dots, based upon how much time is left. That way it won't be so obvious that the counter isn't updating every second since it will be a while between updates and turns should come frequently enough to catch that. There is still the case where the player sits in a menu and refuses to enter a command while letting the timer count down, in which case it will appear to stall and then count down all at once. But such is life with the rather finicky battle system of rm2k3.
Pages: first prev 12 last