Game Development Community

Exporting

by Tom Perry · in Torque Game Engine · 06/27/2005 (2:49 pm) · 3 replies

When the game quits the functions in the starter.fps package export all the prefs and stuff, I get all that. However one thing does confuse me. When the game boots up doesn't it read cs.dso files, and as the prefs etc files have already been used, and therfore have .dso's, why does the engine read the new recently exported files? I was wondering as I want to export my own new set of variables into a file and i wondered how it worked.
While I'm typing I might as well ask. The export funciton seems to have 3 parameters. The first and second are straight forward, but the 3rd I am not sure about. I guess it is a true or false thingy as false is used in the examples i said. What does this parameter do?
Finally (:P) the moveMap is saved also. I assume i can use that function to save other objects? If I am right, what is the true/false in that one do?
Ok I think that is it. Thanks in advance to anyone that can help.

#1
06/28/2005 (8:05 am)
I did some testing, just to confirm my guesses more then anything. If the $prefs are altered during the game they are saved as prefs.cs, and that is the one that is read, not the cs.dso. I still don't understand why though. Can anyone enlighten me?
Next, the files can be exported into the dso format (I cant read the dso to check but the file is exported and the prefs i changed were still at their original values in the cs so i assume they are in the dso). When this is done the old cs is read, not the new dso (which coincides with the results above). I was under the understanding that cs.dso are read first and cs are only read if there are no dso's available.
Even if I am not right could the export functions all be changed to export into dso's so they couldnt be changed out of the programme, or will this screw somthing up?
Like I thourght you can save objects with the save function, but I still don't understand what the false stands for.
If anyone can tell me what the fasle stands for on either export or save, why the dso's arent read and if exporting to dso will do anything bad I would be grateful.
#2
06/28/2005 (8:10 am)
Quote:If the $prefs are altered during the game they are saved as prefs.cs, and that is the one that is read, not the cs.dso. I still don't understand why though. Can anyone enlighten me?

IIRC the prefs.cs file isn't compiled into a *.cs.dso at all... is it? I've never paid close enough attention to be sure, but I don't think it does... or should.

Basically, the *.cs.dso is a compiled script. The engine reads and writes prefs to and from the *.cs file because I'd think it would be difficult to edit a compiled script at run-time. No point providing the user with a preference that would reset everytime the engine was restarted. =\

~ I could be wrong though... it's been known to happen.
#3
06/28/2005 (8:17 am)
Well the prefs.cs is compiled into cs.dso, at least it wasnt there before you run it, and it is after lol.
Can't the engine just read the prefs from a dso file then when the game calls the onExit function write them to a dso file again, overwriting the old one?Thats what I assume it would do, as it overides the cs files. Can't it do the same with the dso files?