Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000032Core InformPhrases and functional programmingpublic2010-06-14 12:412010-07-01 23:07
ReporterJuhana 
Assigned Tograham 
PrioritynormalSeveritymildReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSMac OS XOS Version10.6
Product Version6E59 
Target VersionFixed in Version6E72 
Summary0000032: Testing "if the player was on the holder of the player" always returns true during the first turn
DescriptionWhen testing whether the the player was on the holder of the player (e.g. a chair) returns true every time during the first turn, even if the player just climbed on the chair. Testing the chair directly works, and testing holder of the player works as expected after the first turn. This doesn't seem to affect other objects (in the example code the ball behaves as expected.)
Minimal Source Text To Reproduce
The lab is a room.
A chair is an enterable supporter in the lab.
The player carries a ball.

Every turn:
	if the holder of the player is the chair:
		say "Testing holder of the player (chair): ";
		if the player was on the holder of the player:
			say "The player was on the chair last turn.";
		otherwise:
			say "The player was NOT on the chair last turn.";
		say "Testing chair directly: ";
		if the player was on the chair:
			say "The player was on the chair last turn.";
		otherwise:
			say "The player was NOT on the chair last turn."
			

Every turn:
	if the holder of the ball is the chair:
		say "Testing holder of the ball (chair): ";
		if the ball was on the holder of the ball:
			say "The ball was on the chair last turn.";
		otherwise:
			say "The ball was NOT on the chair last turn.";
		say "Testing chair directly: ";
		if the ball was on the chair:
			say "The ball was on the chair last turn.";
		otherwise:
			say "The ball was NOT on the chair last turn."
			


Test me with "get on chair/z/get off chair/z/get on chair/z". [doesn't work]
Test ball with "put ball on chair/z/get ball/z/put ball on chair/z". [works]
Additional InformationBehaves the same on 5Z71 as well.
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships
related to 0000187closedgraham Game produces a nonrunning version when a scene begins based on a room "enclosing" a player 

-  Notes
(0000048)
EmacsUser (manager)
2010-06-18 16:55
edited on: 2010-06-20 15:11

The startup rules put the update chronological records rule immediately before the position player in model world rule, so, technically speaking, the player was on the holder of the player beforehand (the player's support and holder were both nothing when the update happened). Note that, as the documentation cautions, ``player was on the holder of the player'' refers to the previous holder of the player (nothing), not the current holder (chair).

A workaround for this example is to include the code:

The update chronological records rule is listed after the position player in model world rule in the startup rules.

To me this reordering is more intuitive---I would expect the player to be in their initial location on turn zero, not in nothing. However, I don't know the startup rules well enough to tell if such a change will have other, unintended consequences.

In any case, these particulars should be documented in 9.13. At present ``was'' is defined in terms of the most recent action; perhaps the behavior is intentionally undefined when there is no most recent action?

(0000102)
graham (administrator)
2010-06-20 16:08

This is a very obscure bug, since it affects only "holder of the player", and only when the past tense is used to talk about the pre-first-turn world, and in any case I tend to think one should not rely on past history before the world has got going.

However, I have fixed it. Juhana's proposed solution of transposing the startup rules is tempting, but to quote the published commentary on the Standard Rules:

(d) The ``update chronological records rule'' is described in further detail
below, since it appears both here and also in the turn sequence rulebook.
Here it's providing us with a baseline of initial truths from which we can
later assess conditions such as ``the marble door has been open''. A subtle
and questionable point of the design is that this rule is placed at a time
when the object representing the player is not present in the model world.
This is done to avoid regarding the initial situation as one of the turns
for purposes of a rule preamble like ``... when the player has been in the
Dining Room for three turns''. It's as if the player teleports into an
already-existing world, like some Star Trek crewman, just in time for the
first command.

...So that isn't the fix I've used.

- Issue History
Date Modified Username Field Change
2010-06-14 12:41 Juhana New Issue
2010-06-14 17:08 jmcgrew Status new => acknowledged
2010-06-18 16:55 EmacsUser Note Added: 0000048
2010-06-18 16:55 EmacsUser Status acknowledged => confirmed
2010-06-20 15:11 EmacsUser Note Edited: 0000048 View Revisions
2010-06-20 16:08 graham Note Added: 0000102
2010-06-20 16:08 graham Status confirmed => resolved
2010-06-20 16:08 graham Resolution open => fixed
2010-06-20 16:08 graham Assigned To => graham
2010-06-30 18:07 jmcgrew Fixed in Version => 6E72
2010-07-01 23:07 jmcgrew Status resolved => closed
2010-07-08 14:52 EmacsUser Relationship added related to 0000187


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker