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
188
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,736
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,178
Reaction score
1,876
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
188
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

SF_People3_3 added!
index.php

ScreenShot_1_3_2022_1_32_12.png
I feel QSprite for MV is underrated. I basically am able to use my chibi sideview battlers I drew on the maps and have all the motions available. this'll help a lot with cutscenes.
I've figured out how to reasonably tall-ify chibi sprites on my editor. I like that making tall sprites gives me control on expressing how tall characters seem on the field relative to each other as well as better differentiate adult sprites from child sprites.
doing some wacky experimental stuff in MV right now :kaoluv: I cannot wait to drop what I've been working on
Doing RPG Maker News for this week. (January 14th - 20th, 2022)

Forum statistics

Threads
118,556
Messages
1,116,932
Members
155,594
Latest member
000dsdsc
Top