Can Examine or Whatever



Allows a script to take control of the 'EXAMINE' option in the 'VIEW/ITEMS' menu. You can cause the option to appear or not appear and you can rename the option and its 'Hot-Key'.

When an item is selected in the 'VIEW/ITEMS' menu, and that item has a non-empty “Examine Label” defined, then this hook will be called to determine whether the 'EXAMINE' option should be offered to the player and what that option should be named. For example, the hook might suppress the option entirely if the character carrying it is a Dwarf. Or the hook might allow the option but instead of using the 'Examine Label' as defined in the editor it might display “Ignite” as the menu option if the moon is in the seventh house.



Context



Character – The character being viewed

Item – the selected item



Return Value

If the hook returns a value starting with 'Y' then the option will be displayed and the final value of hook parameter[5] will be used a the option's text. Any other non-empty return value will result in the option being suppressed.



Hook Parameters



Hook parameter[4] is set to the index of the item in the character's inventory.

Hook parameter[5] is set to the item's 'Examine Label' as defined in the editor. If the menu option is displayed, then the final value of hook parameter[5] will define the option's text.

Hook parameter [6] defines the 'Hot-Key' for the menu option. It is the index ( 0, 1, 2, …) of the letter within the menu option text. Setting it to -1 will suppress any hot-key.