ighrpg

Veteran
Veteran
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
Veteran
Joined
Mar 31, 2013
Messages
337
Reaction score
204
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: 12
Last edited:

ighrpg

Veteran
Veteran
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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,538
Reaction score
16,434
First Language
English
Primarily Uses
RMMV

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

 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
7,706
Reaction score
5,471
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

Veteran
Veteran
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
Veteran
Joined
Mar 31, 2013
Messages
337
Reaction score
204
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

Veteran
Veteran
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

Finally sat down and made a template of my world map in Inkarnate. Now to translate this to MV.
Oof. Literally got a "whose code is this, 'cause it sucks" in one of my projects.
Lunesis has started a trend of doing homages to me by putting a trilobite fossil in your game somewhere and I have to say I love this and encourage everyone who wants to credit me to do it too. XD
Made a plugin that allows you to randomly transmute items into other items weeeeeeee
Rebuilding isn't going terribly so far. I caught some things that I was definitely overcomplicating in the original project. Here's to hoping the plugins play nice when testing starts.

Forum statistics

Threads
129,943
Messages
1,206,471
Members
171,148
Latest member
Pptgames
Top