|Anonymous | Login | Signup for a new account||2020-07-07 12:50 PDT|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002110||Core Inform||Activities||public||2019-10-06 21:24||2019-10-11 20:05|
|Target Version||Fixed in Version|
|Summary||0002110: Nested activities don't correctly handle arguments.|
|Description||Activities aren't picking up the argument (aka "the noun") correctly.|
In the example, the exterminating activity is being carried out with "the troublemaker" (i.e. a pest, specifically the aphid). But the after exterminating rule kills the tomato plant instead of the aphid.
Note that the analysing activity is correctly parsing its arguments ("noun" and "troublemaker", but the exterminating activity is getting the wrong argument.
|Minimal Source Text To Reproduce|
The garden is a room. A plant is a kind of supporter. A pest is a kind of thing. The tomato plant is a plant in the garden. The aphid is a pest on the tomato plant. Analysing something is an activity. Exterminating something is an activity. After analysing a plant when a pest (called the troublemaker) is on the noun: say "Expert: [A troublemaker] is on [the noun]."; carry out the exterminating activity with the troublemaker. After exterminating something: say "You kill [the noun]."; now the noun is nowhere. After examining a plant when a pest is on the noun: carry out the analysing activity with the noun.
|Additional Information||Here is the output:|
Release 1 / Serial number 191006 / Inform 7 build 6M62 (I6/v6.33 lib 6/12N) SD
You can see a tomato plant (on which is an aphid) here.
On the tomato plant is an aphid.
Expert: An aphid is on the tomato plant.
You kill the tomato plant.
|Tags||No tags attached.|
|Effect||(serious/mild) Game compiles but misbehaves|
edited on: 2019-10-06 21:51
We get the same behavior if we declare plants as containers and change the occurrences of "on" to "in".
I'm afraid this is a misunderstanding. Activities do *not* apply to "the noun" -- that refers to part of the player's action. The argument of an activity has no universal name. You have to give it a "called" name to refer to it:
After analysing a plant (called P) when a pest (called the troublemaker) is on P: say "Expert: [A troublemaker] is on [the P]."; carry out the exterminating activity with the troublemaker. After exterminating something (called P): say "You kill [the P]."; now P is nowhere.
Thanks, Zarf. That wasn't clear to me from the documentation in Section 18.5.
(But after a second look, I do see that one rule in the text and various rules in the examples do declare names for the parameters.) Section 18.6 doesn't apply here as it explains "activity variables", but those are local variables, not parameter variables.
Perhaps Section 18.5 of the documentation (i.e. "Writing with Inform") needs some clarification.
|2019-10-06 21:24||econrad||New Issue|
|2019-10-06 21:49||econrad||Note Added: 0004878|
|2019-10-06 21:51||econrad||Note Edited: 0004878||View Revisions|
|2019-10-07 21:10||zarf||Note Added: 0004879|
|2019-10-11 20:05||econrad||Note Added: 0004882|
|Copyright © 2000 - 2010 MantisBT Group|