Custom Party Leader

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

In RPG Maker, you have something called “actors” which are the characters that the player controls.

All actors are grouped into a “unit” called a “party”. Actors can be added or removed from parties at anytime during the game. You can potentially have multiple parties in your game, depending on how your project is set up.

Each party has a leader. The leader is the actor that will be displayed while you’re traveling on the map. By default, the leader is the actor that is in the first position of the party. So for example if you switched the positions of the first and second members of the party, the leader will change.

customPartyleader2

Similar to actors, enemies are also grouped into their own unit called a “troop”. Enemy troops by default do not have a leader.

Now, what happens if you wanted the party leader to be someone other than the first person in the party? Maybe you want the leader to be a specific actor, but that actor doesn’t participate in battle.

Or perhaps you wanted enemy troops to have a leader, and make it so that when the leader dies, the enemies will scatter and run away?

With this plugin, you can set up who will be the leaders of parties and troops, and build additional plugins on top of it that allow you to use these leaders to implement new game mechanics.

customPartyleader3

Download

Plugin: download here (right-click, save as)

Installation

Download ths plugin and place it in the “plugins” folder in your project’s “js” folder. Then open your Plugin Manager (F10), double-click an empty row, and select the HIME_CustomPartyLeader plugin.

Once it is in your list of plugins, turn the plugin on.

Usage

Default Leaders

When your party is first set up when you start a new game, it assumes the leader is the actor in the first position of the party.

Similarly, when the enemy troop is set up, the first enemy will be selected as the leader.

It is intended that you will change the leaders through events during the game.

Checking Who is the Leader

You can ask who is the leader in script calls like this:

$gameParty.leader()
$gameTroop.leader()

It is possible that a unit does not have a leader. It will return `null` in that case.

Changing Party Leaders

customPartyleader3

You can change leaders during the game. To change the party leader, use the following plugin command

change_party_leader to actor ID

Where ID is the Id of the actor you wish to set as the leader. For example, if you wanted to choose actor 4 to be the leader, you can write

change_party_leader to actor 4

The actor does not need to be in the party.

Changing Enemy Troop leaders

customPartyleader4

Similarly, you can change enemy troop leaders as well. Use the following plugin command

change_troop_leader to enemy MEMBER_ID

Where the MEMBER_ID is the position of a particular enemy in the current troop. This is based on the order that they were added into the troop. If you look at the image above, you’ll see that the second slime is on the right, whereas the third slime is in the middle. This is because I added the blue slime before the gold slime.

For example, to set the third enemy as the leader, you would write

change_troop_leader to enemy 3

Working with Custom Units

If you have other units aside from parties and troops that is added through other plugins, you would need to use script calls to set the leaders.

UNIT_OBJECT.setLeader(battlerObject)

All units must inherit from Game_Unit, and the leader must inherit from Game_BattlerBase.

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

19 Responses

  1. Styx says:

    i think, i found a bug. If try to change the actor picture, mabye for a swimm animation, the change will not happend, if i have saved the game anytime before.

    It works, if i start a new game and change picture. But if you save and load the game, then the change is broke. If i turn the script off and load the savegame then it works

  2. Anonymous says:

    hi,
    i use the battleengine and party system and row formation script from http://yanfly.moe/yep/ and i want to try your script to block the leader in my party as e.g. Trainer like in pokemon but i want that they still stay in the battle (row formation at the least row e.g. 3 or 4) what have i to do? i dont understand what i have to replace with wich… sry for my bad english

    • Hime says:

      This plugin is designed to replace the leader of the party with a different graphic, effectively assuming all party members are followers (and the first follower is just a regular follower).

      I don’t know if it can help with what you want to do.

  3. Sundricat says:

    Is there a way to clear the custom party leader to restore the party leader to the first member of the party?

  4. Shiny Mike says:

    So I’m probably missing something here, I need to set a temporary leader for the party which is easy enough however when I want it to return to the default I can’t seem to work out how. Have I missed something or will I have to start using event logic to work out who is the default leader?

    • Hime says:

      For some reason this feature was not implemented. Let me take a look at the plugin.

      • Shiny Mike says:

        Thanks, I managed to get a quick and dirty workaround, but using your script would be a lot cleaner if that was available (for now I end up with all the actors showing as 1 image while I need it to show a specific character then telling it to go back again afterwards, which, while great for testing…)

  5. Laughin-Prince says:

    Another thing. If you have no Actors in the party you can’t do crap. I want the leader to not be used as a battler but I want them to use items too.

    • Hime says:

      I will look at a potential solution for this problem. Currently, it is assumed that your first 4 members are part of the battle group, and all of the followers are based on that as well. Changes would need to be made if you were to assume that the first person is not actual a battle member.

  6. Laughin-Prince says:

    How can I make the Leader not participate in battles?

  7. Anonymous says:

    All this seems to do is change the graphic of the person at the front of the party. Is there a way to make it so the party on the map is the special leader followed by characters number 1, 2, and 3 and then in the party we just see 1 2 and 3? Because right now we see the special leader, then 2 3 and in the menu we see 1 2 and 3.

    • Hime says:

      Well, yes, the purpose is to change the graphic of the party leader, effectively separating it from the first person in the party.
      But having the first person as a follower sounds reasonable. Let me look at some solutions.

  8. Nosidag says:

    Awesome script, do you by any chance though have a script that locks the leader in to where he can NOT be removed from the party? Like in Final Fantasy?

    • Hime says:

      Are you using a plugin that allows actors to add/remove party members? By default the only way to do this would be through events.

      • Anonymous says:

        I don’t plan to use Yanfly’s party plugin since I’m using one Alt Menu Screen 2 with all seven characters on display and it looks so nice imo. I second Nosidag’s request.

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax