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 ➜ Showing the race instead of class

Showing the race instead of class

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


Posted by BrigandKing   (23 posts)  Bio
Date Fri 20 Oct 2006 09:53 PM (UTC)
Message
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.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Fri 20 Oct 2006 09:54 PM (UTC)
Message
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.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by BrigandKing   (23 posts)  Bio
Date Reply #2 on Fri 20 Oct 2006 10:19 PM (UTC)
Message
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.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #3 on Fri 20 Oct 2006 10:29 PM (UTC)
Message
mudbytes.net is a great snippet site.

I think Gatz's OOC command flag snippet may be something like what you want.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by BrigandKing   (23 posts)  Bio
Date Reply #4 on Fri 20 Oct 2006 10:56 PM (UTC)
Message
I couldn't find that snippet you mentioned. I'll search harder later tonight.

Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #5 on Fri 20 Oct 2006 10:59 PM (UTC)
Message
I don't see it either, but I thought that's where he uploaded it.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by BrigandKing   (23 posts)  Bio
Date Reply #6 on Wed 11 Jun 2008 02:58 AM (UTC)

Amended on Wed 11 Jun 2008 04:19 AM (UTC) by Nick Gammon

Message
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.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #7 on Wed 11 Jun 2008 04:22 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by BrigandKing   (23 posts)  Bio
Date Reply #8 on Wed 11 Jun 2008 11:49 AM (UTC)
Message
Thanks, knew it was something easy I was over looking. Seems I missed that lesson in the book. ;)
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.


25,505 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.