[RM2K3] SETTING A FUNCTIONAL TIMER

Posts

Pages: 1
i'm trying to create an event where the protagonist has to exit an area before a timer counts down - otherwise, the game ends. so far though, i've been having a lot of trouble getting the timer to work. it doesn't show up anywhere on the screen after i set it. i consulted a thread about how timers work in rmvx and tried to follow the instructions, but i still can't get the timer to show up. some help would be appreciated!

here's what my event currently looks like -

pianotm
The TM is for Totally Magical.
32367
Set two common events to switch trigger parallel process. Turn on the assigned switch to start the timer.

Common Event 1:
Parallel Process
Variable: [0001 Timer] = 60
Wait: 1.0 seconds
Variable[0001]: =-1

Common Event 2:
Parallel Process
Conditional Branch
>If variable is 60
>Do something that shows us 60 seconds is left.
>End

Conditional Branch
>If variable is 59
>Do something that shows us 59 seconds is left.
>End

Conditional Branches
>If variables 58 to 1
>Do stuff for each number.
>End

Conditional Branch
>If variable is 0
>Game Over
>End
Are you starting it? There should be an option like "Show timer" after you select start.
pianotm
The TM is for Totally Magical.
32367
Sorry, I was thinking of making stylized timers. The regular timer will be easier.

Yeah, two operations: Set time and start timer. Switch to a new page, parallel process, have a conditional branch waiting for the timer to hit 0 and then triggering your game over.
thank you for your help! i did get the timer to show up, but i'm having a little trouble understanding how the variables work, so the time doesn't wind down - it just stays at fifteen seconds. i tried consulting a timer tutorial, but i think it was designed for another type of rpgmaker, so i got lost. what should the variable box look like if i want to have a working timer?
I would do this:


Here is what a variable box should look like for the part that increases time.

----------------------------------------


I forgot to add something important here, at the bottom of this add a wait of 1 second. That way, it increases the second variable once every second, just like real life! And after 60 seconds, adds a minute to the mix.

This part needs to be running on parallel process.

----------------------------------------


This would be on a different event and is used to determine when time is up. In this case my timer is 1:15.

On the left the precondtion means, do this code only if more than a minute has passed.

Once it does, this event code kicks in, and checks to see if 15 seconds have passed. Oops, there should be a wait of 1 second here too. Because time only moves once per second, so checking it any sooner than that isn't needed.

Once 15 seconds have gone by, the message appears. This is where you put the code for whatever happens next.


This is the basic idea. It would need to be tailored to what you are trying to do. Switches may be required to disable this stuff after it runs. But this is the bare minimum to set a timer.

***
One benefit of doing seconds, minutes, hours, etc, is that each one has it's own variable and can be used in message boxes to write out the time.

Branch if Variable[Seconds] is less than 10
Message: /v[3]:0/v[2]
else
Message: /v[3]:/v[2]

***


You could do all this with subtracting but I find it easier to manage and think about with adding. You could leave this timer go for the whole game. It could be used to figure out play time. The same increase of seconds could be used to set and trigger multiple timers, but that's another topic.
Pages: 1