Walking animation when Hitting a Wall

Discussion in 'RGSS3 Script Requests' started by narabuster, Dec 10, 2015.

Thread Status:
Not open for further replies.
  1. narabuster

    narabuster Villager Member

    Messages:
    9
    Likes Received:
    0
    First Language:
    English
    I'm here to ask for a script that allows for the player to continue their walking animation when hitting or bumping into a wall (or any impassable object for that matter). By default, the engine stops the PC walking animation when he/she bumps into a wall. I want the PC to continue to walk in place in the face of an impassable object instead of stopping their animation.

    Essentially, I want to player to have the idle animation only when I don't give any directional input. Otherwise, even when the player hits the wall, it shouldn't be idle.

    I know this kind of topic has been brought up before, but it has been 6 months dead and remained unsolved. I'm not sure if this is easy to script for or not, but I'm pretty sure this is entirely possible. The only other thing I can think of is that this will aid in the creation of Pokemon games for the RPG Maker, since in that game, walking animations continue even when hitting a wall.

    Thanks in advance! :)
     
    #1
  2. MeowFace

    MeowFace Meow Veteran

    Messages:
    1,034
    Likes Received:
    179
    Location:
    La La Land
    First Language:
    Meowish
    Not sure what you mean there, by default the actor shouldn't be animating if he/she isn't on the move.

    To make your actors start out in animation, you have to make a parallel/auto event at the start of the game, then set the player's moveroute with step anime = on. This way your actor should be always be animated.

    edit:

    or if you don't want to do it using eventing.

    you can go over to game_characterbase in your script editor,

    around line 57 you should find

    @step_anime = falsechange false to true there and your actors should start with animation.
     
    Last edited by a moderator: Dec 10, 2015
    #2
  3. narabuster

    narabuster Villager Member

    Messages:
    9
    Likes Received:
    0
    First Language:
    English
    MeowFace, this helps out a lot (thanks :)  ), but there is one problem. My character does the step animation even when he's not being moved. 

    So when I don't press any of the arrow/movement keys, he's walking in place. Is there a way to make him stop the step animation when the player is not moving him?

    Essentially, when I move the character to hit a wall, he stops his stepping animation even though I am pressing the movement key to the direction against the wall. I wanted him to continue doing the stepping animation, but apparently when a PC is against a wall, it won't do that.

    Your help fixed this problem, but now my character is doing the stepping animation even when he's idle. 

    Sorry if I wasn't clear on this before  :| .
     
    #3
  4. MeowFace

    MeowFace Meow Veteran

    Messages:
    1,034
    Likes Received:
    179
    Location:
    La La Land
    First Language:
    Meowish
    That's what the step animation do, just like what you can normally do with events.

    But if you want a step animation that can be turned on/off based on conditions. It will require some work, but still, not one that require a script.

    The script call $game_player.moving? is normally used when it comes to checking if the player is moving or not, but in your case, bumping into wall = not moving. So it will not work here. $game_player.stopping? isn't going to work too.

    So what's left is to constantly check for button pressed using a common event.

    Set up a parallel common event that runs at the start of the game, and have it check if the up down left right button is pressed.

    if pressed, turn on step animation. if not, turn off.

    If you must use a script to do this:

    Paste this in your scrip editor below Material and above Main

    Code:
    #==============================================================================# ■ Meow Face Wall Bump Step Anime#------------------------------------------------------------------------------# Continue Step Anime when bumping into wall#==============================================================================# How to Use:# [1] Paste This script Below Material and Above Main#==============================================================================class Game_Player < Game_Character  alias meowface_gp_wall_walk_update update  def update    meowface_gp_wall_walk_update    if Input.dir4 >0      @step_anime = true    else      @step_anime = false    end  endend
     
    #4
    narabuster likes this.
  5. narabuster

    narabuster Villager Member

    Messages:
    9
    Likes Received:
    0
    First Language:
    English
    Thanks MeowFace! Your script does just the trick.  :D

    I also tried to make the parallel process common event like you said, but somehow, I ended up with my character not being able to move at all no matter which direction I inputted. In the end, I decided to use your script. From looking at it, it seems it does just the same thing as my common event, but it actually works this time.

    Case closed.
     
    #5
Thread Status:
Not open for further replies.

Share This Page