I’m building a game with PunyInform and want to change a room description to reflect whether the room below is illuminated (either with the light property or by having an NPC holding a light there). My code generally works, but my game hangs with this code:
Object CryptStairs "Crypt Stairs"
with
name 'crypt' 'stairs',
description [;
print
"At the midpoint of these stairs, you can sense the damp
below. A thin veil of light comes from the altar area above";
if (OffersLight(Crypt)) <-- problem here
", and a similar weak light from the crypt below.^";
", but the path down descends into darkness.^";
],
s_to CryptGate,
u_to CryptGate,
d_to Crypt,
before [;
Smell: "Musty and damp.";
],
has light;
When I arrive in this location, my game hangs without any error. If I change if (OffersLight(Crypt)) to if (true), it doesn’t hang, so it appears that OffersLight is the problem.
Is this a routine I should be able to use in PunyInform? If not, is there a similar technique for “is this room illuminated?”
Thanks for any help!