Rpg Maker MV: How to disable player movement until button press.

LGardner

Regular
Regular
Joined
Dec 23, 2018
Messages
42
Reaction score
8
First Language
English
Primarily Uses
RMMV
Hello,

I would like to have a cannon event which does the following:

If you touch the cannon event, the player turns invisible and cannot move. (Imagine that you are placed inside the cannon).
While inside, if you press a button, the player is turned visible again, and "fired" in a certain direction.
Once the flying movement stops, the player regains the ability to move.

I feel like this should be possible without plugins. I attach a couple of screenshots of what I have so far, but I don't know how to stop the player from moving while inside the "cannon".

Cannon1.PNG
Triggering the cannon event.


Cannon2.PNG
Firing the cannon.

Thank you in advance.
 

Mac15001900

JavaScript wild sorcerer
Regular
Joined
Aug 7, 2022
Messages
392
Reaction score
524
First Language
English
Primarily Uses
RMMV
I can see two plugin-less ways of doing it:
- Don't end the event that puts the player in the cannon. After getting 'into' the cannon, have a loop with a wait command, and a conditional that breaks the loop when a button is pressed. Then do the launching.
- Stop the player's movement with other events. Surround the place the player stands with invisible events (without a sprite), set their priority to "Below characters", and have another page turned on by a switch with "Same as characters". Note that while this stops the player from moving, it doesn't stop them from turning, so those events would also need to react to the action button (e.g. setting a switch that the cannon reacts to).

And a side note, there's also a jump movement command, which might look a bit more like being fired from a cannon, though that depends on exactly what look you're going for.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
5,258
Reaction score
4,734
First Language
EN
Primarily Uses
RMMZ
set their priority to "Below characters", and have another page turned on by a switch with "Same as characters"
Just to note: while no event page conditions are met, the event will be inactive ("page -1"). So if the first "Below characters" page is invisible and doesn't do anything then it is harmless but unnecessary.
 

LGardner

Regular
Regular
Joined
Dec 23, 2018
Messages
42
Reaction score
8
First Language
English
Primarily Uses
RMMV
I can see two plugin-less ways of doing it:
- Don't end the event that puts the player in the cannon. After getting 'into' the cannon, have a loop with a wait command, and a conditional that breaks the loop when a button is pressed. Then do the launching.
- Stop the player's movement with other events. Surround the place the player stands with invisible events (without a sprite), set their priority to "Below characters", and have another page turned on by a switch with "Same as characters". Note that while this stops the player from moving, it doesn't stop them from turning, so those events would also need to react to the action button (e.g. setting a switch that the cannon reacts to).

And a side note, there's also a jump movement command, which might look a bit more like being fired from a cannon, though that depends on exactly what look you're going for.
Thanks, I've used the 2nd method and it seems to be working well. As Caethyril says, the "below characters" page doesn't seem to be necessary. I attach pictures of the current set-up in case it helps anyone who wants a similar effect, and also in case anybody here spots anything which I am doing wrong which might lead to problems. If nobody spots any problems in the next few hours then mods please feel free to close the thread as resolved. And thank you very much, again.

Cannon4.PNG
Cannon5.PNG
Cannon6.PNG
And finally, these are the invisible events that surround the cannon:
Cannon7.PNG
 

Mac15001900

JavaScript wild sorcerer
Regular
Joined
Aug 7, 2022
Messages
392
Reaction score
524
First Language
English
Primarily Uses
RMMV
I have one thing worth noting about this: the faster the player's speed, the faster a jump will be completed, which actually affects the flight path. For lower speeds, the player will often go "higher", since they can spend more time airborne, but overall will still move rather quickly.
I'm not saying speeding up the player is wrong, it might just be perfect for what you're trying to do, but I do recommend trying this out with different speeds to see how they'll look like.

EDIT: And also, thank you for posting the full solution, it just might help someone in the future :)
 

Latest Threads

Latest Profile Posts

Yknow what? Im seriously considering recruiting a manager to oversee my games development.
Because I cannot focus or complete these tasks by myself. I need someone to give me orders, without having them be my boss.
yp_4vS.png

Remember my latest plugin for rpg maker mz:

Acknowledgement Window is now available!

Take a look here:

Got my focus back, 9/59 maps have the door fix in place now.
Making a small RMMV project has made me realize that I've never actually made a credits sequence for a game.

Forum statistics

Threads
136,802
Messages
1,270,177
Members
180,557
Latest member
wellaa
Top