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
327
Reaction score
192
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: 6
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
44,718
Reaction score
15,847
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
4,145
Reaction score
2,529
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
327
Reaction score
192
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 Posts

Latest Profile Posts

I_got_lonely.jpg
So I was working with the save system (yes I'm going to at least use RM's save system, I'm not a total monster)... And I realized I was lonely so I brought along some friends to test stuff out. :LZSexcite:
1653529725808.png
>Wake up in the night
>Can't sleep
>Draw little freak
>Come up with pancake based puns for attacks
>Back to bed
UHHHHH. What is this and how did someone find my game on here? 1653527395160.png
ScreenShot_5_25_2022_7_37_13.png

my game has distinct areas where travel through what are known as "battle stations" these are more or less areas to explore and fight. occasionally, you'll stumble across secret rooms with sidequests ready to be taken. this area is in the high school attic of all places... but how do ya get there is the question.

Forum statistics

Threads
122,125
Messages
1,146,712
Members
160,411
Latest member
WillianAxe
Top