[ZScript] Manual config save function

Moderator: GZDoom Developers

User avatar
kevansevans
Spotlight Team
Posts: 429
Joined: Tue Oct 05, 2010 12:04 am
Graphics Processor: nVidia with Vulkan support

[ZScript] Manual config save function

Post by kevansevans »

As GZDoom is used more and more for increasingly grandiose projects, I feel there will be growing needs to ensure that custom data stored in the gzdoom.ini config needs to be reliably saved. Currently, the only way to ensure a custom cvar saves with its respective data is for the user to manually close GZDoom in some fashion. However, if GZDoom crashes, any changed data that would get saved is lost entirely, which is a situation I’ve ran into with one of my current projects. While it is my responsibility to make sure my creations don’t crash, I definitely don’t want my players having to lose any major progress they’ve made. Being able to manually save the config would be a great way to keep that data persistent.
Blue Shadow
Posts: 5032
Joined: Sun Nov 14, 2010 12:59 am

Re: [ZScript] Manual config save function

Post by Blue Shadow »

In the Options menu, there's a command that is called "Save current settings".
User avatar
Rachael
Posts: 13789
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: [ZScript] Manual config save function

Post by Rachael »

I think there are two sensible approaches to this that may work, besides what Blue Shadow already said:

1) Automatically save the config every time a game save is triggered (including auto saves)
- or -
2) Automatically save the config every time the options menu is closed
User avatar
kevansevans
Spotlight Team
Posts: 429
Joined: Tue Oct 05, 2010 12:04 am
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Manual config save function

Post by kevansevans »

Having it save from a menu is not what I need. I'm using CVARS to store info that is save agnostic and modified across several places in game, not in an options menu. Instructing my players to open and close a menu, with maybe hitting a setting, to ensure this data is saved correctly is pretty backwards. Having it write the new config when a save is performed is a good approach, however I don't want to have the player end up with a deadman save. Saving the config on a save game should be implemented regardless, but I need to save the config specifically.
Blue Shadow
Posts: 5032
Joined: Sun Nov 14, 2010 12:59 am

Re: [ZScript] Manual config save function

Post by Blue Shadow »

To be honest, as a user, I don't like the idea of mods having the capability of writing something to disk at will, even if it is just saving the config that we're talking about here.

Another thing, using CVARs to store "data" is just wrong. I get it, there isn't another way currently, but it doesn't mean CVARs are the right way.
User avatar
kevansevans
Spotlight Team
Posts: 429
Joined: Tue Oct 05, 2010 12:04 am
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Manual config save function

Post by kevansevans »

Mods can already write stuff to your system just fine as is, and plenty of mods use custom CVARS.

If you’re that concerned about doing it “””correctly”””, then I would more appreciate the ability to create my own save files that are readable/writable at a whim. Which means the ability to write to your system.

Either way, the engine needs a way to reliably save custom data. Offering a function to make the config be saved whenever will not affect any perceived security concerns that already exist.
User avatar
kevansevans
Spotlight Team
Posts: 429
Joined: Tue Oct 05, 2010 12:04 am
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Manual config save function

Post by kevansevans »

Return to “Closed Feature Suggestions [GZDoom]”