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,660
Reaction score
13,270
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

So I just spent the weekend...playing my own game. The one I released last year. Yep you heard that right.
Goal for MZ? None... I'm still curious how to finish my VXA project and how it looks like when it actually finished. Which will take at least another two years. Coming late again to the party.
Finding it amusing that people are posting support questions in new threads for an engine that isn't even released yet. Touch and Archeia are the only ones authorised to say anything, and there's only one active thread where they'll be answering questions.
I think my goal for MZ ... is to actually release a game and not have twenty technical demos and debugging projects. Let's see if I can manage that. ;o
I am starting to enjoy writing. I never thought I would enjoy it since my dyslexia was holding me back so much.
Thanks to the community here :)
For those interested chapter 2 and 3 are available to read here:

Forum statistics

Threads
100,652
Messages
978,095
Members
132,261
Latest member
DarthNinjus
Top