Hide/Show Verb Syntax

Hi all! I just wanted to know if this is the correct usage for hiding and showing verbs. For example, if a player picks up a weapon and doesn't have it equipped, I would like the equip verb to appear, and once holding the weapon, I want only the unequip verb to appear.

So I was curious if this was the correct format on the "weapon type".

equip.verb.visible=False?

Ugh. That doesn't look right. @_@


It is not right. Verbs are in a string list attribute, so you are adding and removing words from the list.

list add (weapon.inventoryverbs, "equip")
list remove (weapon.inventoryverbs, "unequip")

don't forget to do this before changing inventoryverbs:

weapon.inventoryverbs = weapon.inventoryverbs

complete code:

weapon.inventoryverbs = weapon.inventoryverbs
list add (weapon.inventoryverbs, "equip")
list remove (weapon.inventoryverbs, "unequip")

same can be done with displayverbs


as has been stated, the displayment of Verbs is controlled by the built-in/special:

'displayverbs' and/or 'inventoryverbs' String List Attributes

http://docs.textadventures.co.uk/quest/asl_requirements.html (very briefly mentioned here, lol)

Pixie has a great guide on using/working-with these (check library and code sample forum board)


Thanks Pix, Pertex and Hk! ^_^ I appreciate the help!

Anonynn.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums