RMMV [Solved] Help with adding a specific type of yanfly option

Status
Not open for further replies.

DRG

Orange juice lover, Sunny D Hater.
Veteran
Joined
Apr 23, 2018
Messages
110
Reaction score
45
First Language
english
Primarily Uses
RMMV
Hello!
So I'm trying to make an option using YEP option core, where the option,
instead of using a gauge option
1618804390261.png
or an Enabled/Disabled type option,
1618804381308.png
I wanted to make an option, that used multiple possible choices, for example,
Difficulty: Easy Medium Hard
Another example of what I mean can be seen in this screenshot.
1618804398683.png

I tried using Yep's battle animation speed plugin to try and make this, since I knew it had this type of option, and with some modification it almost worked, but the problem was that the plugin provided the default config, save config, and load config code. and so I had to attempt to find out what I would need to put there myself. The problem though is that I couldn't find any answers by inspecting the Battle Animation speed plugin's code, and I couldn't get it working by using modified code from other options. So after trying my best I'm asking here if anyone knows how to make the option I'm trying to make, or how to at least, modify my current code to work properly.

If you're wondering, here is the code I currently have
Code:
Name:
Difficulty Test

Help Description:
Test

Symbol:
DifficultyTest

Show/Hide:
show = true;

Enable:
enabled = true;

Ext:
ext = 0;

Draw Option code:
var rect = this.itemRectForText(index);
var statusWidth = this.statusWidth();
var quarterWidth = statusWidth / 4;
var titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawOptionsName(index);
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changePaintOpacity(value === 3);
var text = ("Test3");
this.drawText(text, titleWidth + quarterWidth * 1, rect.y, quarterWidth, 'center');
this.changePaintOpacity(value === 2);
var text = ("Test2");
this.drawText(text, titleWidth + quarterWidth * 2, rect.y, quarterWidth, 'center');
this.changePaintOpacity(value === 1);
var text = ("Test1");
this.drawText(text, titleWidth + quarterWidth * 3, rect.y, quarterWidth, 'center');

Process Ok Code
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value -= 1;
if (value <= 0) value = 3;
value = value.clamp(1, 3);
this.changeValue(symbol, value);

Process Right Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value -= 1;
value = value.clamp(1, 3);
this.changeValue(symbol, value);

Process Left Code:
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
value += 1;
value = value.clamp(1, 3);
this.changeValue(symbol, value);

Default config Code:
ConfigManager[symbol] = value(2);

Save Config Code
config[symbol] = ConfigManager[symbol];

Load Config Code
ConfigManager[symbol] = !!config[symbol];

If anyone can help me get this working properly it would be greatly appreciated!
Thank you for your time!
 

DRG

Orange juice lover, Sunny D Hater.
Veteran
Joined
Apr 23, 2018
Messages
110
Reaction score
45
First Language
english
Primarily Uses
RMMV

DRG

Orange juice lover, Sunny D Hater.
Veteran
Joined
Apr 23, 2018
Messages
110
Reaction score
45
First Language
english
Primarily Uses
RMMV

DRG

Orange juice lover, Sunny D Hater.
Veteran
Joined
Apr 23, 2018
Messages
110
Reaction score
45
First Language
english
Primarily Uses
RMMV

DRG

Orange juice lover, Sunny D Hater.
Veteran
Joined
Apr 23, 2018
Messages
110
Reaction score
45
First Language
english
Primarily Uses
RMMV

Jrrkein

Insert Witty Title Here
Veteran
Joined
Apr 20, 2014
Messages
264
Reaction score
111
First Language
Indonesian
Primarily Uses
RMMZ
No one going to help you if you're being impaitent and just bump
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,426
Reaction score
2,520
First Language
English
Primarily Uses
RMMZ
What does the code you have currently do, and how is it differing from what you want it to?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,149
Reaction score
625
First Language
English
Primarily Uses
RMMV
No one going to help you if you're being impaitent and just bump
He's waiting the required number of days between his bumps, so how is that being impatient? If you don't have the knowledge to help him (or to tell him it can't be done), why bother replying?
 

DRG

Orange juice lover, Sunny D Hater.
Veteran
Joined
Apr 23, 2018
Messages
110
Reaction score
45
First Language
english
Primarily Uses
RMMV
What does the code you have currently do, and how is it differing from what you want it to?
So this is awkward but, basically, I was going through the effort to write a detailed list of what everything did, and by testing the code I had, I actually found what was wrong. The problem line was the default code. the problem was that putting in "ConfigManager[symbol] = value(2);" would basically break yanfly's option menu, showing the default RM option menu instead. but then I decided on the spot to instead do "ConfigManager[symbol] = 2;" and it worked.
So uh, that was just a dumb move on my part for not just trying that. Thanks for coming out of your way to help me though! It means a lot.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,468
Reaction score
5,596
First Language
Dutch
Primarily Uses
RMXP

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.

Latest Threads

Latest Posts

Latest Profile Posts

I sometime envy the people that haven't played Skyrim yet. I feel like I could trade the whole world to be able to make my first pilgrimage to High Hrothgar all over again
Come join us while we play Pocket Mirror by Astral Shift! :LZSjoy: Starting at 2PM ET today!
Tried changing profile icon but...It just felt weird, you know? Who would even want to talk to me if I didn't have this fat yellow rodent thing....Or whatever it is as a mascot....No one, that's who! I am nothing without it. NOTHING!!..
I am having such a good hair day but because it's thunderstorms all day I don't go out and as such nobody will see my hair >.< It's not often my hair cooperates!
Pretty much stopped posting in the progress thread cuz it feels like talking to the void, lol, so I've just been posting on IG instead. But someone finally liked my post there, lol. Dunno if I'll continue tho. Probably not xD

My game's progressing quite well. Just kinda stuck on mapping right now. Decided to go the side, slightly top down view route. I'm drawing everything from scratch for a personal touch uwu

Forum statistics

Threads
112,338
Messages
1,067,547
Members
145,979
Latest member
Sebasti4n2
Top