Event Followers

eventFollowers1

This script allows events to designate a “leader” that another character will
follow. This could be the player, the current event, or any other event.

Any characters following a leader will follow that leader until they are told to stop following.

 

Download

Script: download here

Installation

Place this below Materials and above Main

Usage

The following method call is defined in Game_Character.

follow(event_id)
stop_follow

This can be called by any character object such as players or events.
In a move route, if you make a script call and just say

follow(event_id)

Then the event specified by the move route will follow that character.
You can also say things like

$game_player.follow(event_id)
$game_map.events[3].follow(event_id)

eventFollowers2

If the event_id is -1, then the character will follow the player.
otherwise, it will follow the specified event on the current map.

To stop following a character, use the script call

stop_follow

Again, remember from whose perspective the script is being called from.

You may also like...

68 Responses

  1. Astralia says:

    Sorry,I’m kinda new when it comes to scripts so I don’t know how to make an event follow the player. Can someone help me out?

  2. Jacob Dodson says:

    Hi, sorry this is years since you’ve created this script but I’m using your script in my school project as a way to transition my cutscene into gameplay seamlessly, where my characters go from talking to in a party, but using your “follow(-1)” for them to follow me, they all teleport in front of my player? is there any way for them to stay behind me? just as it is odd watching them all teleport and stack in front of eachother

  3. Guardinthena says:

    I love the possibilities presented in this script. When I tested it out, I tried to get around the problem that an event follower does not carry over to another map. I had limited success. Using a common event, I was able to have the game check it the ‘event follower’ was in the party and for it to trigger the new event on the new map to appear and follow the player. All of that worked beauitfully. Where I ran into problems is where the new event follower/party member traveled up and away from the player character for every step taken. Not sure what I did, how to fix this or if that was the inherit tracking problem of this script. Has any one else encountered this? Is there a way to fix it? I was trying to create an interactable group with this.

  4. lino1000 says:

    Im a bit lost. sorry for the noob question but how exactly do I install this plugin? i tried putting it in the plugins folder, JS folder and my project folder but it doesnt seem to work at all

  5. Philip Lavaspear says:

    Hey can you help me? In the game, when it is the “follow” queue, the alert “Reference Error follow is not defined”. Is it because I am using it on MV? If it is, is there a script for MV? Thank you so much!

  6. Dungeonmind says:

    Is there any possible way we can have it so the events do follow the player to other maps? I really really need this to work this way and I’m counting on this script for a party system in my game where you can talk to party members interactively.

    • Hime says:

      This script does not provide support for moving events from map to map. If there was a script that provided such functionality I could write a plugin. The main issue with such events is that it becomes a bit more complicated for eventing since the ID’s are no long known beforehand.

  7. Lordlink13 says:

    Hey, I’m having this issue when it is first calling the script to work. The popup is this:
    https://www.dropbox.com/s/ckfqq2ehr7z9djq/EventFollowersIssue.jpg?dl=0

    I’ve put the follow script command in the move route of the events I want to follow the player. I’ve copied the script in just as is, no modifications.

    • Hime says:

      It looks like you have a script that adds something called “Fake Followers” that seems to be causing compatibility issues.

  8. Anoushka says:

    I keep getting an error saying:
    Script ” line 98: NoMethodError occurred.
    undefined method ‘move’ for nikNilClass

    Something like that…

  9. Rumanshi says:

    ‘Scuse me, I’m getting a strange error:

    Script ‘Game_Interpreter’ line 14411: NoMethodError occurred.

    undefined method ‘follow’ for #

  10. Yin says:

    Hi again Tsukihime. Is there a way to have this code make the event follower follow diagonally like the normal followers?

  11. Fuffydud says:

    Whenever I load a save file that’s on a map with my event follower, the event flies away diagonally instead of following the player.

    • Hime says:

      Can you reproduce that in a new project and then send it to me?

      I have an event follower the player, and then I save the game. Then I load the game, and the event is still following the player.

  12. Fuffydud says:

    After adding the script (in the correct location, of course) whenever I launch my game I get this error:

    Script ‘Event Followers’ line 96: NoMethodError occurred.

    undefined method ‘move’ for nil:NilClass

    This is line 96, but I lack the skill to diagnose the issue:

    @event_followers.move if passable?(@x, @y, d)

    I have the entire script and haven’t modified it in any way. I’ll try linking an image in case it helps:

    http://i.imgur.com/RUDB8Qj.png

  13. Magi says:

    Hi, I installed it between Materials and Main Process, but whenever I try to start playing it just says

    “Script ” line 2: SyntaxError occurred.

    unexpected ‘=’
    = end”

    What am I missing?

    • Hime says:

      The first line of the script should be =begin. If it’s not there you have missed a bunch of lines or you have deleted the header.

  14. Spearnear says:

    Is there a way to disable the "Through" setting in this script without having to create an entirely new parallel process to get around it? I want to be able to have an NPC follow the PC around and also have them to be able to be "talked to" with the action button (similar to an RPG like Rune Factory).

    I see the run speed settings have been fixed since last year though, awesome! 🙂

    (Sorry if this posted twice. if this doesn't show again, I'm assuming there is a pre-approval setting for comments to post.)

  15. Spearnear says:

    Is there a way to disable the "Through" setting in this script without having to create an entirely new parallel process to get around it? I want to be able to have an NPC follow the PC around and also have them to be able to be "talked to" with the action button (similar to an RPG like Rune Factory).

  16. Nesokas says:

    Hello,
    I have a problem with this script and I don't know why.
    If the player is in the map when the game starts, the event has no problem following it, however if I change map with an event and create a new event to follow the player on the new map, the follow behavior just continuous going up diagonally no matter the direction the player is moving.
    Does anyone know why this might happen?

    • Hime says:

      Does this occur in a new project with only event followers?

      • Nesokas says:

        Sorry, I kind give up hope on this one, but this is really what :s
        It works in a new project, however I comment all the other scripts and the problem is still there on my game.

        • Hime says:

          Consider adding each script one by one to the new project. It's possible that you might have events set up that may also conflict with it (which would be strange but possible I guess)

          • Anonymous says:

            Ok this stops happening if i remove the event from the previous map. When I remove the event that follows from the map and transferred the player to the next map with the new event that follows, the behavior stops happening. Maybe that helps figuring out what the problem might be…

          • Anonymous says:

            If I remove the event from the initial map the second one on the other map works perfectly… Maybe that can give you a clue on what the problem might be.

  17. Max says:

    Ummmmm…. I know this is late but I just started learning how to make games, I'm still pretty new to this stuff, what does this mean?

    Script " line 84: NameError occurred.
    uninitialized constant Object::Game_CharacterBase

    I'm lost.

  18. tsubasani says:

    really nice script, and found a bug, in the function move_behind_leader, the y's(y+=1, y-=1) are in reverse,
    it should be:
    def move_behind_leader
    x = @leader.x
    y = @leader.y

    case @leader.direction
    when 2
    y -= 1
    when 4
    x += 1
    when 6
    x -= 1
    when 8
    y += 1
    end
    x = [[1, x].max, $game_map.width-1].min
    y = [[1, y].max, $game_map.height-1].min
    moveto(x, y)

    end

  19. Campo says:

    I’ve incountered an error, that i’ve solved, and another that i can’t solve. The first error is that in line 94 is defined a “event_followers.move” instead of “event_followers_move”. The second problem is: this script is ok with rpg maker ace? I cant use on it

  20. Lick says:

    The script won’t seem to work- It says something like “undefined method ‘move’ for nil:NilClass ( http://i.imgur.com/OpGj4Fb.jpg )
    I have no idea what this means- My deadline is in a couple of days so I probably won’t have time to wait- I’ll just do something else here. Thought I’d let you know though..

  21. X says:

    Wow, if I knew about this script earlier! XD Great job.

  22. Tsukihime says:

    Script updated to correct all follower behavior when following another character.

  23. Tsukihime says:

    Script has been updated to correctly match event follower speeds with the leader’s speed under any circumstances.

  24. Spearnear says:

    The event doesn’t seem to match speeds with the player when it runs. Do I have to set something manually to make it work? I set a custom move route to an event with only the script follow(-1) added, and the event just keeps walking even when I push A (shift) to run.

  25. Oriceles says:

    Will they follow the player to other maps too?

Leave a Reply

Your email address will not be published. Required fields are marked *