Making Room Desc Colour Dependant Upon Sector Type - Help?

Posted by Seifz on Sat 21 Feb 2004 07:22 AM — 2 posts, 11,390 views.

#0
This should be rather simple, but I'm new to this, so I need some help. Basically, I want to make the colour of the room description change with each sector type. So, when the sector is indoors, I want the desc to be dgrey, when it's desert, I want the desc to be yellow, etc. But I'm having a problem. No matter what the sectortype is, the desc always appears as whatever I set the Indoors colour to... I added the following to act_info.c in do_look:

/* 'look' or 'look auto' */
set_char_color( AT_RMNAME, ch );
send_to_char( ch->in_room->name, ch );
send_to_char( "\n\r", ch );

switch( ch->in_room->sector_type ) {
default: set_char_color( AT_RMDESC, ch ); break;
case SECT_INSIDE: set_char_color( AT_DGREY, ch ); break;
case SECT_CITY: set_char_color( AT_GREY, ch ); break;
case SECT_FIELD: set_char_color( AT_YELLOW, ch ); break;
case SECT_FOREST: set_char_color( AT_GREEN, ch ); break;
case SECT_HILLS: set_char_color( AT_ORANGE, ch ); break;
case SECT_MOUNTAIN: set_char_color( AT_BLOOD, ch ); break;
case SECT_WATER_SWIM: set_char_color( AT_LBLUE, ch ); break;
case SECT_WATER_NOSWIM: set_char_color( AT_LBLUE, ch ); break;
case SECT_UNDERWATER: set_char_color( AT_BLUE, ch ); break;
case SECT_AIR: set_char_color( AT_CYAN, ch ); break;
case SECT_DESERT: set_char_color( AT_YELLOW, ch ); break;
case SECT_OCEANFLOOR: set_char_color( AT_BLUE, ch ); break;
case SECT_UNDERGROUND: set_char_color( AT_DGREY, ch ); break;
case SECT_LAVA: set_char_color( AT_RED, ch ); break;
case SECT_SWAMP: set_char_color( AT_DGREEN, ch ); break;
}

I'm assuming that I just put the wrong variable in the switch. At the moment, room descs are all dgrey. When Indoors was set to AT_YELLOW, everything was yellow. Could somebody help me?

Thanks in advance,
Seifz
#1
Ack, stupid error. I kept setting the sectortype with the word instead of the integer, which doesn't work with SMAUG. And there's no error catching, either. Oh well.

Thanks anyways!