Re: Inform: Implementing a semi-realistic car


20 Aug 1995 15:42:34 GMT

Julian Arnold <jools@arnod.demon.co.uk> wrote:
> However, I'm still not clear on how I place objects from one location
> in scope in another location without actually moving them all. Does
> anyone know?

Give your car location an `add_to_scope' property (see the Inform
Library history, item 14. For example:

Object Car "car"
with ...,
add_to_scope [;
ScopeWithin(real_car_location);
],
before [;
if (self hasnt open && action ~= ##Examine) {
if (MaxBox(noun) == real_car_location ||
MaxBox(noun) == real_car_location)
"You can't reach that, because the window is shut.";
}
];

[ MaxBox o;
do {
o = parent(o)
} until (o == 0 || parent(o) == 0 || (o ~= player &&
o hasnt transparent && o hasnt supporter && o hasnt open));
return o;
];

--
Gareth Rees