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 ➜ Vampires and such

Vampires and such

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


Posted by Tseris   (98 posts)  Bio
Date Mon 02 Feb 2009 06:31 AM (UTC)

Amended on Mon 02 Feb 2009 06:33 AM (UTC) by Tseris

Message
So Im making a dark fantasy mud, a little different than the traditional themes. Short story is I really need the Vampire race. I have 6 races, Vampire among them, so I tried creating my races using the online creation, then going in and deleting from the race list all the other races I didnt want, as well as taking out _Vampire_ and replacing it with Vampire.

Then I did the same thing with the classes, creating the ones I want and deleting the others. I know it sounds a little odd, but I have it so that if youre a Vampire, that is both your race and class, same for Werewolf, etc etc. So I booted up the mud, set up the race and class settings how I wanted, and tried to make a new character.

Problem is that when it asked me what class I wanted to be, it only gave me Vampire as a choice, not the other 5 I had written. Then when I chose Vampire, it asked me for race but gave me no choices at all. So Im thinking simply deleting races and classes from the table isnt the way to go. Thank god for backups.

So starting over, whats the proper way to remove races and classes and how should I get around the whole code preventing someone from choosing a vampire race? Should I replace the current _Vampire_ with Vampire or just leave that one the way it is since its the 6th slot and gives everyone trouble and just make a new Vampire race that would be in the 7th slot?

p.s. sorry about the wall o' text
Top

Posted by Tseris   (98 posts)  Bio
Date Reply #1 on Mon 02 Feb 2009 06:57 AM (UTC)
Message
An alternative question that would be better and may solve the issue easier is...is there a way to keep classes and races in the list and just not allow players to choose them? That way they would still be available for mobs, and I wouldnt have to fool with any of the original races/classes.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #2 on Mon 02 Feb 2009 02:54 PM (UTC)
Message
Sure, you just need to edit the code in the character creation process to limit the choices given to players. Definitely much easier (and safer!) than trying to fiddle with the original races.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Tseris   (98 posts)  Bio
Date Reply #3 on Mon 02 Feb 2009 07:31 PM (UTC)
Message
Any suggestions about how best to deal with the vampire race issue? Should I just create a new race called vampire?
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #4 on Mon 02 Feb 2009 07:36 PM (UTC)
Message
To be honest, I don't remember how hard it is to create races. I would look at the code and get a feel for how hard it would be to add one. It might be easier to just rename one race to "vampire", but you'll have to be careful that the race doesn't have hard-coded behavior in the code. I'd grep around for the race name you're about to change to make sure that there's not an unreasonable amount of work to do.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Tseris   (98 posts)  Bio
Date Reply #5 on Mon 02 Feb 2009 07:41 PM (UTC)
Message
Well the issue seems to be this particular bit right here:


if( iRace == MAX_PC_RACE
       || !race_table[iRace]->race_name || race_table[iRace]->race_name[0] == '\0'
       || iRace == RACE_VAMPIRE
       || IS_SET( race_table[iRace]->class_restriction, 1 << ch->Class )
       || !str_cmp( race_table[iRace]->race_name, "unused" ) )
   {
      write_to_buffer( d, "That's not a race.\r\nWhat IS your race? ", 0 );
      return;
   }


which occurs under void nanny get_new_race in comm.c

Stock smaug comes with both a vampire race and a vampire class, though for some reason it doesnt want you to use the vampire race. In the class list that seems to be why its written as _Vampire_ with the underscores.

This is the 6th race listed in the class list, and others on this forum have had problems when they tried to make their own races, whatever they put in the 6th slot doesnt work.

The code is filled with changes to someone playing a vampire by use of the flag IS_VAMPIRE. But that flag returns true if race = vampire OR if class = vampire.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #6 on Tue 03 Feb 2009 02:25 PM (UTC)
Message
What do you mean by "the issue"? Can't you just remove the part where it disallows RACE_VAMPIRE?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
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.


20,975 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.