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.
 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Just a little help with SMAUG

Just a little help with SMAUG

Posting of new messages is disabled at present.

Refresh page


Pages: 1 2  3  4  

Posted by Killfoobar   USA  (27 posts)  Bio
Date Fri 17 Mar 2006 07:44 PM (UTC)
Message
I was wondering where you set the amount of classes and races that you see at the beginning, when you choose the class & race of your character.

Also, how would you write the "Your stats are: ..........." then ask for reroll, and call the rolling sequence.

And one last thing, with the Skill/Spell creation, i found some help with it, but i dont seem to be able to create a skill or spell correctly.

Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Fri 17 Mar 2006 08:10 PM (UTC)
Message
You should just be able to add things to class.lst or race.lst for what to pick on creation.

At afkmud.com, there is a reroll snippet you could use.

Creating a skill? Using sset? I've never created a skill that way. I just code it in.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #2 on Fri 17 Mar 2006 08:40 PM (UTC)
Message
Creating skills with sset is pretty straightforward if, like Zeno said, you have a code function to map it to. If you want to do it without a new do_function, it works kind of like spells. What problems are you having specifically?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #3 on Mon 20 Mar 2006 08:31 PM (UTC)
Message
Well the thing is i have the class.lst and race.lst amended, but it still wont show all of the classes, or all of the races
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #4 on Mon 20 Mar 2006 08:36 PM (UTC)

Amended on Tue 11 Mar 2008 03:30 AM (UTC) by Nick Gammon

Message
Are you using stock Smaug? If so, I suggest using FUSS.
http://www.smaugfuss.org

I seem to remember a bug in stock with class/race lists.

[EDIT - 11 March 2008] - The Smaug FUSS site is now http://www.smaugmuds.org/

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #5 on Mon 20 Mar 2006 09:22 PM (UTC)
Message
the thing is i made a lot of changes to the stock smaug as it was, and i was wondering if anyone knew where that problem was at, and how to fix it
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #6 on Mon 20 Mar 2006 09:38 PM (UTC)
Message
Check the fixes in FUSS, they should all be listed on the forum. I can't remember the fix offhand.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #7 on Mon 20 Mar 2006 11:21 PM (UTC)
Message
ok, now i have a problem with...
act( AT_TELL, MXPTAG ("player $n") "$n" MXPTAG ("/player")
it says parse error before string constant when i try to compile
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #8 on Tue 21 Mar 2006 01:12 AM (UTC)
Message
That can't be the whole piece of code, it's not even a full act line. :(

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #9 on Tue 21 Mar 2006 01:52 AM (UTC)
Message
Yeah. Post the exact error, and the corresponding lines.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #10 on Tue 21 Mar 2006 09:42 PM (UTC)

Amended on Tue 21 Mar 2006 10:59 PM (UTC) by Killfoobar

Message
Ok, i fixed the problem before, but it has some new problems

   case CON_GET_NEW_CLASS:
	argument = one_argument(argument, arg);

       if (!str_cmp(arg, "help"))
        {
        	
	for ( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
	{
	  if ( class_table[iClass]->who_name &&
	       class_table[iClass]->who_name[0] != '\0' && !class_table[iClass]->remort_class)

	  {
            if (toupper(argument[0])==toupper(class_table[iClass]->who_name[0])
	    &&   !str_prefix( argument, class_table[iClass]->who_name ) )
	    {
	      do_help(ch, argument);
	      write_to_buffer( d, "Please choose a class: ", 0 );
              return;
	    }
	  }
        }  
	write_to_buffer( d, "No such help topic.  Please choose a class: ", 0 );
	return;
	}

	for ( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
	{
	  if ( class_table[iClass]->who_name &&
	       class_table[iClass]->who_name[0] != '\0' && !class_table[iClass]->remort_class)

	    {
		ch->class =  iClass;
		break;
	    }
	  }
	}

	if ( iClass == MAX_PC_CLASS
	||  !class_table[iClass]->who_name 
	|| class_table[iClass]->who_name[0] == '\0'
	|| !str_cmp(class_table[iClass]->who_name,"unused"))
	{
	  write_to_buffer( d, "That's not a class.\n\rWhat IS your class? ",0);
	  return;
	}


        if ( check_bans( ch, BAN_CLASS ) )
        {
         write_to_buffer (d,
             "That class is not currently avaiable.\n\rWhat IS your class? ",0);
         return;
        }

	write_to_buffer( d, "\n\rYou may choose from the following races, or type help [race] to learn more:\n\r[", 0 );
	buf[0] = '\0';
	for ( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
	{
	  if (iRace != RACE_VAMPIRE && !race_table[iRace]->remort_race
	  && 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 )
		{
		   strcat( buf, "\n\r" );
		   write_to_buffer( d, buf, 0 );
		   buf[0] = '\0';
		}
		else
		   strcat( buf, " " );
	    }
	    strcat( buf, race_table[iRace]->race_name );
          }
        }
	strcat( buf, "]\n\r: " );
	write_to_buffer( d, buf, 0 );
	d->connected = CON_GET_NEW_RACE;
	break; /*this line, it says break statement not within loop or switch*/

    case CON_GET_NEW_RACE: /*this line, it says case label not within a switch statement*/
	argument = one_argument(argument, arg);
       if (!str_cmp( arg, "help") )
        {
          for ( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
	  {	
	    if ( toupper(argument[0]) == toupper(race_table[iRace]->race_name[0]) && !race_table[iRace]->remort_race 
)
	    {
	      do_help(ch, argument);
      	      write_to_buffer( d, "Please choose a race: ", 0);
	      return;
	    }
	  }
   	  if (!str_cmp( arg, "help") )
        {
          for ( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
	  {	
	    if ( toupper(argument[0]) == toupper(race_table[iRace]->race_name[0]) && !race_table[iRace]->remort_race 
	    &&   !str_prefix( arg, race_table[iRace]->race_name ) )
	    {
		ch->race = iRace;
		break;
	    }
	}

    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.\n\rWhat IS your race? ", 0 );
	    return;
	}

       write_to_buffer( d, "You may now roll for your character's stats.\r\nYou may roll as often as you like.\r\n",0);
        
	  name_stamp_stats(ch);

        snprintf( buf, MAX_STRING_LENGTH, "\r\nStr: %d  Int: %d  Wis: %d  Dex: %d  Con: %d  Cha: %d  Lck: %d\r\nKeep? (Y/N)",
        ch->perm_str, ch->perm_int, ch->perm_wis, ch->perm_dex, ch->perm_con, 
	  ch->perm_cha, ch->perm_lck );
        write_to_buffer( d, buf, 0 );

        d->connected = CON_ROLL_STATS;
        break; /*this line, it says break statement not within loop or switch*/

      case CON_ROLL_STATS: /*this line, it says case label not within a switch statement*/
      switch (argument[0] )
      {
         case 'y': case 'Y':
	     write_to_buffer( d, "\r\nWould you like ANSI, or no graphic/color support, (A/N)? ", 0 );
	     d->connected = CON_GET_WANT_RIPANSI;
         break;

         case 'n': case 'N':
     
	   name_stamp_stats(ch);

         snprintf( buf, MAX_STRING_LENGTH, "\r\nStr: %d  Int: %d  Wis: %d  Dex: %d  Con: %d  Cha: %d  Lck: %d\r\nKeep? (Y/N)",
         ch->perm_str, ch->perm_int, ch->perm_wis, ch->perm_dex, ch->perm_con, 
	   ch->perm_cha, ch->perm_lck );
	   write_to_buffer( d, buf, 0 );
         return;
         default: write_to_buffer( d, "Yes or No? ", 0 );
         return;
       }
    break; /*this line, it says break statement not within loop or switch*/


Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #11 on Tue 21 Mar 2006 09:44 PM (UTC)

Amended on Tue 21 Mar 2006 10:59 PM (UTC) by Killfoobar

Message
And also

case CON_GET_WANT_RIPANSI: /*this line, it says case label not within a switch statement*/
	switch ( argument[0] )
	{
	case 'r': case 'R':
	    xSET_BIT(ch->act,PLR_RIP);
	    xSET_BIT(ch->act,PLR_ANSI);
	    break;
	case 'a': case 'A': xSET_BIT(ch->act,PLR_ANSI);  break;
	case 'n': case 'N': break;
	default:
	    write_to_buffer( d, "Invalid selection.\n\rRIP, ANSI or NONE? ", 0 );
	    return;
	}
	sprintf( log_buf, "%s@%s new %s %s.", ch->name, d->host,
		race_table[ch->race]->race_name,
		class_table[ch->class]->who_name );
	log_string_plus( log_buf, LOG_COMM, sysdata.log_level);
	to_channel( log_buf, CHANNEL_MONITOR, "Monitor", LEVEL_IMMORTAL );
	write_to_buffer( d, "Press [ENTER] ", 0 );
	show_title(d);
	ch->level = 0;
	ch->position = POS_STANDING;
	d->connected = CON_PRESS_ENTER;
	set_pager_color( AT_PLAIN, ch );
	return;
	break; /*this line, it says break statement not within loop or switch*/

    case CON_PRESS_ENTER: /*this line, it says case label not within a switch statement*/
        if ( chk_watch(get_trust(ch), ch->name, d->host) ) /*  --Gorog */
           SET_BIT( ch->pcdata->flags, PCFLAG_WATCH );
        else
           REMOVE_BIT( ch->pcdata->flags, PCFLAG_WATCH );

	if ( ch->position == POS_MOUNTED )
		ch->position = POS_STANDING;

	set_pager_color( AT_PLAIN, ch );
	if ( xIS_SET(ch->act, PLR_RIP) )
	  send_rip_screen(ch);
	if ( xIS_SET(ch->act, PLR_ANSI) )
	  send_to_pager( "\033[2J", ch );
	else
	  send_to_pager( "\014", ch );
	if ( IS_IMMORTAL(ch) )
	  do_help( ch, "imotd" );
	if ( ch->level == 50)
	  do_help( ch, "amotd" );
	if ( ch->level < 50 && ch->level > 0 )
	  do_help( ch, "motd" );
	if ( ch->level == 0 )
	  do_help( ch, "nmotd" );
	send_to_pager( "\n\rPress [ENTER] ", ch );
        d->connected = CON_READ_MOTD;
        break; /*this line, it says break statement not within loop or switch*/




Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #12 on Tue 21 Mar 2006 09:45 PM (UTC)

Amended on Tue 21 Mar 2006 10:58 PM (UTC) by Killfoobar

Message
and, finally:

bool pager_output( DESCRIPTOR_DATA *d )
{
  register char *last;
  CHAR_DATA *ch;
  int pclines;
  register int lines;
  bool ret;

  if ( !d || !d->pagepoint || d->pagecmd == -1 )
    return TRUE;
  ch = d->original ? d->original : d->character;
  pclines = UMAX(ch->pcdata->pagerlen, 5) - 1;
  switch(LOWER(d->pagecmd))
  {
  default:
    lines = 0;
    break;
  case 'b':
    lines = -1-(pclines*2);
    break;
  case 'r':
    lines = -1-pclines;
    break;
  case 'n':
    lines = 0;
    pclines = 0x7FFFFFFF;	/* As many lines as possible */
    break;
  case 'q':
    d->pagetop = 0;
    d->pagepoint = NULL;
    flush_buffer(d, TRUE);
    DISPOSE(d->pagebuf);
    d->pagesize = MAX_STRING_LENGTH;
    return TRUE;
  }
  while ( lines < 0 && d->pagepoint >= d->pagebuf )
    if ( *(--d->pagepoint) == '\n' )
      ++lines;
  if ( *d->pagepoint == '\n' && *(++d->pagepoint) == '\r' )
      ++d->pagepoint;
  if ( d->pagepoint < d->pagebuf )
    d->pagepoint = d->pagebuf;
  for ( lines = 0, last = d->pagepoint; lines < pclines; ++last )
    if ( !*last )
      break;
    else if ( *last == '\n' )
      ++lines;
  if ( *last == '\r' )
    ++last;
  if ( last != d->pagepoint )
  {
    if ( !write_to_descriptor(d->descriptor, d->pagepoint,
          (last-d->pagepoint)) )
      return FALSE;
    d->pagepoint = last;
  }
  while ( isspace(*last) )
    ++last;
  if ( !*last )
  {
    d->pagetop = 0;
    d->pagepoint = NULL;
    flush_buffer(d, TRUE);
    DISPOSE(d->pagebuf);
    d->pagesize = MAX_STRING_LENGTH;
    return TRUE;
  }
  d->pagecmd = -1;
  if ( xIS_SET( ch->act, PLR_ANSI ) )
      if ( write_to_descriptor(d->descriptor, "\033[1;36m", 7) == FALSE )
	return FALSE;
  if ( (ret=write_to_descriptor(d->descriptor,
	"(C)ontinue, (N)on-stop, (R)efresh, (B)ack, (Q)uit: [C] ", 0)) == FALSE )
	return FALSE;
  if ( xIS_SET( ch->act, PLR_ANSI ) )
  {
      char buf[32];

      if ( d->pagecolor == 7 )
	strcpy( buf, "\033[m" );
      else
	sprintf(buf, "\033[0;%d;%s%dm", (d->pagecolor & 8) == 8,
		(d->pagecolor > 15 ? "5;" : ""), (d->pagecolor & 7)+30);
      ret = write_to_descriptor( d->descriptor, buf, 0 );
  }
  return ret; /*this line, it says parse error at the end of input*/
}
Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #13 on Tue 21 Mar 2006 09:45 PM (UTC)
Message
there is one more, but i couldnt fit it, even on its own post
Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #14 on Tue 21 Mar 2006 10:36 PM (UTC)
Message
what is wrong has a comment and what the error message was
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.


107,293 views.

This is page 1, subject is 4 pages long: 1 2  3  4  [Next page]

Posting of new messages is disabled at present.

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.