Things which are pushable between rooms are not described on the same turn they are pushed, as I was expecting them to be. A minimal example is:
"Push Toy" by Mike
The story headline is "An Interactive Mystery"
The Main Room is south of the Other Room. "Test 1."
The Other Room is a room. "Test 2."
The toy is a thing in Main Room.
The toy is pushable between rooms.
Running this example through the Linux IDE gives this output:
Push Toy
An Interactive Mystery by Mike
Release 1 / Serial number 211203 / Inform 7 build 6M62 (I6/v6.33 lib 6/12N) SD
Main Room
Test 1.
You can see a toy here.
>push toy n
Other Room
Test 2.
>look
Other Room
Test 2.
You can see a toy here.
where I was expecting to see the toy described in both âOther Roomâ descriptions, not just the second. It is present in the first turn, though - showme or examine can see it. This is the smallest example I could pare it down to, but itâs not specific to it - the same behaviour can for example be seen in Disenchantment Bay 12 (with the ice chest).
Is this intended behaviour? If so, can anyone recommend a way to get a pushable thing that announces itself each time it is pushed into a new room?
I think this could be considered a bug. The Pushing it to action gets converted to the I6 routine:
[ ConvertToGoingWithPush i oldrm newrm infl;
i=noun;
if (IndirectlyContains(noun, actor) == false) { move i to actor; infl = true; }
move_pushing = i;
oldrm = LocationOf(noun);
BeginAction(##Go, second);
newrm = LocationOf(actor);
move_pushing = nothing; move i to newrm;
if (newrm ~= oldrm) {
if (IndirectlyContains(i, player)) TryAction(0, player, ##Look, 0, 0);
RulebookSucceeds();
} else RulebookFails();
rtrue;
];
So the Going action is complete before the item is actually considered to be in the new room. And the look that actually happens is part of the Going action; the IndirectlyContains is false.
The following makes this case look better:
report going when the item-pushed-between-rooms is not nothing:
say "[The actor] [push] [the item-pushed-between-rooms]."
After going when the item-pushed-between-rooms is not nothing:
move the item-pushed-between-rooms to the location;
continue the action.
But Iâm a little nervous it might break something else Iâm not thinking of.
Thatâs a bit of Inform 6 code â the â##â indicates that whatâs being referred to there is the name of an action. See relevant bit of the DM4.
My apologies; I went straight to talking about things that are deeply in the weeds. Your Inform 7 source code gets compiled to Inform 6 and thatâs combined with a bunch of other I6 code from the âI6 Template Layerâ to make the auto.inf file you can see in the project Build directory after compilation, and then that gets compiled to either a .ulx or .z8 file. The ConvertToGoingWithPush routine I included above is from Actions.i6t from the Template Layer.
I would suggest not trying to worry about these details yet; thereâs plenty to learn and think about before you get to I6-level stuff.
But that doesnât mean youâre not affected by it⌠because the Pushing It To action is implemented in an irregular way, there are things you canât change about its behavior in the same way you would other actions. The order of the standard Action rulebooks is: Before, Instead, Check, Carry Out, After, and Report. Itâs a Check rule that converts the action and so thereâs never any attempt to follow Carry out, After, or Report rules for Pushing It To. What you can do is what I did above: create rules for the Going action with a when the item-pushed-between-rooms is not nothing condition. (And this isnât documented; one could only know the details here by reading the Standard Rules and template layer.)
This line is from the "Mattress King" example-- quite similar to Zedâs. I assume (hopefully rightly) that if code is from the documentation, it wonât break anything else.
After going a direction (called way-pushed) with something (called the thing-pushed):
say "You push [the thing-pushed] [way-pushed] to [the location].";
continue the action.
⌠and is explained in the documentation as being designed to avoid the repeated announcement e.g. âYou can see a wheelbarrow hereâ, as if it were a surprise, after pushing said object sequentially through a series of rooms.