Best way to store fullscreen/ windowed setting on game exit
by Blake Drolson · in Torque Game Builder · 06/27/2011 (7:54 pm) · 3 replies
Hi there,
I searched the forums and could not find an answer to this one. I am trying to save two settings, first setting is "full screen/windowed", second setting is "sound volume". My question is what is the best way to do this.
I tried setting the value of $Game::FullScreen so that it would be saved with commonconfig.xml, but it appears that even though the script from common directory tries to write out commonconfig.xml, it doesn't appear to save anything. i am wondering if the program has permission to write a file there in windows 7, or if it has to write in the app data folder.
Should I make my own XML file in the app data folder? Is there a way to get the directory path to this that's good across platforms? Is there a better way to store the current game preferences?
Thanks for any help in advance..
I searched the forums and could not find an answer to this one. I am trying to save two settings, first setting is "full screen/windowed", second setting is "sound volume". My question is what is the best way to do this.
I tried setting the value of $Game::FullScreen so that it would be saved with commonconfig.xml, but it appears that even though the script from common directory tries to write out commonconfig.xml, it doesn't appear to save anything. i am wondering if the program has permission to write a file there in windows 7, or if it has to write in the app data folder.
Should I make my own XML file in the app data folder? Is there a way to get the directory path to this that's good across platforms? Is there a better way to store the current game preferences?
Thanks for any help in advance..
#2
06/28/2011 (6:22 am)
You do not have to do anything special to save file to AppData directory. Any file your game creates will automatically go there, unless that file already exists in the installation directory. So, just write your settings to game/prefs.xml or something like that.
#3
06/28/2011 (9:20 am)
Thanks, that's what I needed to know :).
Torque Owner Blake Drolson
Imminent Games