I can think you can do it via these methods (I don't know Pixie's Library, as to what Verb Functions he/she has created for use in it):
1. Turnscript (err, this doesn't use the Object to check itself though, as a 'Turnscript' Element/OBJECT is not an/the 'Object' Element/OBJECT, lol)
~ OR ~
2. the special 'changed' Script Attribute (this does use the Object itself):
http://docs.textadventures.co.uk/quest/ ... anges.html (this explains how it's done via the GUI~Editor)
you simply create a Script Attribute with this name syntax: changedYOUR_ATTRIBUTE'S_NAME
what this does is:
when the Value of "YOUR_ATTRIBUTE'S_NAME" (whatever the Attribute Type) Attribute changes, it'll do/run the scripts you've added to this 'changed' Script Attribute
for example:
<object name="player">
<attr name="current_life_integer_attribute" type="int">999</attr>
<attr name="maximum_life_integer_attribute" type="int">999</attr>
<attr name="life_string_attribute" type="string">999/999</attr>
<attr name="statusattributes" type="simplestringdictionary">life_string_attribute = Life: !</attr>
<attr name=changedcurrent_life_integer_attribute" type="script">
if (this.current_life_integer_attribute <= 0) {
msg ("You died or were killed.")
msg ("GAME OVER")
finish
} else if (this.current_life_integer_attribute > this.maximum_life_integer_attribute) {
this.current_life_integer_attribute = this.maximum_life_integer_attribute
}
this.life_string_attribute = this.current_life_integer_attribute + "/" + this.maximum_life_integer_attribute
</attr>
<attr name=changedmaximum_life_integer_attribute" type="script">
this.life_string_attribute = this.current_life_integer_attribute + "/" + this.maximum_life_integer_attribute
</attr>
</object>
-------------
an example:
// you need some kind of scripting to check if the 'whatever' Object contains the 'pen' Object (and/or when you 'take' the 'pen' Object), to set the 'has_pen_boolean_attribute' to 'true', if applicable, and also the reverse too, if no pen (and/or using 'drop' Verb), then to 'false' again.
<object name="player">
<attr name="has_pen_boolean_attribute" type="boolean">false</attr>
<attr name="changedhas_pen_boolean_attribute" type="script">
if (this.has_pen_boolean_attribute and not ListContains (action_button.inventoryverbs, "autograph")) {
list add (action_button.inventoryverbs, "autograph")
} else if (not this.has_pen_boolean_attribute and ListContains (action_button.inventoryverbs, "autograph")) {
list remove (action_button.inventoryverbs, "autograph")
}
</attr>
</object>
<object name="action_button">
<attr name="alias" type="string">actions</attr>
<attr name="parent" type="object">player</attr>
<attr name="autograph" type="script">
// your scripting for doing your autographing of whatever
</attr>
</object>
<verb>
<property>autograph</property>
<pattern>autograph</pattern>
<defaultexpression>You can't autograph that!</defaultexpression>
</verb>