Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002110Core InformActivitiespublic2019-10-06 21:242019-10-11 20:05
Assigned To 
Platformx86OSWindowsOS Version7
Product Version6M62 
Target VersionFixed in Version 
Summary0002110: Nested activities don't correctly handle arguments.
DescriptionActivities 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 InformationHere 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.
>x plant
On the tomato plant is an aphid.
Expert: An aphid is on the tomato plant.
You kill the tomato plant.
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
econrad (reporter)
2019-10-06 21:49
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".

zarf (developer)
2019-10-07 21:10

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.
econrad (reporter)
2019-10-11 20:05

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.

- Issue History
Date Modified Username Field Change
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
Powered by Mantis Bugtracker