you got your Attributes:
Object_name.Attribute_name = Value_or_Expression
String Attribute: Object_name.Attribute_name = "Value" // or: = Expression // (the textual~string parts require double quotes)
example 1: player.sex = "male"
example 2: game.greeting = "Hi, " + player.alias + ". You're going to lose, muwahaha! This game is very difficult!"
Object Attribute: Object_1_name.Attribute_name = Object_2_name // except 'true' and 'false', as these are reserved for Boolean Attribute's Values
example 1: player.right_hand = sword
example 2: player.parent = room
Boolean Attribute: Object_name.Attribute_name = false // or: true
example 1A: orc.dead = false
example: 1B: orc.dead = true
example 2A: player.flying = false
example 2B: player.flying = true
Integer Attribute: Object_name.Attribute_name = 5 // or whatever integer (non-decimal) number // or: = Expression
example 1: player.strength = 100
example 2: player.damage = player.claymore.damage + player.claymore.damage * player.strength / 100
Double (Float ~ Floating Point) Attribute: Object_name.Attribute_name = 5.00 // or whatever decimal number // or: = Expression
example 1: player.damage = 67.23
example 2: player.damage = player.claymore.damage + player.claymore.damage * player.strength / 100
Stringlist Attribute: Object_name.Attribute_name = split ("item~choice~option1;item~choice~option2;item~choice~option3;etc", ";")
example 1: global_data_object.sex_stringlist_attribute = split ("male;female", ";")
example 2: HK.favorite_colors_stringlist_attribute = split ("black;red", ";")
example 3: game.season_stringlist_attribute = split ("winter;spring;summer;autumn", ";")
example 4: player.condition_stringlist_attribute = split ("poisoned;confused", ";")
Objectlist Attribute: Object_name.Attribute_name = split ("item~choice~option1;item~choice~option2;item~choice~option3;etc", ";")
example:
weapon_shop.sword_objectlist_attribute = split ("short_sword;long_sword;broad_sword;claymore;katana;rapier;scimitar;cutlass;saber;machete;flamberge", ";")
<object name="short_sword">
</object>
<object name="long_sword">
</object>
<object name="broad_sword">
</object>
<object name="claymore">
</object>
<object name="katana">
</object>
<object name="rapier">
</object>
<object name="scimitar">
</object>
<object name="cutlass">
</object>
<object name="saber">
</object>
<object name="machete">
</object>
<object name="flamberge">
</object>
---------
to refer+check+act to~on them:
OPERATORS: '=', '>', '<', '<=', '>=', and ( '<>' or 'not xxx = xxx' )
(there is no '==', the '=' does both functionalities in quest: the engine handles the parsing for you)
if (Object_name.Attribute_name OPERATOR Value_or_Expression) {
Object_name.Attribute_name = Value_or_Expression
} else if (Object_name.Attribute_name OPERATOR Value_or_Expression) {
Object_name.Attribute_name = Value_or_Expression
} else {
Object_name.Attribute_name = Value_or_Expression
}
----------
Object Types:
http://docs.textadventures.co.uk/quest/ ... /type.htmlThe 'Object Type' Element holds Attributes and~or other Object Types. Think of it as a basket that holds eggs, so instead of giving each Object indivually each 'egg' (Attribute), you can instead give each Object the basket (Object Type):
<object name="player">
<attr name="locomotion_stringlist_attribute" type="simplestringlist">bipedal;standing</attr>
<attr name="condition_stringlist_attribute type="simplestringlist">alive;normal</attr>
<attr name="head_quantity_integer_attribute" type="int">1</attr>
<attr name="head_quantity_string_attribute" type="string">one</attr>
<attr name="arm_quantity_string_attribute" type="string">two</attr>
<attr name="arm_quantity_integer_attribute" type="int">2</attr>
<attr name="eye_quantity_integer_attribute" type="int">1</attr>
<attr name="eye_quantity_string_attribute" type="string">one</attr>
<attr name="skin_type_string_attribute" type="string">skin</attr>
</object>
<object name="orc">
<attr name="locomotion_stringlist_attribute" type="simplestringlist">bipedal;standing</attr>
<attr name="condition_stringlist_attribute type="simplestringlist">alive;normal</attr>
<attr name="head_quantity_integer_attribute" type="int">1</attr>
<attr name="head_quantity_string_attribute" type="string">one</attr>
<attr name="arm_quantity_string_attribute" type="string">two</attr>
<attr name="arm_quantity_integer_attribute" type="int">2</attr>
<attr name="eye_quantity_integer_attribute" type="int">1</attr>
<attr name="eye_quantity_string_attribute" type="string">one</attr>
<attr name="skin_type_string_attribute" type="string">skin</attr>
</object>
VS
<object name="player">
<inherit name="humanoid_object_type" />
</object>
<object name="orc">
<inherit name="humanoid_object_type" />
</object>
<type name="humanoid_object_type">
<attr name="locomotion_stringlist_attribute" type="simplestringlist">bipedal;standing</attr>
<attr name="condition_stringlist_attribute type="simplestringlist">alive;normal</attr>
<attr name="head_quantity_integer_attribute" type="int">1</attr>
<attr name="head_quantity_string_attribute" type="string">one</attr>
<attr name="arm_quantity_string_attribute" type="string">two</attr>
<attr name="arm_quantity_integer_attribute" type="int">2</attr>
<attr name="eye_quantity_integer_attribute" type="int">1</attr>
<attr name="eye_quantity_string_attribute" type="string">one</attr>
<attr name="skin_type_string_attribute" type="string">skin</attr>
</type>
-----------------------
to refer+check+act to~on them:
http://docs.textadventures.co.uk/quest/ ... herit.htmlexample (using the above example, and pretend I made 'animal' Object Type too):
if (DoesInherit (player, "humanoid_object_type")) {
msg ("You are a humanoid.")
} else if (DoesInherit (player, "animal_object_type")) {
msg ("You are an animal.")
} else {
msg ("You are an alien.")
}
and you can do as many layers deep as you want, and checking on both Object Type and its Attributes:
if (DoesInherit (monster_99, "humanoid_object_type")) {
if (monster_99.head_quantity_integer-attribute = 0) {
msg (monster_99.alias + " got decapitated by you.")
}
} else if (DoesInherit (monster_99, "animal_object_type")) {
if (monster_99.animal_type_string_attribute = "dog") {
if (monster_99.head_quantity_integer-attribute = 3) {
msg (monster_99.alias + " is the Kerberus of Greek Mythology.")
} else if (monster_99.head_quantity_integer-attribute = 1) {
msg (monster_99.alias + " is just an ordinary, but rabid, dog.")
}
} else if (monster_99.animal_type_string_attribute = "cat") {
msg (monster_99.alias + " is just an ordinary cat.")
}
} else {
msg (monster_99.alias + " is an alien.")
}