Help with Wait command

Hello everyone! I wanted to ask for support with the "Wait" command, that is; I use the ABS system, and when the player activates a skill, a common event is also activated.

unknown.png



From there, I manage how skills work and what they activate in the background.

unknown.png


In the second screen this is where I tried to get the speed buff of my "Storm" ability to work, which should increase the player's movement speed, however the buff doesn't work properly, and blocks the player from the movement (caused by the command "Wait").

How do I tell the game to "wait" and then return the player to normal speed, without causing problems for the rest of the game?

Thanks for any help!
I dont understand the 3x 300 (equals to 900)!

but if you want to increase speed, why not make a conditional branch?


if: var 1 >= 900 (variable 1 as a timer part)
Player movement speed = 3
else
var 1 += 1 (var = +1 does the same though)
end

this way, you can turn off the switch and use the switch ON
to activate the common event.

that is how I control some timer stuff and other things.
I think what's blocking it is having the wait time inside a 'set movement route'. Just use the normal 'wait' event command. Also, when you turn the switch on in the first event, that is enough to activate the parallel common event. Why do you call the common event after that?

Edit: "Blocking" is a poor choice of words. What is happening is that you've put the wait times inside a 'set movement route' command, but the 'set movement route' is not set to 'wait for completion'. So the event does not wait for the movement route to complete (it doesn't wait for the wait times to complete) before progressing. So you player gains the speed boost only for an instant before the event progresses and sets it back to normal again.
@ShadowDragon I dont understand the 3x 300 (equals to 900)!

but if you want to increase speed, why not make a conditional branch?


if: var 1 >= 900 (variable 1 as a timer part)
Player movement speed = 3
else
var 1 += 1 (var = +1 does the same though)
end

this way, you can turn off the switch and use the switch ON
to activate the common event.

that is how I control some timer stuff and other things.

I'm trying to use your method, but I don't quite understand what value I have to link the variable to to make it work as a timer, could you please explain it to me?

@rpgLord69
I think what's blocking it is having the wait time inside a 'set movement route'. Just use the normal 'wait' event command. Also, when you turn the switch on in the first event, that is enough to activate the parallel common event. Why do you call the common event after that?

Edit: "Blocking" is a poor choice of words. What is happening is that you've put the wait times inside a 'set movement route' command, but the 'set movement route' is not set to 'wait for completion'. So the event does not wait for the movement route to complete (it doesn't wait for the wait times to complete) before progressing. So you player gains the speed boost only for an instant before the event progresses and sets it back to normal again.

I've already tried to do this with the normal Wait command, but for some reason even if the indicated time passes, the speed does not return to x3.
I've already tried to do this with the normal Wait command, but for some reason even if the indicated time passes, the speed does not return to x3.

I just tested it quickly and it works at least for me.
I just tested it quickly and it works at least for me.
If it works for you, then maybe I'm doing something wrong... I am attaching some screenshots.

Basically, the buff works (the speed increases!) But even if I wait 15 seconds (900 frames = 15 seconds right?) The speed stays at x5, and doesn't return to x3. 😅
If it works for you, then maybe I'm doing something wrong... I am attaching some screenshots.
I don't immediately see why this wouldn't work, but you are doing more strange things.

In event 108, why is turning off the switch inside of the move route? Just use the regular event commands whenever you can. You saying the speed doesn't go back down leads me to believe this switch isn't happening for some reason and the parallel event is still running.

In event 107, what does the this.act() do? I'm trying to figure out why you have the move route wait in front of it then another wait command after it.
If it works for you, then maybe I'm doing something wrong... I am attaching some screenshots.

Basically, the buff works (the speed increases!) But even if I wait 15 seconds (900 frames = 15 seconds right?) The speed stays at x5, and doesn't return to x3. 😅

Is it just that the speed doesn't decrease? But the whole process doesn't start again (like the animation inside the "Tempesta" common event etc)?
OK, perhaps a few basics help you understand.

the engine has a main game loop that contains all event objects with their command lists.
this loop is accessed once per frame.

regular events are in there non-repeating just processed once if triggered in the current loop, but parallel processes and autoruns are set to repeat and called once per loop/frame.

Now the wait command basically tells the game loop "please stop processing this command list for x loops/frames".
This looks like a wait for regular events, but reduces lag for parallels and autoruns because they are no longer processed every frame.

now each set move route and each autonomous movement create their own entries in the loop, in addition to the main event entry.
THAT is why a wait in a set move route only affects the main event if the set move route command itself is set to wait for completion.
Okay yeah, like @ATT_Turan said, the problem was that i put the Control Switch on the Move Route, and for some reason the command was ignored. Now it look like this;

unknown.png


And it works! Thank you all!

P.s: @ATT_Turan i use MOG ABS Chrono Engine, and this.act(x) is for the skill action.
Good that it works now, but it's kind of funny if the problem was that, because I tested that myself and it worked for me even when I put the switch OFF inside the 'set move route'...
It could be affected by a plugin, I don't know everything the OP has and MOG stuff tends to have some odd behaviors.
I know its solved but i have a guess what caused the initial player cant move.
You used a Parallel Common Event in your initial showcase, and in your Moveroute you choosed this Event.
That will not work, because the common Event has no ID, and since its not called from another Event, it just uses the Player ID for the Set Moveroute Command with the 3x 300 frames wait.
Which would result in overwriting the previous set move command and the player not being able to move aslong the command commands the player to wait.

To solve that try to use another Event ID and not "this Event". For example Event 1 if its not in use.

Edit: Since its allready fixed and since there are several ways to do something. Nothing needs to be done. Just wanted to mention it in case.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-wait-command.146423/