Strange xml error when loading

duggold
10 Jun 2012, 17:57
Below is my .aslx. I get a strange xml error when loading complaining about a name having a space. I don't see any issues with the.aslx. Anyone reproduce this with the code below and have a clue?

SOLVED: Needed to use !CDATA tags since I use < and >. Left the post in case someone else runs into the issue.

<!--Saved by Quest 5.2.4515.34846-->
<asl version="520">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="wearables.aslx" />
<game name="Hack and Slash">
<gameid>9bbe53c0-da1d-49f6-bed2-42f64d08cf3c</gameid>
<version>1.0</version>
<showscore type="boolean">false</showscore>
<showhealth type="boolean">false</showhealth>
<autodescription_youcansee type="int">3</autodescription_youcansee>
<autodescription_youcango type="int">4</autodescription_youcango>
<autodescription_description type="int">2</autodescription_description>
<hitpoints type="int">100</hitpoints>
<expneeded type="int">1000</expneeded>
<gold type="int">100</gold>
<level type="int">1</level>
<tohit type="int">0</tohit>
<basedamage type="int">1</basedamage>
<randomdamage type="int">3</randomdamage>
<defense type="int">0</defense>
<ai_list type="stringdictionary"></ai_list>
<statusattributes type="stringdictionary">hitpoints = Hit Points: !;level = Current Level: !;expneeded = Experience needed for next level: !;gold = Gold: !;randomdamage = Damage: 1-!;basedamage = * +!</statusattributes>
</game>
<object name="Room 1">
<inherit name="editor_room" />
<description>You are in room 1</description>
<object name="player">
<inherit name="defaultplayer" />
</object>
<exit alias="north" to="Room 2">
<inherit name="northdirection" />
</exit>
</object>
<object name="ogre">
<inherit name="editor_object" />
<visible type="boolean">false</visible>
<speed type="int">20</speed>
<last_seen type="int">0</last_seen>
<chance_to_hit type="int">30</chance_to_hit>
<damage_base type="int">4</damage_base>
<damage_random type="int">6</damage_random>
<look>The ogre is mean looking!</look>
</object>
<object name="Room 2">
<inherit name="editor_room" />
<description>You are in room 2</description>
<enter type="script">
random_monster (50, ogre)
</enter>
<object name="Plate Armor">
<inherit name="editor_object" />
<inherit name="wearable" />
<look>Heavy armor made of interlocking pieces of metal. Offers superior protection</look>
<take />
<wear_slots type="list">chest</wear_slots>
<inventoryverbs>Look at; Drop; Wear; Remove</inventoryverbs>
<usedefaultprefix type="boolean">false</usedefaultprefix>
</object>
<object name="Chain Mail">
<inherit name="editor_object" />
<inherit name="wearable" />
<wear_slots type="list">chest</wear_slots>
<take />
</object>
<exit alias="south" to="Room 1">
<inherit name="southdirection" />
</exit>
</object>
<function name="AddStatusAttributesForElement" parameters="status, element" type="string"><![CDATA[
if (element.statusattributes <> null) {
foreach (attr, element.statusattributes) {
z = FormatStatusAttribute(attr, GetAttribute(element, attr), StringDictionaryItem(element.statusattributes, attr))
if (LengthOf(status) > 0) {
if (Left(z,1) <> "*") {
status = status + "\n"
}
}
if (Left(z,1) = "*") {
z = Right(z,LengthOf(z) - 1)
}
status = status + z
}
}
return (status)
]]></function>
<function name="monster_attack" parameters="our_monster">
msg ("You see a " + our_monster.name + " attack!")
if (DictionaryContains(game.ai_list,our_monster.name)) {
dictionary remove (game.ai_list, our_monster.name)
}
dictionary add (game.ai_list, our_monster.name, ToString(game.timeelapsed + y.speed))
</function>
<function name="random_monster" parameters="chance, monster_name">
msg ("Checking for random monster with chance " + ToString(chance))
if (RandomChance(chance)) {
y = CloneObject(monster_name)
y.parent = player.parent
MakeObjectVisible (y)
if (DictionaryContains(game.ai_list,y.name)) {
dictionary remove (game.ai_list, y.name)
}
msg ("You see a " + y.alias + " enter the room!")
dictionary add (game.ai_list, y.name, ToString(game.timeelapsed + y.speed))
}
</function>
<function name="the_ai">

if (1 <> 0) msg("none to check")

</function>
<timer name="testit">
<interval>5</interval>
<script>
the_ai
</script>
<enabled />
</timer>
</asl>