Game Development Community

How to use SimXMLDocument

by Koen Van Baelen · in Torque Game Builder · 05/17/2008 (7:26 am) · 2 replies

Does anybody know how to use this? There's hardly any documentation at all about it, only a list of methods that's full of errors (wrong arguments, poor descriptions, ...). Searching the forums also didn't yield any results. I need this to write and read small XML files that contains keyboard settings and high score tables. Any help would be greatly appreciated!

#1
05/17/2008 (8:44 am)
There is a script namespace XML defined in one of the common folder script files ( xmldocument.cs? xml.cs? ) which provides a little wrapper for simXmlDocument. It is used by TGB for loading the xml config file with stuff like your game name, company name, etc.. You might first look at that and see if you can mirror what it is doing.

Alternatively, you could save your high scores in a different way. There is a highscore saving/loading resource on the TDN which uses a simset and scriptobjects, which saves the scores in a .cs file by using simObject.save() and exec().

You could also save them as global script vars, like the $pref::* stuff, check out the export console function if you are interested in that.
#2
05/17/2008 (1:04 pm)
Thank you very much for the help! The XML wrapper (found it in common/gamescripts/xml.cs) seems to do the job fine. I also found some sample code on how to use it in common/gamescripts/properties.cs.