Timed Input Number Window

ChizWhiz12

Villager
Member
Joined
Dec 14, 2016
Messages
14
Reaction score
1
First Language
Filipino
Primarily Uses
Good day to all! I am currently working on a game for a school project. A primary mechanic I want in the game is a sort of quiz system in battles that only allow you to attack if you get the correct answer which will be entered using "Input Number". Everything is up and running, however, I would like to have a time mechanic wherein after the timer runs out, the Input Number window will close automatically and turn a switch off.

I think I can do it through events but I just can't get it to work. The timer counts down to 0 and the Input Number window is still there (and so even if the time runs out, you can still put in the right answer). Maybe scripting will do the trick but I'm a bit of a dunce when it comes to that. Any amount of help will be greatly appreciated. Thanks!

TL;DR
- Once timer runs out, Input Number window automatically closes and a switch is turned off
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,088
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
This looks clunky but it seems to work...

Make a second event with Trigger: Parallel and Condition set to the switch you've turned on immediately before input. Then put these commands in the parallel event:
Code:
◆Wait:60 frames
◆Script:SceneManager._scene._messageWindow._numberWindow.onButtonOk();
◆Control Switches:#0003 = OFF
Adjust the wait time as appropriate (remember 60 frames = 1 second). The horrendous-looking line of script just makes the game think you've pressed OK to accept the input. Then the switch is turned off (as you wanted) to prevent the event from repeating unnecessarily. =)

I tested and it seemed to work for me, but let me know if you have any issues with it! :kaojoy:
 

ChizWhiz12

Villager
Member
Joined
Dec 14, 2016
Messages
14
Reaction score
1
First Language
Filipino
Primarily Uses
Thanks for responding quickly! Unfortunately, i can't get it to work. I'm not sure why. Maybe it's because I'm using common events? (sorry if I forgot to mention that). I've tried tweaking it out (using "Timer" instead of "Wait", having the Trigger as Autorun, etc), still couldn't get it to work. Here are some screenshots.
 

Kuro DCupu

Trust me, I'm a veteran RMer
Veteran
Joined
Jul 6, 2014
Messages
480
Reaction score
1,467
First Language
Indonesia
Primarily Uses
RMMV
I assume that script call is to force close the game interpreter safely...

Your Time common event should have switched off its own switch condition at the end. Turn off the Time Start switch.

Also don't use the game timer. Without a variable that constantly check the timer update, they are just visual.
 

ChizWhiz12

Villager
Member
Joined
Dec 14, 2016
Messages
14
Reaction score
1
First Language
Filipino
Primarily Uses
I assume that script call is to force close the game interpreter safely...

Your Time common event should have switched off its own switch condition at the end. Turn off the Time Start switch.

Also don't use the game timer. Without a variable that constantly check the timer update, they are just visual.


I've done what you have said yet the problem still persists. The number input window doesn't close on its own; I set it to 120 frames, been past two seconds and still nothing occurs. I've tried both parallel and autorun for the Time common event (I've attached screenshots below). Are there other ways/script calls that can be used to force close the number input window?

Also, thanks for the advice regarding the game timer, I'll keep that in mind.

 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,088
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
Ah, the battle scene works a bit differently: parallel/autorun triggers only run on the map scene. :kaoswt: I think you'll need a plugin in that case, and I can't seem to find an appropriate one. Moment-scoped troop events are like the battle version of autorun events, but this approach needs a parallel event... :kaosigh:
 

ChizWhiz12

Villager
Member
Joined
Dec 14, 2016
Messages
14
Reaction score
1
First Language
Filipino
Primarily Uses
Thanks for the response. As of now, I'm using Galv_TimerEndEvent.js as a temporarily solution. The number input window don't automatically close, but when the timer does end, even if the player inputs the correct answer he won't be able to attack (due to a common event that triggers the correct answer switch off). Thanks for the effort though, it was greatly appreciated!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top