RMMZ Add a Yes/No line (tied to a switch) with visustella Options core?

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,016
Reaction score
852
First Language
French
Title says it all.

Question blablablabla: Yes/No

If Yes, switch X is ON, otherwise it's OFF.
How to do that?
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,421
Reaction score
1,832
First Language
EN
Primarily Uses
RMMZ
If you just want to reference an option in-game then you can do so via Conditional Branch > Script, e.g. to check if the alwaysDash setting is on:
JavaScript:
ConfigManager['alwaysDash']
You can set a value in a similar way, e.g.
JavaScript:
ConfigManager['alwaysDash'] = true;


Otherwise, note that by default all switches reset on game boot, New Game, and Continue, but in-game options do not (typically) reset like this. It sounds like you will need a plugin that lets specific switches keep their values through these transitions. VisuStella Save Core offers this in the form of "Global Switches":


If you still want to sync a persistent game switch with an in-game option, that'll require several edits in the parameters of Options Core. I think the easiest approach would be to show the option like normal but only ever reference/change the value of the persistent switch. Basically, you could make a copy of an existing on/off option, e.g. alwaysDash, then:
  • Swap all instances of this.setConfigValue(symbol, value) for:
    JavaScript:
    $gameSwitches.setValue(1, value)
  • Swap all instances of this.getConfigValue(symbol) for:
    JavaScript:
    $gameSwitches.value(1)
These examples reference game switch 1, change that as appropriate. You might also need to edit other lines, e.g. any direct ConfigManager[symbol] references.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,016
Reaction score
852
First Language
French
Maybe I'm wrong but... I'm not sure this answers my question.
What I'd like is add an extra (custom) line to Options core:

1618927424593.png

This line should have 2 options: Yes and No. Default position should be No but that doesn't really matter, if it's on Yes I can adapt. However what's important is that Yes should mean Switch X goes ON, and No mean same Switch X goes OFF.
 

Latest Threads

Latest Posts

Latest Profile Posts

Alberest so far, got a lot done but still ALOT left to do.
Wish I had a better means of taking screenshots...
Map is 148x98

concept: zombie slayer fest.

Lag because of outdated hardware.

Lots todo:
-Terrax lightning should have another step for the flashlight, between up down left right.
-Also Online mv from Nelderson should emit the flashlight from the other player.
-Animation needed for killing the zombie...
Before adding it to #crypchania.
Working on a case. Get all the evidence to prosecute some bad guys. :kaojoy:
But, the game development schedule delayed. :kaoswt2:
The moral of the story: No good deed goes unpunished... I guess...
Except that, nothing to see here. :kaoswt2:
just beat ff7 original for the first time since 2010. having played remake last year, I have a much better appreciation for the original oddly enough. I still like some of the character presentation in remake more, but the original's got a lot going for it.

Forum statistics

Threads
111,455
Messages
1,061,235
Members
144,825
Latest member
ziipan
Top