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

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,976
Reaction score
2,299
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
525
Reaction score
1,531
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

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,976
Reaction score
2,299
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!
 

Latest Threads

Latest Profile Posts

Mod name: "[Game name] Gameplay Overhaul"
What they actually mean: "Here is a mod that makes the game harder."
I decided to reinstall one of my most favourite game of all times, Gothic 2. Time to get back to Khorinis!
So much game make... I needs to rest. The foods call.
-Casino with bunnysuit green check.png
1638563168795.png
Monday December 6th 2021 at 7PM Hawkzombie will stream A Thief's Voyage on his Twitch.

Hawkzombie Twitch

Check it out.​

Forum statistics

Threads
117,162
Messages
1,105,058
Members
153,249
Latest member
Jon_Doe
Top