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
324
Reaction score
189
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: 5
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,647
Reaction score
15,738
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
3,207
Reaction score
1,897
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
324
Reaction score
189
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

yRMekcF.gif


Run, <null> run!
(sprite got butchered a bit while making gif file...)
WOOP WOOP!
NEW CHARACTER ALERT!!!
Please, welcome to the stage...
Ramona Albright.png

Ramona Albright! A 20-year old World Key Guardian in training (More about the WKG's soon!), She is very impulsive, which leads us to the problem of the game. OOF. Kinda wanna wait till you know how to use the friggin World Key, huh?!
Bust sketch here!
IMG_20220124_110105.jpg
Little-by-little, keep improving your projects. That's how you finish them! ;)
Now it's official: My first RPG Maker game released on Steam will be released this year! I am so glad for this achievement and I am so happy to see a lot of gamedevs like me here working on what we love!
Mais informações no Post.png

Forum statistics

Threads
118,668
Messages
1,117,735
Members
155,778
Latest member
Zack01
Top