MudBytes
» MUDBytes Community » Codebase Specific » DikuMUD » SMAUG » removing race selection from ...
Pages: << prev 1 next >>
removing race selection from creation
Igabod
Wizard






Group: Members
Posts: 1,080
Joined: Jul 23, 2008

Go to the bottom of the page Go to the top of the page
#1 id:43946 Posted Mar 16, 2010, 3:42 am

I'm wanting to completely remove race selection from char creation on smaugfuss and when I started the task I realized how not simple it is. I should have known it would be harder than I thought it was, messing around with nanny is never pretty. So, I'm wondering if anybody out there has already done this and has any tips for me. I'm not looking for a step-by-step instruction or anything, just a few hints on what not to do and what not to forget.
.........................
Every man has his follies, and often they are the most interesting thing he has got - Josh Billings
Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. - Albert Einstein
I have a love interest in every one of my films... a gun. - Arnold Schwarzenegger
Recession is when a neighbor loses his job. Depression is when you lose yours. - Ronald Reagan
I like long walks, especially when they are taken by people who annoy me. - Fred Allen

jurdendurden
Conjurer






Group: Members
Posts: 219
Joined: Nov 20, 2009

Go to the bottom of the page Go to the top of the page
#2 id:43959 Posted Mar 16, 2010, 10:03 am

Remove this:

Code (c):
1
2
3
4
5
6
7
 
case CON_GET_NEW_RACE:
     nanny_get_new_race( d, argument );
     break;
 


Figure out what step you want to have nanny skip into (CON_GET_NEW_CLASS most likely), and change every instance of d->connected = CON_GET_NEW_RACE to whatever new connection state you want to be next in line.

Edit: Also have the game default every player's race.
.........................
Aragond: the Chronicles

Last edited Mar 16, 2010, 10:04 am by jurdendurden
Igabod
Wizard






Group: Members
Posts: 1,080
Joined: Jul 23, 2008

Go to the bottom of the page Go to the top of the page
#3 id:44153 Posted Mar 18, 2010, 12:53 am

For future reference for others who may wish to do the same, here's what I did.

In comm.c find void nanny_get_new_class and in that function find the following.

Code (C):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
   write_to_buffer( d, "\r\nYou may choose from the following races, or type help [race] to learn more:\r\n[", 0 );
   buf[0] = '\0';
   for( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
   {
      if( iRace != RACE_VAMPIRE
          && race_table[iRace]->race_name && race_table[iRace]->race_name[0] != '\0'
          && !IS_SET( race_table[iRace]->class_restriction, 1 << ch->Class )
          && str_cmp( race_table[iRace]->race_name, "unused" ) )
      {
         if( iRace > 0 )
         {
            if( strlen( buf ) + strlen( race_table[iRace]->race_name ) > 77 )
            {
               mudstrlcat( buf, "\r\n", MAX_STRING_LENGTH );
               write_to_buffer( d, buf, 0 );
               buf[0] = '\0';
            }
            else
               mudstrlcat( buf, " ", MAX_STRING_LENGTH );
         }
         mudstrlcat( buf, race_table[iRace]->race_name, MAX_STRING_LENGTH );
      }
   }
   mudstrlcat( buf, "]\r\n: ", MAX_STRING_LENGTH );
   write_to_buffer( d, buf, 0 );
   d->connected = CON_GET_NEW_RACE;
 


and comment all of that out. below that you will need to add these three lines

Code (C):
1
2
3
4
5
6
   ch->race = 0;
   write_to_buffer( d, "\r\nWould you like RIP, ANSI or no graphic/color support, (R/A/N)? ", 0 );
   d->connected = CON_GET_WANT_RIPANSI;
 


Also at the top you'll find this

Code (C):
1
2
3
4
5
6
7
8
9
void nanny_get_new_class( DESCRIPTOR_DATA * d, const char *argument )
{
   CHAR_DATA *ch;
   char buf[MAX_STRING_LENGTH];
   char arg[MAX_STRING_LENGTH];
   int iClass, iRace;
 


just change that to look like this

Code (C):
1
2
3
4
5
6
7
8
9
10
 
void nanny_get_new_class( DESCRIPTOR_DATA * d, const char *argument )
{
   CHAR_DATA *ch;
//   char buf[MAX_STRING_LENGTH];
   char arg[MAX_STRING_LENGTH];
   int iClass/*, iRace*/;
 


then in void nanny you would remove the case that  was pointed out by jurdendurden above and voila you're good to go. this sets players to the default race of human. If you wish to remove races completely then you will have to figure that out on your own.
.........................
Every man has his follies, and often they are the most interesting thing he has got - Josh Billings
Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. - Albert Einstein
I have a love interest in every one of my films... a gun. - Arnold Schwarzenegger
Recession is when a neighbor loses his job. Depression is when you lose yours. - Ronald Reagan
I like long walks, especially when they are taken by people who annoy me. - Fred Allen

Pages:<< prev 1 next >>
Tags
[+]

Valid XHTML 1.1! Valid CSS!