Follower Control Plugin by Tyruswoo

Discussion in 'JS Plugin Releases (RMMV)' started by Tyruswoo, Jan 19, 2016.

  1. Tyruswoo

    Tyruswoo Game Designer Veteran

    Messages:
    80
    Likes Received:
    59
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Follower Control
    Plugin by Tyruswoo
    For RPG Maker MV


    Download Link (DropBox):
    TYR_FollowerControl.js

    Be sure to keep the filename as shown above, in order for it to work.

    Save it in your project's js/plugins folder. Then, open your project and load the plugin with the Plugin Manager.

    How to Use:

    Follower Control allows you to use the following event commands on the party followers:
    • Set Move Route
    • Show Balloon Icon
    • Show Animation
    • Transfer Player
    This is great for cutscenes! In order to use the above on followers, you will need to target the follower using a plugin command. For example:
    • Plugin Command: Follower 1
    The above targets the first follower. This works on up to an infinite number of followers! To reset the target to the leader, use the following:
    • Plugin Command: Follower 0
    To indicate whether the followers chase the leader, you can use one of the following:
    • Plugin Command: Follower StopChase
    • Plugin Command: Follower Chase
    That's all there is to it!
    Tip: You can use Common Events (in the Database) to set up your favorite move route sequences for the followers and leader! Then use the "Common Event..." command in an event to call the same move route sequences from various places in your game! This way, you can have a collection of cutscene-style sequences that occur during certain events, such as entering or leaving a map, or talking with special NPCs as you prepare for cutscenes, or for sleeping at an inn, etc!
    • Note: Using Set Move Route to turn by degrees, you can have the same move route sequence be used when the player is facing various directions!
    • Note: You may consider using the Gather Followers event command to bring followers to one location, then use Set Move Route "Turn toward Player" for each follower to make them face the same direction as the party leader. Doing this allows you to have your followers in a predictable location and direction, from which you can then send them out into the desired move route sequence.
    Description:
    Follower Control allows you to control the movement of party followers using the Set Move Route command! Simply use the plugin command "Follower 1" or "Follower 2", etc., and then use Set Move Route on the player, and the desired follower will move instead of the leader! Use the plugin command "Follower 0" to make Set Move Route work as default, affecting the party leader.
    You can also use "Follower StopChase" so that leader movement no longer makes followers chase after the leader; this allows you to move the leader and followers around independently for making cool cutscenes! You can then use "Follower Chase" to make the followers chase the leader again.

    v 1.00: Added the following features:
    • Plugin command "Follower" to select a follower or re-select the leader.
    • Set Move Route effect on followers.
    • Plugin commands "Follower StopChase" and "Follower Chase" to determine whether followers chase the leader.
    v 1.01: Added the following options for followers:
    • Show Balloon Icon
    • Show Animation
    • Transfer Player
    v 1.02 and v 1.03: Corrected a bug that made "Follower 0" have to be called at least once in your game prior to "Set Move Route" working.

    v 1.04: Added a small but useful feature:
    • Now if a follower is on the same tile as the leader, and Set Move Route is used on the follower to make it "Turn toward Player", the follower will then turn to face the same direction as the leader.
    v 1.05: Added the following:
    • Now, when StopChase is on, and the leader's MoveRoute is caused to jump, the followers will not jump.
    Please let me know if you have any suggestions to improve the plugin!

    Your Adventuring Companion,
    Tyruswoo
     
    Last edited: Sep 4, 2018
    #1
    Meike, Milennin, Kenode and 13 others like this.
  2. ArkDG

    ArkDG Veteran Veteran

    Messages:
    143
    Likes Received:
    43
    First Language:
    portuguese
    Finally a really good follower control plugin! this works for balooms too?
    Thank you! ^^
     
    #2
    Tyruswoo likes this.
  3. McKathlin

    McKathlin Plugin dev, composer, artist Veteran

    Messages:
    49
    Likes Received:
    36
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    N/A
    Having a follower stand in for the player in Set Move Route is a really brilliant way to give them the full range of move route commands. Good thinking!  I've tried this out in my project, and I like how it's looking.
     
    #3
    Tyruswoo likes this.
  4. Tyruswoo

    Tyruswoo Game Designer Veteran

    Messages:
    80
    Likes Received:
    59
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV


    Hi ArkDG!


    I just added several more features:  You can now use these commands on your followers:

    • Set Move Route
    • Show Balloon Icon
    • Show Animation
    • Transfer Player

    Enjoy and share with your friends!


    ~Tyruswoo
     
    #4
    phamtruong1992 and ArkDG like this.
  5. signaltome

    signaltome Veteran Veteran

    Messages:
    37
    Likes Received:
    3
    Location:
    Norway
    First Language:
    English
    Man, I skipped over this for quite a while, it seemed way to complex for me back in the day (all of, what, three months ago? Whenever MV came out :) ) But I have had some events where the follower is supposed to do things and I have ha to mess with "remove from party" and creating an event with the followers image and argh! It has been a nightmare and never worked properly!


    And then I remembered THIS! And it is not complicated at all, once I got back into RPG maker again. So thank. Really. From the bottom of my heart. I see so much use out of this.


    Edit: Tested it out, worked like a charm! Makes my life so much easier. At least in RPG maker... :)
     
    Last edited by a moderator: Jan 26, 2016
    #5
    Tyruswoo likes this.
  6. Tyruswoo

    Tyruswoo Game Designer Veteran

    Messages:
    80
    Likes Received:
    59
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV


    Awesome!  I'm glad that it's working well for you!  Let me know if you have ideas for features that you'd like to see added in the future!
     
    #6
  7. signaltome

    signaltome Veteran Veteran

    Messages:
    37
    Likes Received:
    3
    Location:
    Norway
    First Language:
    English
    Any way of making them solid when StopChase? It is fine when I use it in cutscenes, but if I want to leave followers idling while exploring the room I keep walking through them... I know this is primarily for cutscenes and I can do that with events obviously so no worries. I am amazed you even did this! I don't doubt you skill, it is that it is possible at all. Which shows my ignorance I am sure.


    Random movement when not following and cutscened? Also, I can do that with events, just prodding the limit of the controls one have over the followers.
     
    Last edited by a moderator: Jan 29, 2016
    #7
  8. Tuomo L

    Tuomo L Oldbie Veteran

    Messages:
    2,195
    Likes Received:
    1,131
    Location:
    Finland!
    First Language:
    Finnish
    Primarily Uses:
    RMMV
    This is pretty gold. Is there a way to have the player turn towards a follower? For cutscene purposes, if the player turns and replies to a comment they made.
     
    #8
  9. signaltome

    signaltome Veteran Veteran

    Messages:
    37
    Likes Received:
    3
    Location:
    Norway
    First Language:
    English


    Sorry for barging in, but if I understood your question correctly, isn't that just a matter of shifting between Follower 1 and Follower 0 and a Player move route?


    Like, Plugin command:  Follower 1, Move player event Step left Turn- right, Show speech: "Hey boss, if..." | Plugin command: Follower 0, Move Player event Turn left, Show speech: "Yes, what is it my humble follower?"


    Auto event, step over event or whatever. :) Or I failed to grasp the question correctly and if so I am sorry. BD
     
    #9
  10. Tyruswoo

    Tyruswoo Game Designer Veteran

    Messages:
    80
    Likes Received:
    59
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV


    Hi signaltome,


    Having followers able to act like events is an intriguing idea!  However, events have so many capabilities that adding all those capabilities to followers would be difficult, and in the end would yield a result more difficult to use than events.  For this reason, it is recommended that once you have followers separated out into a room, you use one of the following event commands:

    • Change Party Member:  Remove the follower from the party if you want that follower to no longer appear in the party menu or battles.  If you want to add the actor again, use Change Party Member to add (and leave initialize box unchecked to keep stats).
    • Change Player Followers:  By using this and selecting Off, the followers' images will disappear from the map, but they will still appear in the party menu and in battles.  (Note that if you use Change Player Followers, you will probably also want to use Change Formation Access to remove the ability to change formation.)

    Events have so many advantages, so it is best to use one of the above commands to turn your followers into events as soon as possible, any time you want to interact with the followers.
     
    Last edited by a moderator: Jan 30, 2016
    #10
  11. signaltome

    signaltome Veteran Veteran

    Messages:
    37
    Likes Received:
    3
    Location:
    Norway
    First Language:
    English
    Yeah, that was what I did before your plugin, so I will continue to do so when the occasion calls for it. Though I did make the follower walk into and event that got triggered wit a walkover event, so that I could walk around the room and then go up and "pick up" my follower again, the event he was standing over being a action button event containing your FollowerChase command as well as to once again remove the event so that it was not there.


    Endless possibilities even with what you have given us. I still love this plugin. Though I keep kalling them mods, becuse that is what they really are, right? modifications to the base game. ;) Anyway, just seeing if some of that could be done. Thanks anyway!
     
    #11
    Tyruswoo likes this.
  12. Nev

    Nev Veteran Veteran

    Messages:
    33
    Likes Received:
    3
    First Language:
    English
    Hi, really useful plugin but I notice that when I stop the follower from chasing the player he still "jumps" when I command the player to jump in one of my cutscenes. Is this an oversight or am I doing something wrong? I'm using the Follower 0 plugin command.
     
    #12
  13. signaltome

    signaltome Veteran Veteran

    Messages:
    37
    Likes Received:
    3
    Location:
    Norway
    First Language:
    English


    I met with this a few times as well, but just fiddle with the plugin command a few times and it seems to sort it out. Also, remember to have no spaces before "Follower 0" in the line. Learned that from other plugins! BD
     
    #13
  14. Tyruswoo

    Tyruswoo Game Designer Veteran

    Messages:
    80
    Likes Received:
    59
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV



    Hi Nev,


    If you are still having this problem after checking it over again, let me know.  If so, be sure to include a detailed breakdown of the order of the event's commands and what happens to which character/follower/leader.  Also, you could consider making a short video in which you show your event's commands, then what happens when you playtest, as that would give me the best understanding of what is happening.


    Thank you!  I hope the plugin is proving useful!
     
    #14
  15. gilgamar

    gilgamar Veteran Veteran

    Messages:
    132
    Likes Received:
    53
    Location:
    Alberta, Canada
    First Language:
    English
    Very cool script.


    One thing I found is the script does not work for changing follower transparency or opacity. It seems bound to $gamePlayer. It would be really cool to independently control this setting without having to event each follower, not sure if that is possible or not though. It seems like it should be since each follower has an _opacity property and a setOpacity method. Perhaps it would be possible to clone the follower into a new event to temporarily apply more settings to it and then have it rejoin with $gamePlayer when finished.


    Update


    I wonder if we can extend this script with Hudell's Orange Custom Event to break off a follower as a custom event. I think I'll add a new plugin command to make this easy if it works.

     
    Last edited by a moderator: Mar 8, 2016
    #15
  16. Tyruswoo

    Tyruswoo Game Designer Veteran

    Messages:
    80
    Likes Received:
    59
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV


    Those are all great ideas!  I appreciate the feedback, and I'll look into adding transparency and opacity into the base plugin when I can!
     
    #16
  17. gilgamar

    gilgamar Veteran Veteran

    Messages:
    132
    Likes Received:
    53
    Location:
    Alberta, Canada
    First Language:
    English
    I looked into the Orange Custom Event and it was overly complicated way to go about it. I think the visibility issue might just be something as simple as a missing this._followers.refresh(); to update the sprite. I'll give it a try and see if it works.
     
    Last edited by a moderator: Mar 8, 2016
    #17
    Tyruswoo likes this.
  18. gilgamar

    gilgamar Veteran Veteran

    Messages:
    132
    Likes Received:
    53
    Location:
    Alberta, Canada
    First Language:
    English
    I think this is the culprit

    Code:
    
    Game_Follower.prototype.update = function() {
        Game_Character.prototype.update.call(this);
        this.setMoveSpeed($gamePlayer.realMoveSpeed());
        this.setOpacity($gamePlayer.opacity());
        this.setBlendMode($gamePlayer.blendMode());
        this.setWalkAnime($gamePlayer.hasWalkAnime());
        this.setStepAnime($gamePlayer.hasStepAnime());
        this.setDirectionFix($gamePlayer.isDirectionFixed());
        this.setTransparent($gamePlayer.isTransparent());
    };
     
    #18
    Tyruswoo likes this.
  19. gilgamar

    gilgamar Veteran Veteran

    Messages:
    132
    Likes Received:
    53
    Location:
    Alberta, Canada
    First Language:
    English
    Have not tested extensively but I think this does the trick and possibly fixes a few other issues as well. Whether or not it introduces new issues is yet to be discovered.

    //=============================================================================
    // Game_Follower
    //=============================================================================

    // Replacement method (Added by Gilgamar 2016.03.07)
    Game_Follower.prototype.update = function() {
    Game_Character.prototype.update.call(this);
    if (!$gamePlayer._followers._stopChase && !$gamePlayer._followers._stopCopy) {
    this.setMoveSpeed($gamePlayer.realMoveSpeed());
    this.setOpacity($gamePlayer.opacity());
    this.setBlendMode($gamePlayer.blendMode());
    this.setWalkAnime($gamePlayer.hasWalkAnime());
    this.setStepAnime($gamePlayer.hasStepAnime());
    this.setDirectionFix($gamePlayer.isDirectionFixed());
    this.setTransparent($gamePlayer.isTransparent());
    }
    };



    This will separate the follower and leader properties shown above if stopChase is set.


    It should fix independent move speed, blend modes, opacity, transparency, walk and stepping anime modes and also direction fix issues.


    Feel free to add this to your script. If you'd like to credit me you can do so in the script itself above the given function. Then you can also blame me if things go wrong =P


    Update


    Added new check for followers._stopCopy so that you can set opacity independently while still following leader. I used this to set the opacity of the followers one at a time while they pass behind a waterfall.
     
    Last edited by a moderator: Mar 8, 2016
    #19
    Tyruswoo likes this.
  20. gilgamar

    gilgamar Veteran Veteran

    Messages:
    132
    Likes Received:
    53
    Location:
    Alberta, Canada
    First Language:
    English
    I noticed there are more controls in Game_Character.prototype.update.call(this) having to do with jumping. I believe this is the issue @Nev was having. If I wrap that call inside the chase/copy check it should fix that issue also. I've wrapped it all up plus an alias for better compatibility.

    // Alias method (Added by Gilgamar 2016.03.07)
    Tyruswoo.FollowerControl.Game_Follower_update = Game_Follower.prototype.update;
    Game_Follower.prototype.update = function() {
    if (!$gamePlayer._followers._stopChase && !$gamePlayer._followers._stopCopy) {
    Tyruswoo.FollowerControl.Game_Follower_update.call(this);
    }
    };



    Update


    Welp, that was a bad idea wrapping up the  Game_Character.prototype.update.call(this). At least for stopCopy it is a bad idea since the followers wont update the walk animation and just snap to the player. It might work fine for stopChase. Need to dissect this function further.
     
    Last edited by a moderator: Mar 8, 2016
    #20
    Tyruswoo likes this.

Share This Page