|Anonymous | Login | Signup for a new account||2018-06-20 23:30 PDT|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000032||Core Inform||Phrases and functional programming||public||2010-06-14 12:41||2010-07-01 23:07|
|Platform||x86||OS||Mac OS X||OS Version||10.6|
|Target Version||Fixed in Version||6E72|
|Summary||0000032: Testing "if the player was on the holder of the player" always returns true during the first turn|
|Description||When 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 Information||Behaves the same on 5Z71 as well.|
|Tags||No tags attached.|
|Effect||(serious/mild) Game compiles but misbehaves|
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?
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
...So that isn't the fix I've used.
|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|