Verb Menu - Adding/Subtracting Options
QuakerOatmealMan
24 Jul 2014, 19:12Hi, sorry if this is basic or has been answered before somewhere else, but I was wondering if anyone knew a way to make it so that when the game notices a flag that has been activated by the player, the selection of verbs available to them in the drop-down menu when the player selects the object changes?
For instance, in my game there is a rope leading underneath an object. If the player clicks on the rope they are given the options "look at" and "use" in the drop-down menu. But, after the player looks underneath the object and sees where the rope goes, I want to be able to add the verb "climb" to the list of verbs available to them.
Is there a way to do this without creating two separate robe objects, one with the verb "climb" and one without, and using a script to destroy the one rope and then immediately replace it with the new climbable one?
For instance, in my game there is a rope leading underneath an object. If the player clicks on the rope they are given the options "look at" and "use" in the drop-down menu. But, after the player looks underneath the object and sees where the rope goes, I want to be able to add the verb "climb" to the list of verbs available to them.
Is there a way to do this without creating two separate robe objects, one with the verb "climb" and one without, and using a script to destroy the one rope and then immediately replace it with the new climbable one?

jaynabonne
24 Jul 2014, 20:27Here is an example:
The "look" handler for the rope prints out the description. Also, the first time, it adds a "Climb" verb to the display verbs. That will show up both in the right-click menu for the rope and in the right pane.
The assignment of displayverbs to itself is a trick to get rope its own copy of the verbs, as it will have the ones in the base type. Otherwise, you can't add an item to it.
<object name="rope">
<inherit name="editor_object" />
<look type="script">
msg ("The rope leads down a dark hole.")
firsttime {
rope.displayverbs = rope.displayverbs
list add(rope.displayverbs, "Climb")
}
</look>
</object>
The "look" handler for the rope prints out the description. Also, the first time, it adds a "Climb" verb to the display verbs. That will show up both in the right-click menu for the rope and in the right pane.
The assignment of displayverbs to itself is a trick to get rope its own copy of the verbs, as it will have the ones in the base type. Otherwise, you can't add an item to it.
QuakerOatmealMan
24 Jul 2014, 20:34Thanks for this! I'll give it a try shortly.