noemen Posted December 23, 2019 Share Posted December 23, 2019 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. Quote Link to comment Share on other sites More sharing options...
Duion Posted December 23, 2019 Share Posted December 23, 2019 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/blob/561f010f2e6411d8253d23f0cfcff794e81f60bf/Templates/Full/game/core/scripts/client/defaults.cs#L28Only 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. Quote Link to comment Share on other sites More sharing options...
aMoistKite Posted December 24, 2019 Share Posted December 24, 2019 Just use export (string pattern, string filename="", bool append=false)Like so.export("$pref::*", "prefs.cs", false);Then exec your pref file when you launch your game. Quote Link to comment Share on other sites More sharing options...
noemen Posted December 25, 2019 Author Share Posted December 25, 2019 @Duion and @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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.