Showing the race instead of class

Posted by BrigandKing on Fri 20 Oct 2006 09:53 PM — 9 posts, 26,988 views.

#0
Fairly new to coding and have read through these forums, been very helpful. So now I thought I'd ask a question or two. I'm really looking for a point in the right direction not going to learn otherwise.


1. When looking in the room I don't want it to show "Bob the Weak Fighter" is here. I always thought that was silly that you could tell their profession and their strength at a glance but not if they were human. I want to see "Bob the Human is here." Mainly this is to have Vampires pass as normal people. I have spent 2 days looking and have probably seen it staring at me and not recognized it.


2. Also while I know it is beyond my coding ability at the moment and I won't attmept it for months or years is there a way to put some commands outside the queue or clear it in the SMAUG code as it is? As in, If fighting a mob I chain a string of spells together, I still want to be able to look at the mob to see how weak he is or maybe talk at the same. In another game I played I liked being able to talk and emote while on hunts and not having to wait for a spell to finish. Which is why I'd like a command queue clear. Say I cast one spell that puts me in a long delay and enter some other spell and I get attacked halfway through the first one. Or I do another action/skill that has a delay to it and go ahead thinking I'm safe to stack another on top of it. I'd like to be able to cancel out the commands not being executed so I can flee/cast a different spell/yell bloody murder. Just wondering if SMAUG would support those kinds of things.

Any help would be appreciated. Thanks in advance.
USA #1
1) That has to do with their title. Change their title and it changes that.

2) You could just have a flag on commands that could allow them to bypass the queue. I think I saw a snippet like that once.
#2
title---duh. I knew it was staring me right in the face. That's what I get for getting off the caffiene.

As for bypassing queue I looked very hard and never found a snippet like that. Of course half of the snippet sites I have searched for through links and or google are now defunct.
USA #3
mudbytes.net is a great snippet site.

I think Gatz's OOC command flag snippet may be something like what you want.
#4
I couldn't find that snippet you mentioned. I'll search harder later tonight.

USA #5
I don't see it either, but I thought that's where he uploaded it.
#6
Ok I took a stab at showing the race instead of the class-title and it seemed like it worked perfectly. For PCs that is. For NPCs it had a strange effect whenever they changed their position.


Exits: north up.
A large marble fountain gushes forth here.
The illustrious Darkhaven Academy Headmistress stands here to greet you.
Mistress Tsythia is shrouded in flowing shadow and light.
Tester the Dwarf is standing here.

Looks great right?
See what happens when I make them sit.

Log: Epoch: force tsy sit
Mistress Tsythia sits down.
Ok.

Exits: north up.
A large marble fountain gushes forth here.
Mistress TsythiaHuman sits upright here.
Mistress Tsythia is shrouded in flowing shadow and light.
Tester the Dwarf sits upright here.

Notice the NPC? It happens in any position other than standing. So it happens when fighting too.
And I'm stumped on this showing my inexperience.

Here is what I changed in act_info.c char_to_char_0
It works the same in 1.4a and FUSS
at 101

if( !IS_NPC( victim ) && !xIS_SET( ch->act, PLR_BRIEF ) )
               /*mudstrlcat( buf, victim->pcdata->title, MAX_STRING_LENGTH );*/
      mudstrlcat( buf, " the " , MAX_STRING_LENGTH ); 
      mudstrlcat( buf, race_table[victim->race]->race_name, MAX_STRING_LENGTH );
      mudstrlcat( buf, ".\r\n", MAX_STRING_LENGTH );/*changed to show race brigandking*/


and a bit further down at 121

if( !IS_NPC( victim ) && !xIS_SET( ch->act, PLR_BRIEF ) )
      /*mudstrlcat( buf, victim->pcdata->title, MAX_STRING_LENGTH );*/
          mudstrlcat( buf, " the " , MAX_STRING_LENGTH );  
          mudstrlcat( buf, race_table[victim->race]->race_name, MAX_STRING_LENGTH );/*brigandking*/


Help would be appreciated. Thanks.
Amended on Wed 11 Jun 2008 04:19 AM by Nick Gammon
Australia Forum Administrator #7
I amended your post to make the code a bit clearer.

You need some basic C knowledge here. You have changed something like:


if (something)
  do_one_thing ();


to:


if (something)
  do_one_thing ();
  do_another_thing ();
  do_a_third_thing ();


But the "if" only affects the very next thing. You need to use the curly brackets:


if (something)
  {
  do_one_thing ();
  do_another_thing ();
  do_a_third_thing ();
  }  // end of if


So in your case:


if( !IS_NPC( victim ) && !xIS_SET( ch->act, PLR_BRIEF ) )
  {
               /*mudstrlcat( buf, victim->pcdata->title, MAX_STRING_LENGTH );*/
      mudstrlcat( buf, " the " , MAX_STRING_LENGTH ); 
      mudstrlcat( buf, race_table[victim->race]->race_name, MAX_STRING_LENGTH );
      mudstrlcat( buf, ".\r\n", MAX_STRING_LENGTH );/*changed to show race brigandking*/
  }


Likewise for further down.
#8
Thanks, knew it was something easy I was over looking. Seems I missed that lesson in the book. ;)