GUI OptionsDlg: Camera Viewing Distance

There are no stupid questions, just stupid answers.
4 posts Page 1 of 1
noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm
 
  by noemen » Mon Dec 23, 2019 2:39 am
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.
Duion
Posts: 1622
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Mon Dec 23, 2019 6:02 pm
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.
aMoistKite
Posts: 22
Joined: Wed Mar 06, 2019 10:07 am
by aMoistKite » Tue Dec 24, 2019 8:15 am
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.
noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm
 
by noemen » Wed Dec 25, 2019 6:34 am
@
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.
4 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests