Basically I am using a class that has spells dependent on the weather. She can change the weather by using a spell but I want the weather that she creates to run on a time limit. That way, when the time limit is up, the weather will change back to normal thus blocking her ability to use certain spells. Thanks in advance for any help 😀
Is there a way to use a time limit to activate switches or common events?
RPG Maker MZ SupportMaybe use the "Wait" command? Or how about the "Timer" that loops?
The timer doesn't work as it just activates a timer on the screen then goes to the next line for the event. I tried using the wait command but it makes it so you can't move at all while the even is playing. So once the spell is cast the player wouldn't be able to move for the duration of the spell. This defeats the point as you cant actually do anything with it then.
You can just have the spell turn on a switch that triggers a parallel common event that will increase a specific variable by 1 every 60 frames (which should be equal to 1 second in most cases) and also check the value of said variable. If it reaches a certain amount (let's say, 200), it will set the variable to 0, change the weather to whatever the default one is supposed to be and turn the relevant switches off, including the one that activetes the common event.
Maybe make a different, separate event that is parallel and uses the "Wait" command/function?
So, if I am understanding this correctly, maybe I should set the "Rain" spell to trigger Common Event 1 (adding a rain effect) and also trigger Common Event 2, which would be a parallel Wait event and after the Wait is over, have it clear weather?
I will be honest, I have not really messed around with variables much. How would I go about that? I'm in the "Control Variable" event command and I'm not sure how to set that up.
You make a parallel Common Event and have it include the Wait 60 frames, Increase Variable by 1 event commands and lastly, a Conditional Branch (If variable equals or is larger than 200), with the code concerning the weather changes inside that conditional branch.
The Countdown TImer is not a synchronized Command and will not pause the event. Instead, you usually make another event with a parallel process and a Switch "Timer is running" as condition. Using IF Conditions you can check how many seconds are left on the timer and you can react as soon as the timer hits 0.
This works perfectly! Thank you, one more question, is there are way to make the timer not show up on the screen but run in the background?
With a Plugin it should be possible. But I dont know if there's one out already.
You can do it with variables if you don't want the timer to be shown.
Thank you, I got it working properly. I have a question, will this event (Set as parallel) still run if I go inside a building (ie, transfer to a new map)?
No, an Event will stop then. But you can use Common Events, you see them in the Database.
If it's a Common Event, then yes.
Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-use-a-time-limit-to-activate-switches-or-common-events.130844/