Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex

Members: 0
Guests: 2
Stats
Files
Topics
Posts
Members
Newest Member
481
3,734
19,366
618
Micheal64X
Today's Birthdays
Vintar (28)
Related Links
» SmaugMuds.org » General » Coding » adding new race/class to dbna
Forum Rules | Mark all | Recent Posts

adding new race/class to dbna
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Apr 9, 2011, 3:27 pm
Go to the top of the page
Go to the bottom of the page

pentair
Fledgling
GroupMembers
Posts18
JoinedMar 18, 2009

messing around with dbna code and was trying to add a race in real quick. i copied a race and renamed it, changed the race number to the one i defined in mud.h, raised the max_race and max_class, added it to the typedef enum table.

in const.c i added the race/class to both race and class tables.

in comm.c i added the race to the new player creation process and added a helpfile for said race.

recompiled and still dont have the race as an option for a new char. only thing i didnt do was add a language and ooc tags. did i miss something somewhere? i been at this all day and the letters are starting to blur together. any help would be great. thanks :headbang:
       
Post is unread #2 Apr 9, 2011, 11:38 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Did you hotboot after recompiling?
       
Post is unread #3 Apr 10, 2011, 12:22 pm
Go to the top of the page
Go to the bottom of the page

pentair
Fledgling
GroupMembers
Posts18
JoinedMar 18, 2009

Yup. Did a hotboot, and shut it down and restarted it.
       
Post is unread #4 Apr 10, 2011, 10:51 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Did you make clean, or just make?
       
Post is unread #5 Apr 11, 2011, 8:49 am
Go to the top of the page
Go to the bottom of the page

pentair
Fledgling
GroupMembers
Posts18
JoinedMar 18, 2009

I did a make clean. This is a dragon ball code, so alot of stuff is coded weird. The imm of the mud I mainly play on says he always has problems adding in races too
       
Post is unread #6 Apr 11, 2011, 1:18 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

I'm not really familiar with DragonBall codebases aside from the fact that they over use color enough to make me never want to play them. Sp, suffice it to say, I'm at a loss here if you've done a make clean, make, and then a hotboot. As long as it's all in the right places it should have worked. If it didn't, well, I don't know what else to tell you.
       
Post is unread #7 Apr 11, 2011, 1:54 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

Did you add the new race to the race.lst file?
       
Post is unread #8 Apr 11, 2011, 2:33 pm
Go to the top of the page
Go to the bottom of the page

pentair
Fledgling
GroupMembers
Posts18
JoinedMar 18, 2009

Yes I added it to race.list and class.list. I can mset the race/class and it works but can't pick it on char creation. When I'm not on my iPad I can get the part of the code for char creation posted.
       
Post is unread #9 Apr 11, 2011, 3:05 pm   Last edited Apr 12, 2011, 12:39 pm by Samson
Go to the top of the page
Go to the bottom of the page

pentair
Fledgling
GroupMembers
Posts18
JoinedMar 18, 2009

ok heres the part in comm.c dealing with race choosing. its kinda long.
by the way, the race im trying to add is the soldier

send_to_desc_color( "\n\r&wThe following Races are Available to You:&D\n\r", d );
      send_to_desc_color( "&c==============================================================================&D", d );
      buf[0] = '\0';

      /*
       * Take this out SHADDAI
       */
      i = 0;
      /*
       * for ( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
       */
      send_to_desc_color( "\n\r", d );
      //for ( iClass = 0; iClass < 9; iClass++ )
      for( iClass = 0; iClass < 31; iClass++ )
      {
        if( iClass == 4 )
        {
          //i++;
          continue;
        }
        if( iClass > 8 && iClass < 27 )
          continue;
        //char letters[12] = "abcdefghijk";
        //char letters[14] = "abcdefghijklmn";
        char letters[15] = "abcdefghijklmno";
        if( class_table[iClass]->who_name && class_table[iClass]->who_name[0] != '\0' )
        {
          sprintf( buf, "&w   (&W%2d&w)  &c%-12s&w  ('&R%c&w' for help)&D\n\r",
                   i, class_table[iClass]->who_name, letters[i] );
          send_to_desc_color( buf, d );
          i++;
        }
      }
      send_to_desc_color( "&c==============================================================================&D", d );
      sprintf( buf, "\n\r&wChoose the number of your race: &D" );
      send_to_desc_color( buf, d );
      d->connected = CON_GET_NEW_CLASS;
      break;

    case CON_GET_NEW_CLASS:
      argument = one_argument( argument, arg );
      if( is_number( arg ) )
      {
        i = atoi( arg );
        int c = 0;
        if( i == 0 )
          c = 0;  // saian
        if( i == 1 )
          c = 1;  // human
        if( i == 2 )
          c = 2;  // halfbreed
        if( i == 3 )
          c = 3;  // namek
        if( i == 4 )
          c = 5;  // icer
        if( i == 5 )
          c = 6;  // bio
        if( i == 6 )
          c = 7;  // kaio
        if( i == 7 )
          c = 8;  // demon
        if( i == 8 )
          c = 27; // genie
        if( i == 9 )
          c = 28; // android-h
        if( i == 10 )
          c = 29; // android-e
        if( i == 11 )
          c = 30; // android-fm
        if( i == 12 )
          c = 36; // soldier          
        /*
         * for ( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
         */
        //for ( iClass = 0; iClass < 9; iClass++ )
        for( iClass = 0; iClass < 31; iClass++ )
        {
          if( iClass > 8 && iClass < 27 )
            continue;
          if( class_table[iClass]->who_name && class_table[iClass]->who_name[0] != '\0' )
          {
            //if ( i == iClass )
            if( c == iClass )
            {
              ch->class = iClass;
              ch->race = iClass;
              break;
            }
          }
        }
      }
      else
      {
        //char letters[12] = "abcdefghijk";
        //char letters[14] = "abcdefghijklmn";
        char letters[15] = "abcdefghijklmno";
        for( i = 0; i < 14; i++ )
        {
          if( arg[0] == letters[i] )
          {
            int c = i;
            if( i == 0 )
              c = 0;  // saian
            if( i == 1 )
              c = 1;  // human
            if( i == 2 )
              c = 2;  // halfbreed
            if( i == 3 )
              c = 3;  // namek
            if( i == 4 )
              c = 5;  // icer
            if( i == 5 )
              c = 6;  // bio
            if( i == 6 )
              c = 7;  // kaio
            if( i == 7 )
              c = 8;  // demon
            if( i == 8 )
              c = 27; // genie
            if( i == 9 )
              c = 28; // android-h
            if( i == 10 )
              c = 29; // android-e
            if( i == 11 )
              c = 30; // android-fm
            if( i == 12 )
              c = 36; // soldier
            if( !str_cmp( class_table©->who_name, "android-h" ) )
              sprintf( buf, "androidh" );
            else if( !str_cmp( class_table©->who_name, "android-e" ) )
              sprintf( buf, "androide" );
            else if( !str_cmp( class_table©->who_name, "android-fm" ) )
              sprintf( buf, "androidfm" );
            else
              sprintf( buf, "%s", class_table©->who_name );
            do_help( ch, buf );
            return;
          }
        }
        i = 0;
        send_to_desc_color( "\n\r&c==============================================================================&D", d );
        /*
         * for ( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
         */
        //for ( iClass = 0; iClass < 9; iClass++ )
        for( iClass = 0; iClass < 31; iClass++ )
        {
          if( iClass == 4 )
          {
            //i++;
            continue;
          }
          if( iClass > 8 && iClass < 27 )
            continue;
          //char letters[14] = "abcdefghijklmn";
          char letters[15] = "abcdefghijklmno";
          if( class_table[iClass]->who_name && class_table[iClass]->who_name[0] != '\0' )
          {
            sprintf( buf, "\n\r&w   (&W%2d&w)  &c%-12s&w  ('&R%c&w' for help)&D",
                     i, class_table[iClass]->who_name, letters[i] );
            send_to_desc_color( buf, d );
            i++;
          }
        }
        send_to_desc_color( "\n\r&c==============================================================================&D", d );
        sprintf( buf, "\n\r&wChoose the number of your race: &D" );
        send_to_desc_color( buf, d );
        return;
      }
       
Post is unread #10 Apr 11, 2011, 8:50 pm
Go to the top of the page
Go to the bottom of the page

pentair
Fledgling
GroupMembers
Posts18
JoinedMar 18, 2009

Update:
Just noticed the line,
for( iClass = 0; iClass < 31; iClass++ )

My class number is 39. I upped it to 39 and the race still doesn't show up but I can pick the number that's not on the list and get the race. Will look again tomorrow and try to get it to show. Not sure but it calls who_name a couple times so maybe I have to add the race to do_who.
       
Post is unread #11 Apr 12, 2011, 9:18 am
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

That is the most convoluted pile of crap I've ever had the displeasure of reading. It's no wonder you're having the issues you're having. It's using numbers where it should be using some kind of variable, none of it's as dynamic as the nanny was written to be. That's.. just disgusting... How do you work with that?
       
Post is unread #12 Apr 12, 2011, 9:29 am
Go to the top of the page
Go to the bottom of the page

pentair
Fledgling
GroupMembers
Posts18
JoinedMar 18, 2009

Well obviously not very well. Lol. I've mostly worked with godwars. Later today when I get off work I will mess with it and try to get it to work.
       
Post is unread #13 Apr 12, 2011, 12:40 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

It cried out for code tags, and I showed it mercy. It sure doesn't make sense why someone changed it to using hardcoded numbers though.
       
Post is unread #14 Apr 12, 2011, 2:35 pm
Go to the top of the page
Go to the bottom of the page

pentair
Fledgling
GroupMembers
Posts18
JoinedMar 18, 2009

Might redo it to be the full name instead of numbers. Not till later though. Long day, going out bar hopping to cool off. It's hot in sw Florida
       
Post is unread #15 Apr 15, 2011, 3:27 pm
Go to the top of the page
Go to the bottom of the page

pentair
Fledgling
GroupMembers
Posts18
JoinedMar 18, 2009

I got it to work. Just added a if check for every race I didn't want to be choosable. And at the very end of that code I had to add if( iClass != 36 ) in so it would allow a number higher than 8 to be chosen. I think that made sense.
       
Pages:<< prev 1 next >>