Show Animation in specific Follower?

Discussion in 'RGSS3 Script Requests' started by Christopher Riel, Jun 29, 2019.

Thread Status:
Not open for further replies.
    Tags:
  1. Christopher Riel

    Christopher Riel Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Hi, I've been practicing a bit more with the RPG Maker VX Ace script, but I have a problem with animation.
    I would like an animation to be shown on a specific Follower.
    I know there is a command to show an animation to the player that is as follows:

    Code:
    $game_player.animation_id = n
    but I would like to know if it is possible to show the animation with a similar command such as:

    Code:
    $game_party.members[id].animation_id = n
    Would it be possible to run the animation with the follower id?
     
    #1
  2. Heirukichi

    Heirukichi Veteran Veteran

    Messages:
    1,040
    Likes Received:
    381
    Location:
    Italy
    First Language:
    Italian
    Primarily Uses:
    RMVXA
    You cannot use ID, you have to use the relative position for that follower. You can do that using the following script call:
    Code:
    actor_id = X
    anime_id = Y
    pos = 0
    $game_party.members.each.with_index do |member, i|
      if member == $game_actors[actor_id]
        pos = i
        break
      end
    end
    if (pos <= $game_player.followers.length)
      character = (pos == 0 ? $game_player : $game_player.followers[pos - 1])
      character.animation_id = anime_id
    end
    
    Change X and Y accordingly. X is your actor id, Y is your animation id.

    Of course, things are much easier if you want to display the animation on the follower in a certain position rather than on a certain actor. In that case you can simply use:
    Code:
    $game_player.followers[X].animation_id = Y
     
    #2
  3. Christopher Riel

    Christopher Riel Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    Spanish
    Primarily Uses:
    RMVXA

    This is what I was looking for.
    I thought it was in party_members and not player_followers.
    really thank you very much! It has worked very well! :D
     
    #3
  4. slimmmeiske2

    slimmmeiske2 Little Red Riding Hood Moderator

    Messages:
    5,203
    Likes Received:
    3,935
    Location:
    Belgium
    First Language:
    Dutch
    Primarily Uses:
    RMXP

    This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

     
    #4
Thread Status:
Not open for further replies.

Share This Page