ID:165092
 
XML.

How do you use that in a game? I'm wanting to use it to store item information, monsters, etc, but I don't understand how I would do something like that.

I mean, I understand how I'd set up the XML file:
<weapons>
<weapon name="sword" damage="2"/>
</weapons>


But how do I recognize this in-game? Do I create these objects at runtime by calling some proc to read this info from the XML file, and then create that object? Do I read info as I need it? That's the part I don't get.

This seems like it'll work for what I want perfectly, if only someone can clarify how I use it. =) Thanks in advance.
You tell your XML library (e.g. Deadron.XML) to load the XML file. It gives you a series of objects representing that data. It's then your job to look through the data structure you've been given, and use that information to create new objects as and when you see fit.

Pretty straightforward really.
I'd probably set up the XML a little differently.

<item stackable="0">
<type>weapon</type>
<slot>weapon</slot>
<name>longsword</name>
<icon file="weapons.dmi" state="longsword" />
<damage>2d2</damage>
</item>


But, to each his own.

Lummox JR