From: Jason Self Date: Sun, 2 Jun 2019 16:31:43 +0000 (-0700) Subject: Add Verbs and Actions X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=35c3c337689ee792b9f708c5d3ace5d133736cf1;p=inform-resources.git Add Verbs and Actions --- diff --git a/informqr/informqr.md b/informqr/informqr.md index 40a9fad..490805c 100644 --- a/informqr/informqr.md +++ b/informqr/informqr.md @@ -520,4 +520,61 @@ To assign to one of 32 'low string' variables: string N "string"; Lowstring string_var "string"; - string N string_var; \ No newline at end of file + string N string_var; + +Verbs and Actions +----------------- + +To specify a new verb: + + Verb 'verb ' 'verb ' ... 'verb ' + * token token ... token -> action + * token token ... token -> action + ... + * token token ... token -> action; + +where instead "`Verb`" can be "`Verb meta`", "*action*" can be +"`action reverse`"; *tokens* are optional and each is one of: + + ----------------- ---------------------------------------------- + 'word' that literal word + 'w1'/'w2'/... any one of those literal words + attribute an object with that attribute + creature an object with `animate` attribute + held an object held by the player + noun an object in scope + noun=`routine` an object for which *routine* returns `true` + scope=`routine` an object in this re-definition of scope + multiheld one or more objects held by the player + multi one or more objects in scope + multiexcept as multi, omitting the specified object + multiinside as multi, omitting those in specified object + topic any text + number any number + routine a general parsing routine + ----------------- ---------------------------------------------- + +To add synonyms to an existing verb: + + Verb 'verb ' 'verb ' ... = 'existing_verb'; + +To modify an existing verb: + + Extend 'existing_verb ' last + * token token ... token –> action + * token token ... token –> action + ... + * token token ... token –> action ; + +where instead "`Extend`" can be "`Extend only`" and "`last`" can be +omitted, or changed to "`first`" or "`replace`" + +To explicitly trigger a defined action (both *noun* and *second* are +optional, depending on the action): + + ; + +To explicitly trigger a defined action, then return `true` from the +current routine: + + <>; \ No newline at end of file