Game Development Community

Custom Named XML Files

by Andrew H · in Torque Game Builder · 08/04/2011 (2:12 pm) · 2 replies

I am going to create XML files for profiles. When I create/read the files, is there any way to make the name of the XML file a variable? The .xml part is given, but I want to make a file named after a player...so if the player was named James, the file would be "James.xml". How would I go about doing this?

#1
08/05/2011 (12:30 pm)
Are you using SimXMLDocument? Either way, you can combine strings in script using simple concatenation:

%name = "James";
%extension = ".xml";

%file = %name @ %extension;

There are various ways to do this:

%name = "James";
%file = %name @ ".xml";
#2
08/05/2011 (12:32 pm)
Oh, okay. Thanks again, Michael! And yes, I am using a SimXMLDocument.