Looks to me like you’ll need to write your own code for this. It could be done as a global function, if you have a lot of rooms.
You may need to hack the library code. It appears (judging from the brief example in the DM4) that when_closed is intended just to print a string when it’s called. So if you have three doors in the location, when_closed or when_open may get called on all three of them in turn. OTOH, if two of them supply no string for this, what happens? Maybe you could make the when_closed and when_open on one door do all the work of printing composite messages, and leave the other doors without these properties. Have you tried that?
If I have time, I’ll try a few things and let you know what I learn – no promises, though.
Here’s how I solved it. The code below belongs to the Room class, of which every location in the game is a member.
after [i flag;
Look:
objectloop(i in real_location && i ofclass DoorClass)
{
if(flag==0)
{print "^";flag=1;}
if(i has open)
{
i.whenopen();
}
else
{
i.whenclosed();
}
}
if(flag==1)
{print "^";}
],
I replaced when_open and when_closed with my own non-library functions whenopen and whenclosed and gave all DoorClass objects the concealed flag. The whenopen/whenclosed are called from an after routine in the relevant location.
Here’s the output
It was much simpler than I thought. OO is much cooler than BASIC.