I’ve decided to apply a minor hack to deal with the problem. Here is the full source of Conditional Backdrops, Version 2:
[spoiler][code]Version 2/110302 of Conditional Backdrops by Mike Ciul begins here.
“An extension to allow a single rulebook to determine the presence of multiple backdrops.”
Include (-
[ MoveFloatingObjects i k l m address flag;
if (real_location == nothing) return;
objectloop (i) {
if (ObjectFloats(i)) {
if (ObjectFoundIn(i, real_location)) move i to real_location;
else remove i;
}
}
];
[ ObjectFloats B address;
return (B.&found_in ~= 0 && B hasnt absent);
];
[ ObjectFoundIn B R k l m address;
if (~~ObjectFloats( B )) rfalse;
address = B.&found_in;
if (ZRegion(address–>0) == 2) {
m = address–>0;
parameter_object = B;
return (m.call(R) ~= 0);
}
else {
k = B.#found_in;
for (l=0 : l<k/WORDSIZE : l++) {
m = address–>l;
if (ZRegion(m) == 2 && m.call(R) ~= 0) rtrue;
if (m == R || m in R) rtrue;
}
}
rfalse;
];
[ MoveBackdrop bd D x address;
if (~~(bd ofclass K7_backdrop)) return RunTimeProblem(RTP_BACKDROPONLY, bd);
if (bd.#found_in > WORDSIZE) {
address = bd.&found_in;
address–>0 = D;
} else bd.found_in = D;
give bd ~absent;
MoveFloatingObjects();
];
-) instead of “Floating Objects” in “WorldModel.i6t”
A conditional backdrop is a kind of thing.
A conditional backdrop is always fixed in place. A conditional backdrop is never portable. A conditional backdrop is usually scenery.
Include (- with found_in [ ; ProcessRulebook( (+ Backdrop condition rules +) ); return (RulebookSucceeded()); ], -) when defining a conditional backdrop.
The specification of conditional backdrop is “Like a backdrop, but allows rules for determining presence or absence in a given room.”
Backdrop condition rules are an object-based rulebook.
Backdrop condition rules have outcomes present (success), it is present (success), it is absent (failure) and absent (failure - the default).
To decide which object is new location: (- location -).
Conditional Backdrops ends here.[/code][/spoiler]
The relevant line I’ve added sets “parameter_object = B” right before calling the found_in function. Is this safe, or can it mess with nested rulebooks? Should I save the old parameter_object on the stack?