Need Help with Yanfly Options Core> Add Terrax Function

Hi guys,

i'm using this script https://forums.rpgmakerweb.com/index.php?threads/terrax-lighting-system.49339/

I need to configure the possibility to turn on and off the light function, through the option menu for give to player a chance to disable or enable the script.

Terrax made a change in the script, and added this part (i think that it's this part... it's on the bottom of the script)

JavaScript:
// ALIASED FROM RPG OBJECTS TO ADD LIGHTING TO CONFIG MENU

    ConfigManager.TxLighting = true;

    Object.defineProperty(ConfigManager, 'TxLighting', {
        get: function() {
            return options_lighting_on;
        },
        set: function(value) {
            options_lighting_on = value;
        },
        configurable: true
    });

    var Alias_ConfigManager_makeData = ConfigManager.makeData;
    ConfigManager.makeData = function() {
        var config = Alias_ConfigManager_makeData.call(this);
        config.TxLighting = options_lighting_on;
        return config;
    };

    var Alias_ConfigManager_applyData = ConfigManager.applyData;
    ConfigManager.applyData = function(config) {
        Alias_ConfigManager_applyData.call(this,config);
        this.TxLighting = this.readFlag2(config, 'TxLighting');
    };

    var Window_Options_addGeneralOptions = Window_Options.prototype.addGeneralOptions;
    Window_Options.prototype.addGeneralOptions = function() {
        Window_Options_addGeneralOptions.call(this);
        if (add_to_options == "Yes") {
            this.addCommand(optiontext, 'TxLighting');
        }
    };

    ConfigManager.readFlag2 = function(config, name) {
        var value = config[name];
        if (value !== undefined) {
            return !!config[name];
        } else {
            return true;
        }
    };





})();


But this code works with the normal option menu. With Yanfly Option Core, this part doesn't work and i don't see the new function T_T
I see in the help file of yanfly option core that there is the part explained for configure a new option command, but i really don't know how to set it, i'm not very good in javascript.

Can a good soul help me? I attach terrax script and yanfly core script explain.

Thank you so much...

Spoiler: Yanfly Option Core Help file
============================================================================
* Introduction
* ============================================================================
*
* WARNING: This plugin is to be used with RPG Maker MV 1.5.0 or above! This is
* because the MV 1.5.0+ editor allows for this plugin to be made in an orderly
* and efficient manner. Please make sure your RPG Maker MV software is up to
* date before using this plugin.
*
* The Options Menu can be the one thing that can change how comfortable a
* player is with your game. Within the Options Menu, the player can alter any
* given settings to their liking adjusting to their playstyle. By default,
* settings like 'Always Dash' and 'Command Remember' are included in RPG Maker
* MV and other plugins made for RPG Maker MV may also add in newer options to
* the list. However, the menus themselves were always a bit iffy to look at
* and/or adjust. This plugin gives the Options Menu a visual makeover and full
* control over what options can be added to the menu to befit your players!
*
* This plugin supports the following plugins:
* - GamepadConfig.js
* - YEP_AnimateTilesOption.js
* - YEP_BattleAniSpeedOpt.js
* - YEP_FpsSynchOption.js
* - YEP_KeyboardConfig.js
* - YEP_X_ActSeqPack3.js
* - YEP_X_BattleSysATB.js
* - YEP_X_DifficultySlider.js
*
* Be sure to update them if you haven't already.
*
* ============================================================================
* Instructions - Option Categories Plugin Parameters
* ============================================================================
*
* This plugin adds in 'Option Categories' into the Options Menu. Aside from
* the 'All' and 'Exit' categories, all of the categories are customizable from
* the way they appear in the menu to the way they behave.
*
* Here is how each parameter behaves:
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*
* Name:
* - Determines the way the Category name appears. Name or rename categories
* as you see fit. You can use text codes with this parameter, allowing you
* to add icons (\i[x]) or change the text color (\c[x]) of the category.
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*
* Help Description:
* - This is the text shown in the help window at the top of the Options Menu
* whenever this category is highlighted. Use it to describe what types of
* options will appear in this category and how they will affect the game.
* You may also use text codes with this parameter.
*
* Options List:
* - This is the list of options that appear on the right side of the Options
* Menu when this category is highlighted or selected. You can add, edit,
* move around, or delete options from this list as you see fit. For details
* on how the plugin parameters for the Options List work, look in the next
* section below:
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*
* ============================================================================
* Instructions - Option List Plugin Parameters
* ============================================================================
*
* This section explains how the plugin parameters for the Options List operate
* and how they interact with the rest of the plugin.
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*
* Name:
* - Determines the way the Options name appears. Name or rename the option
* as you see fit. This does not use the command names provided by other
* plugins by default. You can use text codes with this parameter, allowing
* you to add icons (\i[x]) or change the text color (\c[x]) of the option.
*
* * If you name this as 'EVAL: code' without the 'quotes', the name of this
* option will be whatever string that the code outputs.
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*
* Help Description:
* - This is the text shown in the help window at the top of the Options Menu
* whenever this option is highlighted. Use it to describe what this option
* changes for the game.
*
* ---
*
* Symbol:
* - This is the identifier for the option. Each option should have a unique
* symbol, so much as to not cause conflicts within the Options Settings.
* However, shared symbols are perfectly fine as long as you're fine with
* them performing the same functions when selected.
*
* ---
*
* Show/Hide:
* - This is the code used to determine if this option will be visible on the
* list of options within this category.
*
* To make sure it always shows, use the following code:
* show = true;
*
* ---
*
* Enable:
* - This is the code used to determine if this option will be enabled. It is
* recommended that you leave all options as enabled as to not lock away
* options from the player.
*
* To make sure it is always enabled, use the following code:
* enabled = true;
*
* ---
*
* Ext:
* - Stands for extension. This serves as a secondary symbol for the option
* and it can be used for pretty much anything. It has no direct impact on
* the option unless the option's effect is related to the extension value.
* The majority of options do not need to make use of the Ext value so it is
* best to just leave this alone.
*
* To leave it alone the following code:
* ext = 0;
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*
* The following section is best left untouched if you do not know any JS
* programming and don't have instructions on how to set it up. This is
* because all of the behaviors related to the options can be controlled from
* here and a mistake can crash the game.
*
* Make Command Code:
* - This is the code used to add the option command to the list of options.
* Use this to modify the name, symbol, if it is enabled, or change the ext
* value before finally adding it to the list.
*
* The default code:
* this.addCommand(name, symbol, enabled, ext);
*
* ---
*
* Draw Option Code:
* - This is how the option is 'drawn' onto the Options window and seen by
* your players. Everything here controls the way the option looks from the
* way it is named to the position of the text. The majority of the variables
* defined towards the beginning of the default code is placed there for the
* sake of convenience.
*
* The default 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);
* this.drawOptionsOnOff(index);
*
* ---
*
* Process OK Code:
* - This is the code that runs when the player presses any kind of confirm
* button (Z, Enter, Left Click) on this option. For most options, this will
* switch between an ON/OFF option. For others, this will make the value of
* the option scale upwards until it loops back.
*
* The default code:
* var index = this.index();
* var symbol = this.commandSymbol(index);
* var value = this.getConfigValue(symbol);
* this.changeValue(symbol, !value);
*
* ---
*
* Cursor Right Code:
* - This is the code that runs when the player presses the RIGHT button.
* Usually, this will move most options into an ON position. For others, this
* will scale the value of the option upward.
*
* The default code:
* var index = this.index();
* var symbol = this.commandSymbol(index);
* var value = this.getConfigValue(symbol);
* this.changeValue(symbol, true);
*
* ---
*
* Cursor Left Code:
* - This is the code that runs when the player presses the LEFT button.
* Usually, this will move most options into an OFF position. For others,
* this will scale the value of the option downward.
*
* The default code:
* var index = this.index();
* var symbol = this.commandSymbol(index);
* var value = this.getConfigValue(symbol);
* this.changeValue(symbol, false);
*
* ---
*
* Default Config Code:
* - When creating new options, this determines the default value of the
* option. For most options, this starts in an OFF position, which is usually
* represented by a 'false' boolean.
*
* The default code:
* ConfigManager[symbol] = false;
*
* ---
*
* Save Config Code:
* - This determines how saving the Options Settings is done through code.
* Normally, this takes on the value as it is for the ConfigManager.
*
* The default code:
* config[symbol] = ConfigManager[symbol];
*
* ---
*
* Load Config Code:
* - This determines how the ConfigManager loads the saved Options Settings
* upon the loading of the game. Normally, this takes on whatever settings
* stored within the config file and plants it straight into the
* ConfigManager directly.
*
* The default code:
* ConfigManager[symbol] = !!config[symbol];
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*
* ============================================================================
* Changelog
* ============================================================================
*
* Version 1.02:
* - Bypass the isDevToolsOpen() error when bad code is inserted into a script
* call or custom Lunatic Mode code segment due to updating to MV 1.6.1.
*
* Version 1.01:
* - Updated for Message Speed Options.
*
* Version 1.00:
* - Finished Plugin!
*
* ============================================================================
* End of Helpfile
* ============================================================================
Guys, nobody can help me? 🙁
Nobody is able to help me?
please don't scold me, but if I don't try to bring up the topic, I'm afraid nobody will help me and the topic will end at the bottom of the list ...

I hope for some kind soul...
I've got both plugins, but I don't remember doing anything special to get them to work. I think I just placed Terrax lighting above all the YEP plugins. However, I'll double check when I get off work and see if I did something special with YEP options plugin.
I've got both plugins, but I don't remember doing anything special to get them to work. I think I just placed Terrax lighting above all the YEP plugins. However, I'll double check when I get off work and see if I did something special with YEP options plugin.

Hey, hi! Uhm i don't understand if you understand what i mean...

The two scripts works perfectly, but Option Menu Core change all Option Menu, and that part that i've requested in the past to Terrax, about a voice in option menu for Turn on and off the lights in the game, it doesn't work anymore, since the new Option Menu Core change everything.

In that script it'is explained how to add a new function in the new option core, but i really don't know how to setup it...

Do you know, the "Make option code", "Draw Option Code", "Process Ok Code" in the Option Core...
Sorry, my bad. I forgot that I actually stopped using Yanfly option core. I don't remember why...

I went checking my plugins and it's no longer in the list. Hope you fix your issue though.
Nobody else? possible that is there no one that is able to code a little, that want to help? 🙁
UP!
UP...

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-yanfly-options-core-add-terrax-function.118825/