Yanfly System Options - Saving Settings

ZirconStorms

Veteran
Veteran
Joined
Dec 22, 2014
Messages
359
Reaction score
111
First Language
English
Primarily Uses
RMVXA
Once you exit the game or start it up again, all settings you've applied in the system menu will be reset.
EX: If you set Autodash to the non-default value, close the game, and re-open it, Autodash will be back to the default value set inside of the script.
My priority here is saving the volume options; I can apply the same coding principles for the other settings later on.

edit: The engine saves settings with save files, but I'd want whatever settings you apply in the System menu to affect the game from startup/all save files, meaning save files would all have the same system settings.

I'm going to guess this is because of Game_System and the script initializing default settings for volume, autodash, instantmsg, and show/hide animations (the last three being module options). There are a few solutions I can think of:

1. tying each option to their own variable or switch, making sure those switches/variables are global (with something like this https://forums.rpgmakerweb.com/inde...switches-variables-to-global-save-data.54165/), and loading those values on startup.
2. saving the settings through the game.ini (or a custom ini) file.

Saving/loading the data onto an ini file could take more work but it might be better optimization-wise.
I've tried option 1 and 2, but failed so far. I've also tried using both the Rutan and Yanfly script, and making Yanfly's volume options = Rutan's volume values, but that was way too messy.

For 2, I know another volume script by user Rutan does an ini load/save function for bgm, bgs, se, me, and a master volume.
https://forums.rpgmakerweb.com/index.php?threads/master-volume-control.74752/
upload_2019-4-14_16-0-2.png

So for the Rutan script, it basically loads up the values on startup(??), and once you leave the Volume option scene, it saves the new volume values in the ini file:
upload_2019-4-14_16-6-12.png
The HZM_VXA::Ini.save part is confusing me a bit, but I'm going to guess that means to save it to the INI_FILENAME specified in the first screenshot (so Game.ini)
(Was going to put this in Learning Ruby and RGSSx but is probably asking for too much assistance to be in that thread.)
 
Last edited:

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
You sure about that? My tester changed the settings and when they sent me their save game their settings were saved on that save game. So it appears it is saving the settings for volume somewhere.

Edit: Yep, loaded the save to check. My saves I left it at 100% for all, my tester's save is 50% for Music and 25% for SE, and it loads the correct settings when it loads the save in both cases. Now I do have Yanfly's Save Engine installed too, so maybe that adds the function to save the setting too though.
 

ZirconStorms

Veteran
Veteran
Joined
Dec 22, 2014
Messages
359
Reaction score
111
First Language
English
Primarily Uses
RMVXA
You sure about that? My tester changed the settings and when they sent me their save game their settings were saved on that save game. So it appears it is saving the settings for volume somewhere.

Edit: Yep, loaded the save to check. My saves I left it at 100% for all, my tester's save is 50% for Music and 25% for SE, and it loads the correct settings when it loads the save in both cases. Now I do have Yanfly's Save Engine installed too, so maybe that adds the function to save the setting too though.
Okay so I checked, settings are saved per file; makes sense why there's code for Game_System in that case. I didn't have the yanfly save engine implemented, so that's just how this system script works.
I'll edit the original post to specify my request, then. As-is, I'm assuming that on title startup, none of the settings would be applied, since it'd default to preset values; so I'd want to bypass the fact that settings are stored per-save, and just have global settings.
You'd obviously need default settings still for when the player first boots up the game, but once that's done and settings are changed at all, I'd want the startup to revert to those values.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
The Game_System object is saved with your savefiles, so what you describe should not happen in a "healthy" project.
However, if you use an addon which lets you change these settings on the title screen by enabling the system options menu there, than yes, the changes you make on the title screen will be lost.

I made an addon for this some time ago. That addon makes these settings global and saves them in a file on your HDD instead.
Just be advised that users with non-standard characters in their windows username can experience crashes if you use certain ENV variables to set the folder for the setting file. For now, I advise to just put the setting file in the game's root folder instead.

Edit: Ninja'd! o.o
 

ZirconStorms

Veteran
Veteran
Joined
Dec 22, 2014
Messages
359
Reaction score
111
First Language
English
Primarily Uses
RMVXA
The Game_System object is saved with your savefiles, so what you describe should not happen in a "healthy" project.
However, if you use an addon which lets you change these settings on the title screen by enabling the system options menu there, than yes, the changes you make on the title screen will be lost.

I made an addon for this some time ago. That addon makes these settings global and saves them in a file on your HDD instead.
Just be advised that users with non-standard characters in their windows username can experience crashes if you use certain ENV variables to set the folder for the setting file. For now, I advise to just put the setting file in the game's root folder instead.

Edit: Ninja'd! o.o
Well that's convenient haha; and I appreciate the heads-up on the ENV module. Was planning to keep the settings file with the game folder anyways, so that's fine. Thanks for sharing your script addon, it works great.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,038
Members
137,568
Latest member
invidious
Top