In one of my projects, I have some complex action integration where I have one ‘main action’ with two nouns, and some ‘helper actions’ with one noun that redirect onto the main action. This works perfectly, except for one small detail: Any rules that trigger of the main action happening for X turns don’t take into account when the main action was triggered by one of the helper actions. I suspect this is due the previous action variable being updated with the action that finished last. The following is a modified example that should illustrate the issue (it’s not my production code, but it’s the same functionality if not complexity):
[rant=Example]Volume 1 - Concepts
Book 1.1 - Cameras A camera is a kind of thing. A camera has a number called picture quality. Definition: a camera is sharp if its picture quality is 5 or more. Book 1.2 - Actions Part 1.2.1 - Photographing With Photographing it with is an action applying to one visible thing and one touchable thing and requiring light. Understand "photograph [something] with [something]" as photographing it with. Does the player mean photographing something with a camera: It is likely. Check an actor photographing something with (this is the photography requires camera rule): Unless the second noun is a camera: Say "You can hardly photograph without a camera, now can you?" (A); Stop the action; Check an actor photographing something with (this is the report photography rule): Say "[The actor] snaps a photo of [the noun] with [the second noun]." (A); Part 1.2.2 - Photographing Redirect Photographing is an action applying to one visible thing and requiring light. Understand "photograph [something]" as photographing. Before an actor photographing (this is the photography redirect rule): Let C be the sharpest camera which is carried by the actor; Try the actor photographing the noun with C instead; Volume 2 - Testing Book 2.1 - The World The Studio is a room. Sally is a woman in the Studio. A foam-lined tote bag is in the Studio. The digital SLR camera is a camera in the tote bag. The picture quality of the digital SLR camera is 10. The player carries a camera called the instant one-shot camera. The picture quality of the one-shot camera is 2. Book 2.2 - The Test Breaker Before photographing something with a camera for more than one turn, say "Try some variety for a change?" instead. Before photographing something with a camera for more than one time, say "Again?" Test me with "photograph Sally / g / photograph Sally with one-shot / g"[/rant]
Changing the redirect rule to ‘before’ or ‘instead’ gives the same result.
I’ve tried recreating the logic using various other methods, which have usually ended in “you have to supply a second noun” issues. Does anyone have a good idea on how to get around this without having to resort to intercepting and rearranging the command before it’s parsed?