<object name="orc_1">
<alias>orc</alias>
</object>
<object name="orc_1">
<alias>orc</alias>
</object>
<object name="orc_2">
<alias>orc</alias>
</object>
<object name="claymore_object_1">
<alias>claymore</alias>
<attr name="type_of_object_string_attribute" type="string">sword</attr>
<attr name="two_handed_boolean_attribute" type="boolean">true</attr>
</object>
<object name="claymore_object_2">
<alias>claymore</alias>
<attr name="type_of_object_string_attribute" type="string">sword</attr>
<attr name="two_handed_boolean_attribute" type="boolean">true</attr>
</object>
<object name="lance_object_1">
<alias>lance</alias>
<attr name="type_of_object_string_attribute" type="string">spear</attr>
<attr name="two_handed_boolean_attribute" type="boolean">true</attr>
</object>
<object name="short_sword_object_1">
<alias>short sword</alias>
<attr name="type_of_object_string_attribute" type="string">sword</attr>
<attr name="two_handed_boolean_attribute" type="boolean">false</attr>
</object>
<object name="shield_object_1">
<alias>shield</alias>
<attr name="type_of_object_string_attribute" type="string">shield</attr>
</object>
<object name="unarmed_object_1">
<alias>unarmed</alias>
<attr name="type_of_object_string_attribute" type="string">unarmed</attr>
<attr name="two_handed_boolean_attribute" type="boolean">false</attr>
</object>
<object name="player">
<attr name="left_hand_object_attribute" type="object">unarmed_object_1</attr>
<attr name="right_hand_object_attribute" type="object">unarmed_object_1</attr>
</object>
<command name="equip_command">
<pattern>equip #text#</pattern>
<script>
temporary_stringlist_variable = NewStringList ()
equipment_variable = GetObject (text)
if (equipment_variable = null) {
foreach (object_variable, AllObjects()) {
if (object_variable.alias = text) {
list add (temporary_stringlist_variable, object_variable.name)
}
}
if (temporary_stringlist_variable = null) {
show menu ("What equipment item did you mean~want?", temporary_stringlist_variable, false) {
equipment_variable = GetObject (result)
}
}
}
if (equipment_variable = null) {
msg ("Wrong input, try again.")
} else {
if (Got (equipment_variable.name)) {
if (equipment_variable.type_of_object_string_attribute = "sword") {
if (equipment_variable.two_handed_boolean_attribute = true) {
player.left_hand_object_attribute = equipment_variable.name
player.right_hand_object_attribute = equipment_variable.name
} else if (equipment_variable.two_handed_boolean_attribute = false) {
player.right_hand_object_attribute = equipment_variable.name
}
} else if (equipment_variable.type_of_object_string_attribute = "shield") {
player.left_hand_object_attribute = equipment_variable.name
}
// etc else ifs
} else {
msg ("You don't have this equipment item in your inventory, and thus you can't equip what you don't have, silly. Try again.")
}
}
</script>
</command>
horizontally:
<object name="xxx">
<alt type="simplestringlist">xxx1;xxx2;xxx3;etc</alt>
</object>
or vertically:
<object name="xxx">
<alt type="stringlist">
<value>xxx1</value>
<value>xxx2</value>
</alt>
</object>
foreach (obj, objects) {
if (not DictionaryContains(dictionary, obj.name) and not obj.scenery) {
dictionary add (dictionary, obj.name, GetDisplayAlias(obj))
}
}
And with many there, it just gets really messy. Also, if I'm making puzzles in the game, I'd rather not have the menu of options pop up but for people to have to type in specifically which thing they mean themselves.
HegemonKhan wrote:
lastly...
all those names under~as~in the 'alias' String Attribute box shouldn't be there, instead do this:
'whatever' Object -> 'Object' Tab -> 'other names' box -> add -> (and add all those names here instead)
The Pixie wrote:A partial solution is to modify the GenerateMenuChoices function.foreach (obj, objects) {
if (not DictionaryContains(dictionary, obj.name) and not obj.scenery) {
dictionary add (dictionary, obj.name, GetDisplayAlias(obj))
}
}
I cannot guarantee this will not have other effects, but I think it is safe. I say partial solution as it will still bring up a menu if there is only one item that is not scenery so is not ideal.And with many there, it just gets really messy. Also, if I'm making puzzles in the game, I'd rather not have the menu of options pop up but for people to have to type in specifically which thing they mean themselves.
Be careful ghere. There is an issue here that the player may not realise he has to do that, and might give up trying to get the specific item when he gets another instead.
msg ("Ah, you notice a {command:read janes book:book} out of place...")
<command name="read">
<pattern>read #text#</pattern>
<script>
if (text = "janes book") {
// blah scripting
}
</script>
</command>
if (tv.switchedon) {
msg ("You watch for a bit, and then turn off the tv.")
tv.switchedon=false
} else if (not tv.switched) {
msg ("You turn on the tv and watch for a bit.")
tv.switchedon=true
}
if (tv.switchedon=true) {
msg ("You watch for a bit, and then turn off the tv.")
tv.switchedon=false
} else if (tv.switched=false) {
msg ("You turn on the tv and watch for a bit.")
tv.switchedon=true
}
adammadam wrote:The problem I have is that I have a lot of scenery objects in the room which have many aliases so it actually says:
2. david sword, david's sword, david weapon, david's weapon etc etc for everything I could think of, and when it pops up it looks really messy.