Vampires and such

Posted by Tseris on Mon 02 Feb 2009 06:31 AM — 7 posts, 23,745 views.

#0
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
Amended on Mon 02 Feb 2009 06:33 AM by Tseris
#1
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.
USA #2
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.
#3
Any suggestions about how best to deal with the vampire race issue? Should I just create a new race called vampire?
USA #4
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.
#5
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.
USA #6
What do you mean by "the issue"? Can't you just remove the part where it disallows RACE_VAMPIRE?