Freezing Player Movement Without Wait Command

Status
Not open for further replies.

TicklishWasabi

Veteran
Veteran
Joined
Nov 7, 2017
Messages
167
Reaction score
18
First Language
English
Primarily Uses
N/A
I'm making an event where the player occasionally gets pushed back with some wind, to do this I've put the gusts on a timer, and then set the move route of the player to be pushed in the appropriate direction. The problem is once they've been pushed to a place where they can't be pushed any farther (do to an immovable tile) the player is free to move forward despite the gust animation still playing. This is because I set the move route to skip if the player cannot move. (otherwise, the game would freeze when hitting an immovable tile)

I essentially want to freeze the player movement for the entirety of the gust, even if they hit a wall. Is there a script call or something I can do to temporarily disable player movement, while still allowing a move route to "move" them?
 

ATT_Turan

Veteran
Veteran
Joined
Jul 2, 2014
Messages
78
Reaction score
27
First Language
English
You could line the pathway with events that you switch on to make impassable as the player is pushed back (or just a few that you switch on and move). There might be another way to actually disable player movement, but that comes immediately to mind.
 

Mystic_Enigma

Just bear with me!
Veteran
Joined
Mar 7, 2018
Messages
418
Reaction score
1,650
First Language
English
Primarily Uses
RMMV
-Nevermind, I just now noticed the title said WITHOUT a Wait command...-
 
Last edited:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,484
Reaction score
400
First Language
German
Primarily Uses
RMMV
Let your Timer turn a Switch to On.
Use that Switch as Condition for an Event with Trigger Autorun, execute the pushback
code and such inside this event, afterwards turn the Switch Off again.

The Player can't move with direction Buttons while an Event on Autorun is running.
Normaly it is used for Cutscenes but it should also work in this case.
 

TicklishWasabi

Veteran
Veteran
Joined
Nov 7, 2017
Messages
167
Reaction score
18
First Language
English
Primarily Uses
N/A
Let your Timer turn a Switch to On.
Use that Switch as Condition for an Event with Trigger Autorun, execute the pushback
code and such inside this event, afterwards turn the Switch Off again.

The Player can't move with direction Buttons while an Event on Autorun is running.
Normaly it is used for Cutscenes but it should also work in this case.
This almost works but runs into the problem that the move route still has to be set to "Skip if cannot move" which means the moment the player is pushed into an immovable tile it will skip to the end of the autorun event which has the off switch, which then means the player is free to move around while the pushback animation is still playing. I could set a wait timer in between the two, but there isn't a way to measure how soon they will hit a wall, which means if they hit a wall at the very end of the push, they would be waiting for a couple of seconds for no reason.

Good suggestion though, I appreciate the help. : )

You could line the pathway with events that you switch on to make impassable as the player is pushed back (or just a few that you switch on and move). There might be another way to actually disable player movement, but that comes immediately to mind.
The only problem I see with this is that since the tiles will act as impassable, I would have to find a way to have an even check if the player has hit a wall, and then make the tile they are standing on impassable, and only for as long as the animation plays. (which is the hard part) Otherwise, when the events switch on and the player is supposed to be pushed back, they would just get stuck in the impassable tile that got turned on.



EDIT: I was thinking about it, and even if I find a way to paralyze the player the amount of time they are paralyzed has to be dynamic. The only way around it would be to have a timer set to the number of frames the animation lasts, in another event, turned on with a switch. And then actually, if I could find a way to disable the movement keys until that timer runs out, it would simulate being pushed back too much to move.

And a way to make the event impassable method work would be to have an event behind that event, set to event touch, turn on a switch that would turn on the event in front of it, making it impassable. And a third event, set to a timer which turns on whenever the "gust" switch turns on. Which times out the animation length, and turns off the impassable switch, whether or not it was ever turned on. That way, the event will always be turned off at the exact end of the animation.

I'm going to test this right now.

Edit 2: It works, it took an absolute spiderweb of eventing but it all works perfectly as far as I can tell. I went into making this event thinking it was going to take 10 minutes tops, boy was I wrong.
 
Last edited:

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,436
Reaction score
4,490
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

One 3-day jam and a Game Awards... this month is moving... \o/
Maker-ing has been being the best thing that happened to me this year so far. it is so good to rescue some old skills fo creativity and the people I have met are really incredible. I love my coffelanders and tocudos buddies. Maybe one day I will reach other countries folks too. S2
Well... My game plays better at 1920x1080, so I guess that's the new resolution. Still runs at 60FPS. :LZSexcite: Also... I really want a boss to be able to build new maps around the player... Mostly because it's visually spectacular! I'm er... not quite sure yet how I can do that without making MV explode.... But I'll find a way, anything in service to the "sparkles"! :kaopride:
How to change your netbooks screen resolution

Forum statistics

Threads
100,791
Messages
979,592
Members
132,436
Latest member
jefigeb851
Top