Page 1 of 1

GUI OptionsDlg: Camera Viewing Distance

Posted: Mon Dec 23, 2019 2:39 am
by noemen
I made a simple script that will give you the option to choose the camera viewing distance within the optionsDlg GUI. When I change this in the options I see in the console that was changed, but when I close the game and open it again, View Distance returns to default. Already tried tried several ways I was unsuccessful.

Re: GUI OptionsDlg: Camera Viewing Distance

Posted: Mon Dec 23, 2019 6:02 pm
by Duion
You need to store the value as a preference that gets saved in the config files, like the values in the option menu, they start with &pref like those: https://github.com/GarageGames/Torque3D ... lts.cs#L28
Only they are saved to a file when you set them in the game. Maybe you forgot to write into the script a function that saves the values to a config file, happened to me before, I just force save all the values when the option dialog is closed so it never forgets to save the changes.

You also need to make sure to use the &pref value instead of anything else when setting the camera view distance for the first time.

Re: GUI OptionsDlg: Camera Viewing Distance

Posted: Tue Dec 24, 2019 8:15 am
by aMoistKite
Just use

Code: Select all

export (string pattern, string filename="", bool append=false)
Like so.

Code: Select all

export("$pref::*", "prefs.cs", false);
Then exec your pref file when you launch your game.

Re: GUI OptionsDlg: Camera Viewing Distance

Posted: Wed Dec 25, 2019 6:34 am
by noemen
@
User avatar
Duion
and @
User avatar
aMoistKite
Thank you so much for your help ... I will take your advice. I'm just a programming amateur, I'm learning a lot from Torque3D, and of course from you.