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
62
Reaction score
28
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
708
Reaction score
439
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,607
Reaction score
4,615
First Language
English
Primarily Uses
RMMV

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: 1)

Latest Threads

Latest Profile Posts

I worked a lot more today and I am thinking about Youtube videos to make to my channel, but I am still looking for some content :D

But I am happy to be back at work :D
Update... no scam calls all day. I think they learned their lesson. And I'm working on a fake anti-piracy video, featuring a fan game I'm making in MV. If I had the permission to make the game a licensed game that I could sell (rather than having it totally free like fan games are required to be), I'd use a really cool anti-piracy screen...
People2_1 added! ( with alternative hairstyle )

Hey there fellow makers!

just looking for an excuse to post this, really... :kaoslp:

Forum statistics

Threads
104,356
Messages
1,005,796
Members
135,868
Latest member
LuxRae
Top