About making a dynamic name
Posted: Mon Jan 02, 2012 7:29 pm
I tried a suggestion. I defined a room without giving a name for it in the definition, then including a name property, like this:
If I set the name property by a quoted string on the room definition and include a name property, the compiler gets uneasy and doesn't like it.
Doing this, if someone throws the power off, makes the system think that I've overflowed the screen and trips the routine to priint "[MORE]" and wait for a keypress. That doesn't make any sense, but that appears to be what it's doing.
I guess I will have to use the Dynname property I wrote up for the Wiki after all.
What I want is, every time the room is enterered or the user views the room, it gives the name of the room if the power is on, or gives the name of the room and a second line reading EMERGENCY POWER ACTIVATED to indicate this room has emergency power. Of course, there might be a before or after property I can set that would cause the system to do this then go on to the regular actions.
Code: Select all
room warehouse_B
{
n_to warehouse_BN2
s_to warehouse_BS2
w_to warehouse_BW2
e_to warehouse_BE2
name
{
"Basement Control Center";
if (shutoff_power is not switchedon) or (electric_meter is broken)
"\nEMERGENCY LIGHTING ACTIVATED";
}
Doing this, if someone throws the power off, makes the system think that I've overflowed the screen and trips the routine to priint "[MORE]" and wait for a keypress. That doesn't make any sense, but that appears to be what it's doing.
I guess I will have to use the Dynname property I wrote up for the Wiki after all.
What I want is, every time the room is enterered or the user views the room, it gives the name of the room if the power is on, or gives the name of the room and a second line reading EMERGENCY POWER ACTIVATED to indicate this room has emergency power. Of course, there might be a before or after property I can set that would cause the system to do this then go on to the regular actions.