ighrpg

Regular
Regular
Joined
Apr 8, 2021
Messages
70
Reaction score
11
First Language
English
Primarily Uses
RMMZ
Hello,

I was wondering if anyone knows how to reduce the follower count to just two or a certain member without changing the party size? Just changing what is seen on the map when walking around.
 

lordvalinar

Lord of the Damned
Regular
Joined
Mar 31, 2013
Messages
343
Reaction score
210
First Language
English
Primarily Uses
RMMZ
EDIT2: I have made a quick plugin that should do the trick. You can control the limit with a variable. Whenever you set the variable to anything > 0, the limit will kick in. Setting it back to 0 should revert it to normal settings (see attachment)

EDIT: I suppose you could also use a script call in-game:
JavaScript:
// this is to clear it
$gamePlayer._followers._data = [];
// this is to set 1 follower
$gamePlayer._followers._data[0] = new Game_Follower(1);
// sets a 2nd follower.. etc
$gamePlayer._followers._data[1] = new Game_Follower(2);


That is controlled in rmmz_objects.js - line 8755 (Game_Followers.prototype.setup). Make a plugin that overwrites this method (instead of modifying rmmz_objects.js itself).

Do something like this:

JavaScript:
// Original Method
Game_Followers.prototype.setup = function() {
    this._data = [];
    for (let i = 1; i < $gameParty.maxBattleMembers(); i++) {
        this._data.push(new Game_Follower(i));
    }
};

// Plugin Method
Game_Followers.prototype.setup = function() {
    this._data = [];
    this._data[0] = new Game_Follower(1);
};

If however, you want to ever change it, the plugin itself will need to be adjusted accordingly. If you do not know how to make plugins, I can whip this one up for you (with customizable settings)
 

Attachments

  • LvMZ_FollowerTrailLimit.js
    3.8 KB · Views: 14
Last edited:

ighrpg

Regular
Regular
Joined
Apr 8, 2021
Messages
70
Reaction score
11
First Language
English
Primarily Uses
RMMZ
EDIT2: I have made a quick plugin that should do the trick. You can control the limit with a variable. Whenever you set the variable to anything > 0, the limit will kick in. Setting it back to 0 should revert it to normal settings (see attachment)

EDIT: I suppose you could also use a script call in-game:
JavaScript:
// this is to clear it
$gamePlayer._followers._data = [];
// this is to set 1 follower
$gamePlayer._followers._data[0] = new Game_Follower(1);
// sets a 2nd follower.. etc
$gamePlayer._followers._data[1] = new Game_Follower(2);


That is controlled in rmmz_objects.js - line 8755 (Game_Followers.prototype.setup). Make a plugin that overwrites this method (instead of modifying rmmz_objects.js itself).

Do something like this:

JavaScript:
// Original Method
Game_Followers.prototype.setup = function() {
    this._data = [];
    for (let i = 1; i < $gameParty.maxBattleMembers(); i++) {
        this._data.push(new Game_Follower(i));
    }
};

// Plugin Method
Game_Followers.prototype.setup = function() {
    this._data = [];
    this._data[0] = new Game_Follower(1);
};

If however, you want to ever change it, the plugin itself will need to be adjusted accordingly. If you do not know how to make plugins, I can whip this one up for you (with customizable settings)
Thank you for that,
I have one issue with this. So when I use the scriptcommand : $gamePlayer._followers._data[1] = new Game_Follower(2); ( this allows me to have just the 2 on the map. )

It works, but when I leave the map and return the 3rd follower appears. then if I go into the main menu and then leave the menu the 3rd follower is gone again.

What could be causing that?
Maybe, a refresh scene is needed after the call?
 
Last edited:

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,153
Reaction score
16,960
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Requests. Thank you.

 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,113
Reaction score
9,047
First Language
English
Primarily Uses
RMMV
It seems to me the easiest thing to do would be to take this:
JavaScript:
Game_Followers.prototype.setup = function() {
    this._data = [];
    for (let i = 1; i < $gameParty.maxBattleMembers(); i++) {
        this._data.push(new Game_Follower(i));
    }
};
and change where it references maxBattleMembers.

If you want the same number of followers the entire game, replace that with one number higher. So to always have two followers after your main character, it would read
Code:
i < 3

You could also make it able to be changed during the game if you like. Make the line read:
Code:
    for (let i = 1; i < $gameVariables.value(X); i++) {
where X is the ID of a variable in your project. You could then use regular event commands to change the value of that variable and change how many followers are drawn (but after a map refresh).
 

ighrpg

Regular
Regular
Joined
Apr 8, 2021
Messages
70
Reaction score
11
First Language
English
Primarily Uses
RMMZ
It seems to me the easiest thing to do would be to take this:

and change where it references maxBattleMembers.

If you want the same number of followers the entire game, replace that with one number higher. So to always have two followers after your main character, it would read
Code:
i < 3

You could also make it able to be changed during the game if you like. Make the line read:
Code:
    for (let i = 1; i < $gameVariables.value(X); i++) {
where X is the ID of a variable in your project. You could then use regular event commands to change the value of that variable and change how many followers are drawn (but after a map refresh).
Thank you Both :) for your help on this. Great community!
The first Answer helped me understand how applying script code into a command. Didnt now that before :)

I also was able to achieve it with the second idea.
By changing the maxBattlersMembers to i < 2;

JavaScript:
Game_Followers.prototype.setup = function() {
    this._data = [];
    for (let i = 1; i < 2; i++) {
        this._data.push(new Game_Follower(i));
    }
};

As I do plan on having it set to just two Actors on the map through out the entire game this may serve the purpose.

Again Thank you!!
 
Last edited:

lordvalinar

Lord of the Damned
Regular
Joined
Mar 31, 2013
Messages
343
Reaction score
210
First Language
English
Primarily Uses
RMMZ
Thank you for that,
I have one issue with this. So when I use the scriptcommand : $gamePlayer._followers._data[1] = new Game_Follower(2); ( this allows me to have just the 2 on the map. )

It works, but when I leave the map and return the 3rd follower appears. then if I go into the main menu and then leave the menu the 3rd follower is gone again.

What could be causing that?
Maybe, a refresh scene is needed after the call?
Well problem with what you posted here though is that you added a 3rd actor. Every array starts with 0. So "this._data[0]" is the first follower (not the party leader). The "i" inside "Game_Follower(i)" is the member index (0 = party leader, 1 = 1st follower, 2 = 2nd follower, etc). So yes if you only ever plan on having 2 actors, you don't need a for-loop at all. Just this:

JavaScript:
// Method 1
Game_Followers.prototype.setup = function() {
    this._data = [];
    this._data[0] = new Game_Follower(1);
};

// Method 2
Game_Followers.prototype.setup = function() {
    this._data = [new Game_Follower(1)];
};
 

ighrpg

Regular
Regular
Joined
Apr 8, 2021
Messages
70
Reaction score
11
First Language
English
Primarily Uses
RMMZ
Well problem with what you posted here though is that you added a 3rd actor. Every array starts with 0. So "this._data[0]" is the first follower (not the party leader). The "i" inside "Game_Follower(i)" is the member index (0 = party leader, 1 = 1st follower, 2 = 2nd follower, etc). So yes if you only ever plan on having 2 actors, you don't need a for-loop at all. Just this:

JavaScript:
// Method 1
Game_Followers.prototype.setup = function() {
    this._data = [];
    this._data[0] = new Game_Follower(1);
};

// Method 2
Game_Followers.prototype.setup = function() {
    this._data = [new Game_Follower(1)];
};

Ah okay nice! I didnt realize that. Thank You.
 

Latest Threads

Latest Profile Posts

My game just got 35k downloads on Steam! Thank you everyone for helping me achieve this goal guys, I hope more people know more about Phil Alone!
I was wondering why Skyler's hair looked weird on their new sprite. Well I forgot adding their iconic hairband
Anyone up to give Holder, TRIDIUM, GenericFantasyDev and Black Mage the fight of their lives?
Go ahead.
"The internet made everyone way too comfortable with disrespecting each other and not getting punched in the face."
I woke up a touch early and was going to draw by the fireplace until it’s a more appropriate noise-making time, but I left my stylus AND my glasses (WHAT?!) upstairs and it’s just too cold to get out of the blanket now.

Forum statistics

Threads
134,872
Messages
1,251,439
Members
177,671
Latest member
Tweateur
Top