Marzipan wrote:"OurJud"
The thing with setting verbs is you're limited to one word.
If there was just a way to set aliases I'd probably use them a lot more.
Marzipan wrote:No, I meant aliases for the verbs. Say I've got a pinata object, with a command I can let the player break, smash, or hit it, but with verbs I'm limited to just one.
As far as object aliases, the most use I've gotten out of them is when Quest won't let me name a room properly, I can still have it show up to the player the way I want with an alias.
// Object ('Name' String Attribute): player
// Object 'Alias' String Attribute: HK
<command name="hi_command">
<pattern>hi #text#</pattern>
<script>
msg ("hi, " + text.name + ".")
// outputs: hi, player.
</script>
</command>
<command name="hi_command">
<pattern>hi #object#</pattern>
<script>
msg ("hi, " + object.alias + ".")
// outputs: hi, player.
</script>
</command>
<command name="hi_command">
<pattern>hi #text#</pattern>
<script>
msg ("hi, " + text.alias + ".")
// outputs: hi, HK.
</script>
</command>
<command name="hi_command">
<pattern>hi #object#</pattern>
<script>
msg ("hi, " + object.name + ".")
// outputs: hi, HK.
</script>
</command>
// -----------------------
// Object ('Name' String Attribute): player
<command name="hi_command">
<pattern>hi #text#</pattern>
<script>
msg ("hi, " + text.name + ".")
// outputs: hi, player.
</script>
</command>
<command name="hi_command">
<pattern>hi #object#</pattern>
<script>
msg ("hi, " + object.alias + ".")
// outputs: ERROR!
</script>
</command>
<command name="hi_command">
<pattern>hi #text#</pattern>
<script>
msg ("hi, " + text.alias + ".")
// outputs: ERROR!
</script>
</command>
<command name="hi_command">
<pattern>hi #object#</pattern>
<script>
msg ("hi, " + object.name + ".")
// outputs: hi, HK.
</script>
</command>
// -------------------
// Object ('Name' String Attribute): player
// Object 'Alias' String Attribute: HK
// but the person playing the game, doesn't know that the Object's 'name' is 'player', they're only able to thus type in: 'HK'
<command name="hi_command">
<pattern>hi #text#</pattern>
<script>
// user types in: HK
object_x = GetObject (text)
msg ("hi, " + object_x.name + ".")
// outputs: ERROR, as there is no Object (NAMED) 'HK'
</script>
</command>
<command name="hi_command">
<pattern>hi #text#</pattern>
<script>
// user types in: HK
object_x = GetObject (text)
if (object_x = null) {
foreach (object_xx, AllObjects () ) {
if (object_xx.alias = text) {
object_x = object_xx
}
}
}
if (not object_x = null) {
msg ("hi, " + object_x.name + ".")
// outputs: hi, player.
}
</script>
</command>
Marzipan wrote:No, I meant aliases for the verbs. Say I've got a pinata object, with a command I can let the player break, smash, or hit it, but with verbs I'm limited to just one.
As far as object aliases, the most use I've gotten out of them is when Quest won't let me name a room properly, I can still have it show up to the player the way I want with an alias.
The Pixie wrote:The advantage of verbs is that you do not have to worry about whether the action is applicable to the object. For example, you can set a SMASH verb for an item, and in the script you know what the item is. If you use a command, you first have to check if the item is smashable. It is not a big deal really. Where verbs become really good is when you make up your own types, but you might want to wait a while before looking at that.
The Pixie wrote:Verbs do not have a list like that, but you can still have multiple words, you just separate them with a semi-colon in the first text box (i.e., the unlabelled one above attribute).
Let's say I have a vase, and on that vase I set a command pattern of 'smash vase; break vase; throw vase' which runs a script describing the action of smashing it, how are you saying it would be done better with a verb?
OurJud wrote:"The Pixie"
The advantage of verbs is that you do not have to worry about whether the action is applicable to the object. For example, you can set a SMASH verb for an item, and in the script you know what the item is. If you use a command, you first have to check if the item is smashable. It is not a big deal really. Where verbs become really good is when you make up your own types, but you might want to wait a while before looking at that.
I'm struggling to get my head around that one. Why does using a verb mean you don't have to check if the item is smashable?
Let's say I have a vase, and on that vase I set a command pattern of 'smash vase; break vase; throw vase' which runs a script describing the action of smashing it, how are you saying it would be done better with a verb?
<game name="xxx">
</game>
<object name="room">
<object name="player">
<object name="potion_storage_object">
</object>
<object name="sword_storage_object">
</object>
<object name="axe_storage_object">
</object>
<object name="food_storage_object">
</object>
</object>
</object>
<command name="godtake_command">
<pattern>godtake</pattern>
<script>
foreach (object_x, AllObjects ()) {
if (not object_x.parent = player) {
if (object_x.type_string = "potion") {
object_x.parent = potion_storage_object
} else if (object_x.type_string = "sword") {
object_x.parent = sword_storage_object
} else if (object_x.type_string = "axe") {
object_x.parent = axe_storage_object
} else if (object_x.type_string = "food") {
object_x.parent = food_storage_object
}
// you get the idea...
}
}
</script>
</command>
<game name="xxx">
</game>
<object name="room">
<object name="player">
</object>
</object>
<command name="godverb_command">
<pattern>godverb</pattern>
<script>
foreach (object_x, AllObjects ()) {
if (object_x.type_string = "potion") {
invoke (object_x.drink)
} else if (object_x.type_string = "sword") {
invoke (object_x.equip)
} else if (object_x.type_string = "axe") {
invoke (object_x.unequip)
} else if (object_x.type_string = "food") {
invoke (object_x.eat)
}
// you get the idea...
}
</script>
</command>
OurJud wrote:"The Pixie"
The advantage of verbs is that you do not have to worry about whether the action is applicable to the object. For example, you can set a SMASH verb for an item, and in the script you know what the item is. If you use a command, you first have to check if the item is smashable. It is not a big deal really. Where verbs become really good is when you make up your own types, but you might want to wait a while before looking at that.
I'm struggling to get my head around that one. Why does using a verb mean you don't have to check if the item is smashable?
Let's say I have a vase, and on that vase I set a command pattern of 'smash vase; break vase; throw vase' which runs a script describing the action of smashing it, how are you saying it would be done better with a verb?