Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Making Room Desc Colour Dependant Upon Sector Type - Help?

Making Room Desc Colour Dependant Upon Sector Type - Help?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Seifz   (24 posts)  Bio
Date Sat 21 Feb 2004 07:22 AM (UTC)
Message
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
Top

Posted by Seifz   (24 posts)  Bio
Date Reply #1 on Sat 21 Feb 2004 08:14 AM (UTC)
Message
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!
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


10,199 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.