Timer issues

Inkarana

Villager
Member
Joined
Apr 26, 2020
Messages
5
Reaction score
2
First Language
German
Primarily Uses
RMVXA
Hello people,
so I tried to use a timer and if it runs out, it should trigger a game over - but it doesn't.
It starts its countdown, but when the timer reaches zero, nothing happens. Switch 27 works just fine, even when the timer reached 0:00.
Can you please help me? Thanks in advance!


Timer 1.png
Timer 2.png
 

Mhin Ra

Veteran
Veteran
Joined
Aug 17, 2015
Messages
61
Reaction score
18
First Language
English
Primarily Uses
RMVXA
I've never used the Control Timer before, but looking at the code (and doing some brief experiments), I think all that happens on a control timer ending is that the current battle is aborted... which doesn't seem like what you want.

I think you can probably get what you need with a Timing -> Wait (1200). (1200 = 20 seconds * 60 frames\sec) If the UI refuses to allow more than 999 (which, IIRC, it does) you can either do two wait(600) right after one another or use a script like this:

1200.times { Fiber.yield }

which is all that the wait command in the UI actually does.

As a side note: your first page is Autorun, which means it will block user interactions while it's active (which it will be for the entire duration of the wait). If what you intend is to let the player run around and do stuff while the timer is active, then you probably want to make the page with the big wait parallel as well. I think parallel events do not tick while the message window is up (FWIW), but you probably don't want to put up any text boxes while the player is in a timed event anyway.

Hope that helps!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,661
Reaction score
13,271
First Language
English
Primarily Uses
RMMV
What's on page 5?

As soon as you set the timer, page 4 will be active. It will do the check to see if the timer has reached 0 (which it won't have), so will turn on switch 27. If page 5 is conditioned by switch 27, that will immediately become active, and your checking will stop.
 

Inkarana

Villager
Member
Joined
Apr 26, 2020
Messages
5
Reaction score
2
First Language
German
Primarily Uses
RMVXA
Sorry for replying late and thank you so much for your answers!
Apparently, the self switch didn't work the way it should. The game over triggered after I used a regular switch instead of a self switch.
@Mhin Ra, thank you for explaining the auto run! I already kind of wondered why I couldn' move then :aswt:. Your idea using the wait command looks interesting as well, I think I will look into it!
@Shaz There's a conversation on page 5 five triggered by switch 27 which worked the way I wanted it to after I removed the self switch.
 

Mhin Ra

Veteran
Veteran
Joined
Aug 17, 2015
Messages
61
Reaction score
18
First Language
English
Primarily Uses
RMVXA
For what it's worth: self switches and regular switches should behave exactly the same in terms of how they trigger event pages (as well as how they are set\cleared), except of course, that you can only trigger with a single self switch whereas you can trigger on two regular switches.

If you're seeing them act differently, my guess would be that you might have another page that's unintentionally setting the self switch. Because self switches don't have meaningful names, I often find I accidentally use the same one twice when scripting an event ;)
 

Inkarana

Villager
Member
Joined
Apr 26, 2020
Messages
5
Reaction score
2
First Language
German
Primarily Uses
RMVXA
Thanks, I'll keep that in mind when I'll be working with a self switch again!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Got a nice little platform coming along backwards compatible with MV.
I'm so amazed at this ABS plugin for MV. This is a plugin that can literally fulfill my biggest game dreams, creating an Ultima VII-like game. Below is a video of a quick scenario I created to test out the plugin. The music in the video is my own composition.

The MZ Steam discussion board is filled with so much whining. Glad I never have to go there, or to any Steam discussion board. Anyway, here's something awesome:
I've been meaning to create a better trailer for my game but it takes time, so for now all I got is the same old trailer with updated footage:

Forum statistics

Threads
100,658
Messages
978,165
Members
132,273
Latest member
Tihn
Top