Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Test if player stuck ?

Thomas Cyrix

Villager
Xy$
0.00
Hey :)

I would like to get a one-liner script for conditional branches, that return TRUE if the player is currently stuck.
I suppose everything for that is already present in the RPGMaker engine, an alternative should be some "move" feature returning True (Success) or False (Failure).

Thanks for any help you could provide :)
 

Dad3353

Praised Adventurer
@Thomas Cyrix ...

No one-liner that can think of that will check in all directions, but, for each direction, make the Player move, then check with '$gamePlayer.isMovementSucceeded() ' to see if the move succeeded. Repeat for the 4 directions. If there are 4 'false' returns, then the Player can't move.
It's possible, of course, to concatenate all the directions into one line of Script, separating each with a ';', but it will be a long line..!
Does this help at all..?
 

Thomas Cyrix

Villager
Xy$
0.00
...But it does not seem to work right after a $gameplayer.moveforward() :(
Do I need to add some "update" instructions in-between ?
 

Thomas Cyrix

Villager
Xy$
0.00
Mmmhh... I had the bug but I edited the code earlier and cannot reproduce it... Forget about it ^^ Thanks !
 
Top