I'm using the yanfly visual battlers script with barretor's fixes (http://pastebin.com/EssQHqwd), and for the original (http://yanflychannel.wordpress.com/rmvxa/battle-scripts/visual-battlers/) which among other things makes it so when someone attacks, their sprite moves forward a bit before attacking, and then moves back after they are done. Is there an easy way to make it so that enemies don't do this without effecting player character behavior?
Yanfly Visual Battlers - preventing enemies from moving
RGSSx Script Supporttry putting this below your scripts
if it errors, try this one instead
Code:
def move_forward(distance = 24, frames = 6) return if self.enemy direction = forward_direction move_direction(direction, distance, frames) end #-------------------------------------------------------------------------- # move_backward #-------------------------------------------------------------------------- def move_backward(distance = 24, frames = 6) return if self.enemy direction = Direction.opposite(forward_direction) move_direction(direction, distance, frames) end
Code:
def move_forward(distance = 24, frames = 6) return if self.enemy? direction = forward_direction move_direction(direction, distance, frames) end #-------------------------------------------------------------------------- # move_backward #-------------------------------------------------------------------------- def move_backward(distance = 24, frames = 6) return if self.enemy? direction = Direction.opposite(forward_direction) move_direction(direction, distance, frames) end
Thanks! I had to put it in class Game_Battler < Game_BattlerBase, and the second one seems to work. The first one stops enemies but crashes when a player character tries to attack.
ah yes... I forgot to put them on Game_Battler... XD
Original thread: https://forums.rpgmakerweb.com/threads/yanfly-visual-battlers-preventing-enemies-from-moving.23470/