Changing acsetup.cfg within the game

Started by CrashPL, Tue 27/11/2018 11:05:44

Previous topic - Next topic

CrashPL

I've been thinking about adding several display options to the in-game settings, for the sake of simplicity - nothing too complicated, just changing the resolution/scaling/windowed mode after restarting directly in the game. I tried using Wyz's IniFile module, and while it works great (all of the changes are saved in the config), as soon as I close the game, whether by the Exit button or just closing the window, the acsetup.cfg gets overwritten, reverting to initial settings before the game was launched.

Is there any reliable way to change/save the ini settings in acsetup from the game, or should I just stick to winsetup?

Crimson Wizard

#1
I am afraid it's impossible at the moment because engine saves some options upon exit (this was made to remember whether player switched to fullscreen or windowed at runtime). Cannot think of any way to override this using existing engine unless some external process also modifies acsetup.cfg right after game is closed.
Another alternate option is to make your own custom version of the engine that simply skips saving config. This is a trivial change, so question is rather if you are okay with using custom build as a game developer (and will find a programmer who'll do that).


Changing display options from inside the game - this is something that had to be added to script commands long time ago but was not for some silly reason. Engine is now capable to switch most of things when running, including graphics driver, so its only a matter of adding script functions. I will put this in TODO list for upcoming 3.5.0 release.

Cassiebsg

Since you can change the stuff and thne save it using Inifile, I suggest you save it with another name... maybe settings.ini/cfg or whatever... and then read it at game start (make sure you check for file existing before trying to load it). I used this method to save all the custom settings on my BSG game, so that the player did not have to set up the game to his/her liking every single time.

Hope it helps.
There are those who believe that life here began out there...

Crimson Wizard

Quote from: Cassiebsg on Wed 28/11/2018 14:51:35
Since you can change the stuff and thne save it using Inifile, I suggest you save it with another name... maybe settings.ini/cfg or whatever... and then read it at game start (make sure you check for file existing before trying to load it). I used this method to save all the custom settings on my BSG game, so that the player did not have to set up the game to his/her liking every single time.

From what I understand, they are trying to write not their custom settings, but overwrite AGS own settings. Your proposed solution won't let them apply these changes.

Monsieur OUXX

I recall that years ago someone wrote a cunning module that would let you change graphic settings from within the game, and then the game would reboot itself or something and the changes would take effect. It was done in a very clean and effective manner.
I'm not saying it resolves everything magically, but it could be worth investigating its features and how it's done (first one would need to dig it out with some google search)
 

SMF spam blocked by CleanTalk