Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Loading xml mixed data in C# for an editor

Name: Anonymous 2012-11-15 7:54

I am building a world editor for a game and I need help with the process of loading a map saved from the editor. Everything is complete except for the map loading. I haven't been able to find a description online on how to load mixed data from an xml file (as in integers & strings). I can't mess with the output format because I don't have access to change the game client's method of  parsing the xml, I just know that it works with this format.  I know how to load xml in c++ using tinyxml but my c# is really rusty. I just need to know how to take data from each of the elements so I can use them in the world editor. Any help would be massively appreciated.

<?xml version="1.0" encoding="UTF-8"?>
-<Map> -<tileset progPath="../../../../../../../../Desktop/TestTileset.png"
    path="Desktop/TestTileset.png" tileSetSizeY="20" tileSetSizeX="20" tileHeigh="32" tileWidth="32" GridSizeH="5" GridSizeW="5">
        tilesetinfo
        <tileset index="0" y="0" x="0">tile</tileset>
        <tileset index="0" y="1" x="0">tile</tileset>
        <tileset index="0" y="2" x="0">tile</tileset>
        <tileset index="0" y="0" x="1">tile</tileset>
        <tileset index="0" y="1" x="1">tile</tileset>
        <tileset index="0" y="2" x="1">tile</tileset>
</tileset>
 <item y="36" x="40" lane="2">waypoint</item>
 <item y="116" x="23" lane="2">waypoint</item>
 <item y="116" x="23" lane="2">node</item>
 <item y="120" x="72" lane="2">waypoint</item>
 <item y="120" x="72" lane="2">node</item>
 <item y="114" x="120" lane="2">waypoint</item>
 <item y="114" x="120" lane="2">node</item>
 <item y="70" x="138" lane="2">waypoint</item>
 <item y="116" x="23" lane="2" owner="1">tower</item>
 <item y="114" x="120" lane="2" owner="2">tower</item>
 <item y="30" x="117" owner="1">avatar</item>
 <item y="126" x="125" owner="2">avatar</item>
</Map>

Don't change these.
Name: Email:
Entire Thread Thread List