Followers ON/OFF in Options Menu? (YEP Options Core)

Status
Not open for further replies.

Tressenia

Fairy Indie Game Dev
Member
Joined
Nov 23, 2019
Messages
10
Reaction score
10
First Language
English
Primarily Uses
RMMV
I downloaded Yanfly's Options Core today, and it works great! I noticed there's a way to add new options to the menu, but I can't figure it out. At a point in my game, you have four characters in the party and most of them are riding horses, so I know it could be annoying for the player to see their little "train" covering up half the map. Anyway, I was wondering if there's a way to put the "Change Player Followers" command in the Options Menu.
 

Ritter

Veteran
Veteran
Joined
Jan 17, 2017
Messages
64
Reaction score
30
First Language
English
Primarily Uses
RMMV
Assuming you don't manually turn the followers on in a separate event this should do the trick for you. I tested it in my game quickly for you and it worked no problem.

Open the plugin in your plugin manager. Double click on Options Categories, then double click on Visual, then double click on Options List, then scroll down if needed and double click on the empty bottom entry in the list to create a new option, from there you will want to copy paste the following code into the proper locations, overwrite the default code for the option. This will create a new option under the Visual tab in options menu. you can click and drag the newly created option higher in the list, wherever you'd like it to show in your games options.

Name: Show Followers on map?
Symbol: showFollowers

Draw Options Code:

var rect = this.itemRectForText(index);
var statusWidth = this.statusWidth();
var titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawOptionsName(index);
var value = this.getConfigValue(symbol);
if (value == false) {
$gamePlayer.hideFollowers();
$gamePlayer.refresh();
}
if (value == true) {
$gamePlayer.showFollowers();
$gamePlayer.refresh();
}
this.drawOptionsOnOff(index, "Yes", "No");


Process OK Code:

var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changeValue(symbol, !value);

Cursor Right Code:

var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changeValue(symbol, true);

Cursor Left Code:

var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changeValue(symbol, false);

Default Config Code:

ConfigManager[symbol] = true;


set the default to true if you want it to default to true or false if you want it to default to false lol.

i ran another test and found that if you set the value to false before you start a game it messes up and leaves it true if you have it set to true in your database, to avoid this you would likely need to throw a conditional branch in your games initial autorun sequence which checks for this.

if (ConfigManager.showFollowers == true) {
$gamePlayer.showFollowers();
$gamePlayer.refresh();
} else {
$gamePlayer.hideFollowers();
$gamePlayer.refresh();
}

In eventing form it would look like this:

◆If:Script:ConfigManager.showFollowers == true
◆Script:$gamePlayer.showFollowers();
: :$gamePlayer.refresh();

:Else
◆Script:$gamePlayer.hideFollowers();
: :$gamePlayer.refresh();

:End


on a final note this would also be the method you'd use if you wanted to hide/show followers throughout your game, you would want to check if ConfigManager.showFollowers == true before you show followers, this way if the player has it set to false you just don't show the followers, but if its set to true then you can show/hide the followers throughout your game as needed. :)
 
Last edited:

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
743
Reaction score
473
First Language
Polish
Primarily Uses
RMMV
Just link the common event to the custom menu option, and then use event panel to show/hide followers. You can adapt switch to check if their are on or off, to switch between.
 

Tressenia

Fairy Indie Game Dev
Member
Joined
Nov 23, 2019
Messages
10
Reaction score
10
First Language
English
Primarily Uses
RMMV
Thank you both so much! @Ritter I copied your script, and it works beautifully! :hhappy:
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,729
Reaction score
4,682
First Language
English
Primarily Uses
RMMZ

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 3)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top