There's probably a grammar-based solution (especially if you use Roodylib's GRAMMAR_HELPER stuff), and actually, that is probably the easiest way to deal with it.
Still, if you want to avoid grammar-tampering, another way to do it is to replace the ExcludeFromAll routine:
Making sure it always returns true when the parent is living gets the player a "Nothing to get." message when he tries >GET ALL FROM <character>. To change this, we'll need to add a case to NewParseErrror:replace ExcludeFromAll(obj){if obj is hiddenreturn true! Exclude things NPCs are carrying unless the NPC is explicitly! given as the parentif parent(obj) is living{! if IsPossibleXobject(parent(obj)) or parent(obj) = player! return falsereturn true}return false}
replace NewParseError(errornumber,obj)
{
select errornumber
case 9
{
if xobject is living and children(xobject)
{
"You will have to specify one object at a time."
return true
}
else
return false
}
case else : return false
return true
}So yeah, that's that. To do more complicated behavior, like allowing the first item but not allowing the rest, I'd probably incorporate the use of a global or, more likely, the word array (with SaveWordSetting and CheckWordSetting), but that scenario is unlikely enough that I won't put it together unless I need it myself or someone asks for it.
No comments:
Post a Comment