RMMZ Help with Visustella Options Core Saving Options Settings

Status
Not open for further replies.

Niniann

Regular
Regular
Joined
Feb 16, 2016
Messages
91
Reaction score
43
First Language
English
Primarily Uses
RMMZ
Greetings,

I am working on creating a toggle (OFF, ON) for motion sickness within the Visustella Options Core that will disable dragonbones animations for monsters within my game for players that don't like them/the movements make them feel unwell.

The option looks like this:

Monster Animations OFF / ON

Behind the scenes is a switch; when the option is set to ON, the switch is turned on, which makes battles select troops that use enemies with dragonbones animations. When the OFF option is chosen, the switch is turned off, which makes battles choose troops with enemies that have no dragonbones animations.

So all of that is working perfectly. However, there is an issue with how options are "saved" within the Options Core.

What is happening is if the game is turned off, then turned back on, and a new game is started, regardless of what setting Monster Animations is on, the animations will always be turned on.

To clarify, the default setting for monster animations should be ON. However, if a player chooses to turn the option to the OFF setting, and then exits the game, then reboots the game, the Visustella Options Core will have the option still set to OFF. However, in game, the animations will be turned on again. The player has to go to the options menu, turn Monster Animations ON, and then turn it OFF again for the animations to be disabled.

How do I get the Visustella Options Core to properly save the chosen option? The way the Options Core works seems to me that it initializes its settings and sets the values of everything on boot, but it is not doing so with my custom option.

PS. I realize this is not alot of information to go off of per say, so if anyone that is able to assist needs more, please let me know and I'll post on this thread with the requested info.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,532
Reaction score
10,976
First Language
English
Primarily Uses
RMMV
We'd have to see screenshots of how you added the option in the plugin parameters.

Options should be saved per computer user. If your other options settings (like volume levels) are saving but this one isn't, that sounds like you may not have configured it correctly.

PS. I realize this is not alot of information to go off of per say
per se :wink:
 

Niniann

Regular
Regular
Joined
Feb 16, 2016
Messages
91
Reaction score
43
First Language
English
Primarily Uses
RMMZ
ATT_Turan,

Thank you for the reply (and for the spelling correction, lol). So I took pictures of what I believe to be the code relevant to my inquiry, but please let me know if you need a picture of something else and I'll be happy to grab that for you.

perform actions pic.png

cursor right pic.png
cursor left pic.png
default value pic.png
save option pic.png
load option pic.png
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,532
Reaction score
10,976
First Language
English
Primarily Uses
RMMV
I don't think you want to be turning the switch on and off when you move the cursor left and right - just when you actually press OK. And that section could be shortened to one line:
Code:
$gameSwitches.setValue(117, !value);

Aside from that, the parent plugin parameter screen to all of that - do you in fact give it a defined, unique symbol?
 

Niniann

Regular
Regular
Joined
Feb 16, 2016
Messages
91
Reaction score
43
First Language
English
Primarily Uses
RMMZ
ATT_Turan,

So for the switching left and right, if I changed that, that would make it different than most other options within the default Visustella Options Core. It would also be weird for a user if they go down to the option, move the cursor left to OFF, and then move down to other options, but the option is still technically set to ON because they didn't press the select button.

It does indeed have a unique symbol afaik, I set the symbol option to "motionSick" (no quotations on the actual line. Pic for reference:

symbols.png

motionSick params.png
 

Niniann

Regular
Regular
Joined
Feb 16, 2016
Messages
91
Reaction score
43
First Language
English
Primarily Uses
RMMZ
As an addendum to my last reply, by default the Visustella Options core, upon pressing the Select button, simply moves the cursor to the next option in the list, same as if you moved the cursor with the arrow keys/joystick. Not sure if that is something within the code of the option, but all my default i.e. built in options work like this as well.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,532
Reaction score
10,976
First Language
English
Primarily Uses
RMMV
if I changed that, that would make it different than most other options within the default Visustella Options Core.
Okay, if that's their standard setup for the menu, then by all means you want to match it.

The problem could be in your Load Option, I see there's nothing in there relating to your game switch.

At the same time, the config is loaded before you actually get into the game, so switches don't exist there yet.

The weird part is you said when you load from a save the switch is changed. This says the actual options menu config file portion is working correctly, it's saving the config chosen.

But something is changing the game switch, and the state of that switch is saved in the save file. That makes me feel more like some event in your game or troops or something is messing with it.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
5,240
Reaction score
4,695
First Language
EN
Primarily Uses
RMMZ
As you are seeing, there is a problem here: switches are intended to be per-playthrough, but options settings are global. When the game boots, or when you start a new playthrough, all switches are initialised, i.e. turned off. So for this exact setup, you would need some extra code to prevent that particular switch from being reset.

However, you say that this option:
will disable dragonbones animations
I don't know how you're doing this, but it doesn't sound like that needs to be controlled by a game switch. Can you reference the option setting directly? E.g. Conditional Branch -> Script:
JavaScript:
ConfigManager.motionSick
Or:
JavaScript:
if (ConfigManager.motionSick) {
  // toggle the stuff here
}
 

Niniann

Regular
Regular
Joined
Feb 16, 2016
Messages
91
Reaction score
43
First Language
English
Primarily Uses
RMMZ
ATT_Turan,

Hmm, so first thing would be the hypothesis with the switch being affected in game.

So that could not be the case simply because the switch I use is something I created just this morning for creating this new option and has never been used in any event anywhere, since the only thing I've been working on today is the option. Or at least, that *should* not be the case...anything is possible but I don't know how that could happen.

So as far as the Load Option, that is a good idea. I just tried to see if I can add something there to make it work. It doesn't seem to have any affect whatsoever on what the option does, however? I'm not sure...I went through and tested various scenarios and the original problem persists with the following additional code added to JS: Load Option:


load option 2 pic.png
 

Niniann

Regular
Regular
Joined
Feb 16, 2016
Messages
91
Reaction score
43
First Language
English
Primarily Uses
RMMZ
caethyril,

Thank you for your reply! So I'm not sure how I would be able to implement what you're suggesting, since what is controlling the animations to be used or not is the switch itself. Please allow me to clarify:

Basically, how it works is I have two sets of each enemy, and two sets of each troop.

One enemy, lets say a slime, has two entries in the database which is 1. the slime with a dragonbones setup and 2. the slime with no dragonbones setup.

Next is troops. In the case of say, a battle vs. a single slime, there would be 1. troop that uses a dragonbones animated slime and 2. a troop that uses a no dragonbones, still-picture slime.

What the switch is supposed to be used for is that, when a player sets motionSick (which is the Symbol, the text in game reads Monster Animations, just to be super clear) to ON, it turns on the switch and they will get dragonbones monsters. If a player sets motionSick to OFF, switch is turned off, and the player will get battles against still-picture enemies.

Edit: Actually I reread through your suggestions and understand what you're saying, am testing them out now, one moment please :).
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,532
Reaction score
10,976
First Language
English
Primarily Uses
RMMV
What the switch is supposed to be used for is that, when a player sets motionSick to ON, it turns on the switch and they will get dragonbones monsters.
This - how are you doing this?

Wherever you're doing that check for a switch, replace it with the code to check the ConfigManager that caethyril showed above.
 

Ms Littlefish

Time Traveling Victorian Vampire
Global Mod
Joined
Jan 15, 2014
Messages
8,874
Reaction score
14,108
First Language
English
Primarily Uses
RMMV
@Niniann , please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.
 

Niniann

Regular
Regular
Joined
Feb 16, 2016
Messages
91
Reaction score
43
First Language
English
Primarily Uses
RMMZ
ATT_Turan & caethyril,

Ahh I see what you are asking now, my apologies.

So how I was doing that was within the monster events themselves. I don't use random battles, instead monsters are events on the map that, when touched, trigger a conditional branch that first checks if switch 117 was on or off, and then pulls the appropriate troop types.

However, I've modified the event's conditional branch to use the script as caethyril suggested, and the former technique is no longer necessary. caethyril's suggestion fixes my issue completely. I believe my issue was exactly as caethyril said, the switch was being initialized on boot/new game regardless of what option in the Visustella Options Core was selected.

Instead now, with the conditional branch checking specifically the option setting itself, the option is properly saved to whatever was selected the last time the player interacted with the option itself. I.e. if they set it OFF, turn the game off, turn it back on, and select new game, the option itself will still be OFF and the player will get still-picture animated monsters as desired.

Consider my problem solved.

Thank you both very much for your assistance, it is greatly appreciated :).

I hope you all have a wonderful week,
-Niniann

P.S. Sorry Ms Littlefish, I've got a habit of making new posts to respond to people and forget not to do that here. I'll try and be better at that.
 

Ms Littlefish

Time Traveling Victorian Vampire
Global Mod
Joined
Jan 15, 2014
Messages
8,874
Reaction score
14,108
First Language
English
Primarily Uses
RMMV
This thread is being closed due to being solved. If you need it reopened, report it to let us know why. Thank you!
 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

image.png

Baldur's Gate 3 got a little bit too real there
Albert.png
You're welcome! Fly in, take Albert in my style
The flight sim I've bought has some amazing priorities.
If I land with one wheel slightly off the runway, but it's an otherwise fine landing, it doesn't count. But if I touch down on the runway so hard it makes me bounce back into the air and crash in the next 10 seconds, as long as it's on the runway, it's a successful landing.
Mike Final Breaker.png
that time I drew Mike doing Hugo from Street Fighter 3's Shootdown Backbreaker...

Forum statistics

Threads
136,638
Messages
1,268,285
Members
180,324
Latest member
Flamedro
Top