In RPG maker VX Ace I would use Conditional Branch: Script: $game_player.moving? to check if the player was moving or not.
When I attempt to use this on MV i keep getting this error.
Does anyone know the correct way to write this script condition on MV?
Syntax Error, Unexpected end of input
● ARCHIVED · READ-ONLY
-
-
There are a few differences in JavaScript compared to ruby. One of them is that question marks are no long valid parts of function names. It's interpreting that as an inline if statement. Also, $game_player has been changed to $gamePlayer, as the standard naming convention in JS is different than in ruby.
All that aside, the answer that you seek is:
$gamePlayer.isMoving()Yes, you need those two empty parenthesis! That's another difference in javascript. In Ruby, adding them was optional. In JavaScript, not having them may not explicitly crash the game, but it will not work as you expect it to. -
$gamePlayer.isMoving() === true
got ninja'd :< -
That worked perfectly. Thank you very much.There are a few differences in JavaScript compared to ruby. One of them is that question marks are no long valid parts of function names. It's interpreting that as an inline if statement. Also, $game_player has been changed to $gamePlayer, as the standard naming convention in JS is different than in ruby.
All that aside, the answer that you seek is:
$gamePlayer.isMoving()Yes, you need those two empty parenthesis! That's another difference in javascript. In Ruby, adding them was optional. In JavaScript, not having them may not explicitly crash the game, but it will not work as you expect it to.