Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000177Core InformActionspublic2010-07-05 09:432010-10-28 00:30
Assigned Tograham 
Platformx86OSWindowsOS Version7
Product Version6E72 
Target VersionFixed in Version6F95 
Summary0000177: using action variables in past tense causes run-time errors
DescriptionIf you use an action variable in a condition that involves the past tense, the game will throw out a run-time error: "Variable unavailable for this action, activity or rulebook: internal ID number [some number]."

This error will occur at the end of every turn no matter what action the player takes. The game continues, and Inform does not acknowledge the error's occurence (as it usually does, putting up an explanation in the other half of the IDE).
Minimal Source Text To Reproduce
The Driveway is a room. An open vehicle called your car is here. An animal called your overeager 
Boston terrier is here.

After an actor exiting from your car:
	if the actor is the player:
		say "You get out of the car [if the terrier is in the container exited from]. [run paragraph on][otherwise].";
if your terrier is in the container exited from, try your terrier trying exiting;
		say "Your terrier jumps out [if yourself is not in the container exited from and yourself was 
in the container exited from]too.[otherwise]of the car, wagging its tail."
Additional InformationNote that in the above example, you can easily work around the problem by changing the past tense condition to "yourself was in your car." However, one can also easily imagine wanting to extend the rule so that it worked whenever the player exits *any* car, in which case you would want to use the variable "container exited from" instead of a specific object name.

Now, I'm not suggesting that the solution is to allow action variables to be referred to in the past tense. (That would be nice, of course, but I suspect there's a good reason that it causes problems.) What I do suggest is that the error message be made clearer -- and make it a compile-time error if possible, so that the problem is easier to hunt down and fix. I believe that the compiler will generate a problem message if the source refers to a temporary variable in the past tense; I think it should do the same for action variables.
TagsNo tags attached.
Effect(mild) Compiler accepts invalid code
Attached Files

- Relationships

-  Notes
EmacsUser (manager)
2010-07-05 14:57

Mantis is presenting the source code indentation incorrectly, and I am not sure why.
EmacsUser (manager)
2010-07-05 15:35
edited on: 2010-07-05 15:40

When you say ``yourself was in the container exited from,'' that tests whether the condition ``yourself is in the container exited from'' held during last turn's run of the update chronological records rule. There's no action going on at that time, and per WI 12.10, ``This value is created when the action begins, and disappears when the action ends.'' (Even if it did exist, it would be the container exited from on the last turn, not the turn when the condition is evaluated, supposing, of course, that the previous action was also an exit.)

After some thought, I think that it's reasonable to expect Inform to catch such code with a compile-time error.

graham (administrator)
2010-09-29 06:58

I agree: Inform should treat this exactly as it does references to local variables in the past tense, and this is now what happens - there is a compile-time Problem message.

- Issue History
Date Modified Username Field Change
2010-07-05 09:43 mikegentry New Issue
2010-07-05 12:42 jmcgrew Status new => acknowledged
2010-07-05 14:56 EmacsUser Steps to Reproduce Updated View Revisions
2010-07-05 14:57 EmacsUser Note Added: 0000241
2010-07-05 15:35 EmacsUser Note Added: 0000242
2010-07-05 15:40 EmacsUser Note Edited: 0000242 View Revisions
2010-07-05 15:40 EmacsUser Status acknowledged => confirmed
2010-09-29 06:58 graham Note Added: 0000620
2010-09-29 06:58 graham Status confirmed => resolved
2010-09-29 06:58 graham Resolution open => fixed
2010-09-29 06:58 graham Assigned To => graham
2010-10-25 21:14 jmcgrew Fixed in Version => 6F95
2010-10-28 00:30 jmcgrew Status resolved => closed

Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker