Hello, I have an item that increases player speed x2 for 10 seconds. I am using a common event to achieve this. I know that this works because only using increase speed x2 works, but the wait causes it all to fall apart. Whenever I use a wait it causes that player to wait the amount of frames specified. I don't have the trigger set to autorun and no switches are attached to the common event. Thanks
Common Event "wait" command causes player to stop moving
RPG Maker VXAce SupportI'd probably make the common event do the increase speed then turn on a switch. Then make a second common event that's set to parallel process, conditioned by that switch, that will do the wait, decrease speed, and turn the switch off again.
Can the player have multiples of these items? What happens if they use another one before the first 10 seconds has run out? If you want them to stack, try this method ...
Common event 1 adds 10 to a variable (do not use this variable for any other purpose in your game), increases the speed, and turns on a switch.
Common event 2 (set to parallel process and conditioned by the same switch) does a Wait for 60 frames (1 second), decreases the variable, then does a test for variable = 0. If it is, decrease speed and turn off the switch.
That way, if the player uses the item, they get increased speed for 10 seconds. If they use the item again 5 seconds later, they get an additional 10 seconds on top of the 5 seconds that remain from the first use.
The only time this would cause a problem is if they use the item a second time right at the end of the 10 seconds, and the switch on happens after the second common event detects the timer variable has reached 0 but before it turns the switch off. But that would be very, very rare.
Can the player have multiples of these items? What happens if they use another one before the first 10 seconds has run out? If you want them to stack, try this method ...
Common event 1 adds 10 to a variable (do not use this variable for any other purpose in your game), increases the speed, and turns on a switch.
Common event 2 (set to parallel process and conditioned by the same switch) does a Wait for 60 frames (1 second), decreases the variable, then does a test for variable = 0. If it is, decrease speed and turn off the switch.
That way, if the player uses the item, they get increased speed for 10 seconds. If they use the item again 5 seconds later, they get an additional 10 seconds on top of the 5 seconds that remain from the first use.
The only time this would cause a problem is if they use the item a second time right at the end of the 10 seconds, and the switch on happens after the second common event detects the timer variable has reached 0 but before it turns the switch off. But that would be very, very rare.
the key thing is the common event 2 @Shaz mentioned. the reason you cant move is because an event is running that is not a parallel event
That worked! Thanks so much!
Original thread: https://forums.rpgmakerweb.com/threads/common-event-wait-command-causes-player-to-stop-moving.140054/