Game Development Community

Saving variables to file

by Kees · in Torque Game Engine · 07/13/2004 (10:40 am) · 1 replies

I want to save some variables to file and then at game start load them back into memory. I hope someone can help me and give me some tips.

#1
07/13/2004 (11:01 am)
If you prefix the variables you wish to save with a specific tag you can use the following command:

export("$pref::*", "./client/prefs.cs", False);

replace $pref with your custom tag, and change the path you point to the file you wish to store the variables in.

Then when the game loads / starts you would just exec(); that file and your variables would be loaded.