MV Olivia_MetaControls Modification/Addon

Hi community (again).

this request is probably impossible or not able without rewritten probably?
So I have an request if it's possible to do.

first of all, the plugin is [Olivia_MetaControls] and it works outstanding, why?
when placing a switch with <Local> or <Global>, the switch when turned ON is saved,
this works all nice and all, but there is only 1 slight issue (which is my request) (in a small bit).

The Issue of this plugin:
when activating the switch, and press F5, Quit Game, or even close game -> reboot,
the switch is still activated, and that is in my case a slight issue as this plugin is required
for my ShadowDragon_TRI plugin (or any persistent switches), but the other one I found
also have this issue.

My Request:
in order to make it work (as some mechanics I make require on it as well), is when the switch
is turned ON, it should ONLY save when the game is saved, if they closes the game or press
F5, reboot the game, the switch should be back turned OFF.

is there someone able to make the modification or addon in order to make this work?
or able to make a plugin that has that function?

if it needs to be rewritten, I need to make a plugin request or let this move..
thank you in advanced.
I looked into the code and it looks like whenever a meta switch is changed it is saved into ConfigManager. You can find ConfigManager in rpg_managers.js in the js folder.

Inside of your project's save folder is a file called config.rpgsave That is where I believe all saves for local and global is located.
@Zeireth
I know that, but that is not what I asked if you read it carefully.
I'm still learning JS, but I need the switches be saved global when
the player SAVE the game, not directly after.

as I dont need <Local>, which some mechanics might using that,
my TRI plugin require <Global> one, but I need to reset it if the
player quit, press F5 or closes the game, like normal switches,
but saved when the player save the game.

otherwise it can break some mechanics that I like to avoid.
The plugin only saves in config.rpgsave it doesn't care about if you save the game or not. Of course it doesn't work the way you want, it never did. You will have to write the logic to make it work.

The code works like changing a setting in the options. For instance if you change always dash to true, then all new games will have always dash is true, however if config.rpgsave is deleted, then a fresh config file will be created on boot up of your game with default settings.

What you may want to do is overwrite Game_Switches.prototype.processMetaChange = function(switchId, value, global) and Game_Variables.prototype.processMetaChange = function(variableId, value, global). Each of those functions has a line that is ConfigManager.save();

This is not going to be easy. A solution is to not have it saved into config.rpgsave but rather in the current save file, then after the game saves it checks for <Global Meta> then saves in config.rpgsave.

What is the current save file? Is it 001, 002, 003. That's hard to know. There is no function that checks what is the last file saved, so you will have to make a function.

This is not for someone that is currently learning js. This is advanced level of code. I would suggest learning more js before tackling this. I can't give you all the answers. I won't write the code for you. All I got for you is ideas. You need to actually write the code to solve it.

Have you messaged Fallenangel Olivia? Maybe they could help you futher.

I wish you the best and I hope you will succeed.

Edit: I apoligize. I did not know this was a plugin request from you. I did not read the last paragraph you wrote.
I seek help to make it work, but I got 3 slots of savefiles,
use TSR_Save, so it saves in the current slot, and local is doing that
just fine, global as well, but I dont know how to make it work after
saving.

advanced coders will by far bypass my level and I would never reach their
coding level.

for me it's already difficult to learn JS and use it more directive before I get
forget and need to read it over and over.

what I do in 4 month can they do in 1-3 days.
but I'm happy with the achievements I made, so I seek help to make
this loging work or modify it in the plugin.

Fallen Angel Olivia is hard to contact as it's nearly impossible.
Problem solved.

if anyone need it as well with meta controls only save,
when the game is saved.

Rule out both ConfigManager.save() in olivia's metaControl.

and copy past that line into
Scene_Save.prototype.onSaveSuccess function
under the sound SE.

that did the trick.

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.

Original thread: https://forums.rpgmakerweb.com/threads/olivia_metacontrols-modification-addon.148289/