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 ➜ NPC classes

NPC classes

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


Posted by Toy   (206 posts)  Bio
Date Fri 31 May 2002 03:12 PM (UTC)
Message
OK, I've changed the MAX_NPC_CLASS in mud.h to 100, and I've edited the NPC_CLASSES in const.c, and I even edited the MAX_NPC_CLASS section of build.c. It works fine, execpt for one small thing: I can get the proper names of the class up to class #25. Lemme show you:

char * const npc_class [MAX_NPC_CLASS] =
{
"mage", "cleric", "thief", "warrior", "vampire", "druid", "ranger",
"paladin", "necromancer", "anti-paladin", "guard", "shopkeeper", "animal",
"god", "civilian", "sailor", "immortal", "prince", "teacher",
"baker", "butcher", "blacksmith", "mayor", "king", "queen", "monster",
"undead", "princess", "gypsy", "soldier",
};

It read class 25/monster, but it reads class 26/unknown. Am I forgetting to edit something somewhere so it reads the remainder of the classes?
-Alexander

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 31 May 2002 10:28 PM (UTC)
Message
In act_info.c I see these lines:


IS_NPC(victim)?victim->class<MAX_NPC_CLASS&&victim->class>=0?
npc_class[victim->class] : "unknown":victim->class<MAX_PC_CLASS&&
class_table[victim->class]->who_name&&
class_table[victim->class]->who_name[0] != '\0'?
class_table[victim->class]->who_name:"unknown");



It seems to display "unknown" based on MAX_PC_CLASS, not MAX_NPC_CLASS. Sounds like a bug, anyway I would try changing that.

- Nick Gammon

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

Posted by Toy   (206 posts)  Bio
Date Reply #2 on Fri 31 May 2002 10:58 PM (UTC)
Message
Thanks for setting me in the right direction Nick. I also found there were simpliar lines in Act_Wiz.c. Now I ran into another problem. I made the max races 1000, and like I did with MAX_NPC_CLASS, I changed everything in the right spots. But, if I set a mob's race number to 92 I get this message in a never-ending stream:

[*****] BUG: Str_cmp: null bstr.
[*****] BUG: Str_cmp: null bstr.
[*****] BUG: Str_cmp: null bstr.
[*****] BUG: Str_cmp: null bstr.
[*****] BUG: Str_cmp: null bstr.
[*****] BUG: Str_cmp: null bstr.
[*****] BUG: Str_cmp: null bstr.

Any clue what this is all about?

-Alexander

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Toy   (206 posts)  Bio
Date Reply #3 on Fri 31 May 2002 11:02 PM (UTC)
Message
ERRRR.... ok, never mind. My highest race is only 91.. that's probably what's causing the continually looping bug message... Thanks anyways. :)

Alexander, the not-so knowledged but is working his way to smartness and greatness alike.

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by USER007   (124 posts)  Bio
Date Reply #4 on Sun 26 Sep 2004 06:43 PM (UTC)

Amended on Sun 26 Sep 2004 06:51 PM (UTC) by USER007

Message
Hmmm... I'm having some small problems with this change. I changed the NPC races and everything compiled cleanly, but when I log on the MUD and change the race of a mob I get this:

Build: Anavel: mset sec race 2
Log: [*****] BUG: Str_cmp: null bstr.
Log: [*****] BUG: Str_cmp: null bstr.

It still changes the race of the mob, but I'm wondering whats causing this.


Const.c:

char * const npc_race [MAX_NPC_RACE] =
{
"human", "spirit", "half-demon", "demon", "vampire", "r5", "r6",
"r7", "r8", "ape", "baboon", "bat", "bear", "cat", "dog", "dragon",
"goblin", "golem", "rat", "shadow", "shapeshifter", "wolf",
"zombie", "mammal", "fish", "insect", "animal", "monster"
};

Mud.h:

#define MAX_RACE 20
#define MAX_NPC_RACE 30
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #5 on Sun 26 Sep 2004 09:54 PM (UTC)
Message
Well, I beleive that it because you have 28 race names declared in that array, you need to either add 2 more names, or decrease your declaration from 30 to 28.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by USER007   (124 posts)  Bio
Date Reply #6 on Sun 26 Sep 2004 11:25 PM (UTC)
Message
Well seems it was that, I left it at 30 cause I was thinking of adding more races, but seems I'll just have to change both of those files. Thanks.
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.


26,152 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.