blurymind

Veteran
Veteran
Joined
May 5, 2016
Messages
62
Reaction score
17
Primarily Uses
In a conditional branch, what do we write in the script box to check if the player is moving or idle? 


Is there a help file on scripting where I can read more about conditions I can use via scripting?


Thank you in advance
 
Last edited by a moderator:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,789
Reaction score
15,919
First Language
English
Primarily Uses
RMMV
$gamePlayer.isMoving() returns true or false


No help file on RM scripting - just got to look through the .js files themselves.  rpg_objects.js is the one that I find most useful for script calls in the Script, Conditional Branch, Change Variable, etc commands.
 

blurymind

Veteran
Veteran
Joined
May 5, 2016
Messages
62
Reaction score
17
Primarily Uses
How do you check if the state in the script is false?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,789
Reaction score
15,919
First Language
English
Primarily Uses
RMMV
Conditional Branch: Script: $gamePlayer.isMoving()


... this gets executed if it's true (player is moving)


Else


... this gets executed if it's false (player is not moving)


Branch End


Or if you only want to do something if the player is idle, and don't want to do anything if they're moving, 


Conditional Branch: Script: !$gamePlayer.isMoving()


... this gets executed if the player is not moving


Branch End


(no Else branch required)
 
Last edited by a moderator:

blurymind

Veteran
Veteran
Joined
May 5, 2016
Messages
62
Reaction score
17
Primarily Uses
Ok lets say I want to set a paralel process common event where a picture is shown while the player is moving and another is shown when the player is idle.


Using that script as a condition in a conditional branch results in the walking picture flashing to the idle picture  as the player is moving. What I get out of this is that the  gamePlayer.isMoving()  is not constantly true while you move the player, but rather is switches on and off constantly for some reason.


How do I get a condition that doesnt do that and stays true while the player is moving?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,789
Reaction score
15,919
First Language
English
Primarily Uses
RMMV
Yeah, I think the player is moving as they go from one tile to the next, and then they pause waiting for the next input.


You might want to add a delay or something after the conditional branch - a Wait 5 Frames or something.  It'll reduce the flickering, but it won't eliminate it altogether.


Other things you can look at are $gameTemp.isDestinationValid() which will return true if the mouse button has been clicked for pathfinding, or Input.dir4 (which will be 0 if no keys have been pressed).  I will let you spend some time trying to figure out how to combine them.
 
Joined
Dec 25, 2013
Messages
2
Reaction score
5
First Language
English
If you use $gameTemp.isDestinationValid() in place of gamePlayer.isMoving() it works perfectly. I know this is a dead thread just wanted to solve the issue for anyone else looking for this like I was. If you take a conditional searching for $gameTemp.isDestinationValid() and place a conditional for gamePlayer.isDashing() inside of it, you can toggle dashing charsets without needing a plugin. You just have to put an event in Else for $gameTemp.isDestinationValid() that resets your sprites to walking. Hope this helps someone poking around for this like I was.
 

Latest Threads

Latest Posts

Latest Profile Posts

Voice.gif
The Voice... They usually show up to talk to you about leaving your mark on the world, which is one of the major themes of my game... How will you be remembered by society.
The only time my brother shows me any kind of support is by liking or LOL my Facebook Comments.
I finally finished the Coliseum for my game. Love how it looks. Credits for the assets goes to Kokoro Reflections, @Starbird_Resources, and @megumi014.
Colossuem.png
Mimics! Mimics everywhere!

Forum statistics

Threads
124,514
Messages
1,164,174
Members
163,352
Latest member
Spidy
Top