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 ➜ Changing Stats

Changing Stats

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


Posted by Toy   (206 posts)  Bio
Date Fri 19 Nov 2004 10:26 PM (UTC)

Amended on Fri 19 Nov 2004 10:32 PM (UTC) by Toy

Message
I went through and changed all calls to the 7 stock stats in SMAUG to be just 4 stats: strength, psyche, endurance and warfare. I compiled cleanly, booted and received this upon log in:

Fri Nov 19 18:21:50 2004 :: The Worlds of Amber ready at address PICCOLO on port 3000.
Fri Nov 19 18:21:54 2004 :: Sock.sinaddr: 127.0.0.1, port 3553.
Fri Nov 19 18:21:59 2004 :: [*****] FILE: ../player/t/Toy LINE: 64
Fri Nov 19 18:21:59 2004 :: [*****] BUG: Fread_char: no match: AttrMod
Fri Nov 19 18:21:59 2004 :: [*****] FILE: ../player/t/Toy LINE: 64
Fri Nov 19 18:21:59 2004 :: [*****] BUG: Fread_char: no match: AttrMod
Fri Nov 19 18:21:59 2004 :: Toy@127.0.0.1((ident not active)) has connected.

Looked at my fread_char and I couldn't seem to find the problem. Then, just trsting other things, I typed score, and the mud crashed. Not sure what's wrong. When I mstat myself, everything shows fine, but score will drop the segment core.

Anyone have any ideas? I'll post a backtrace on do_score in a minute.

-Toy

-EDIT-
Offhane, and I don't know if this will matter any, but oldscore works fine as well.

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Toy   (206 posts)  Bio
Date Reply #1 on Fri 19 Nov 2004 10:29 PM (UTC)
Message
Breakpoint 1, do_score (ch=0xa293288, argument=0x23eb55 "") at player.c:43
43 if (IS_NPC(ch))
(gdb) n
49 set_pager_color(AT_SCORE, ch);
(gdb) n
51 pager_printf(ch, "\n\r&zScore for %s%s%s.&w\n\r", ch->pcdata->pretitle, ch->nam
e, ch->pcdata->title);
(gdb) n
52 if ( get_trust( ch ) != ch->level )
(gdb) n
55 send_to_pager("&w--------------------------------------------------------------
--------------\n\r", ch);
(gdb) n
57 pager_printf(ch, "&zLEVEL: &w%-3d &zRACE : &w%-10.10s &z
PLAYED: &w%d hours\n\r", ch->level, capitalize(get_race(ch)), (get_age(ch) - 17) * 2);
(gdb) n
58 pager_printf(ch, "&zYEARS: &w%-6d &zCLASS: &w%-12.12s &zLOG IN: &w%s\
r", get_age(ch), capitalize(get_class(ch)), ctime(&(ch->logon)) );
(gdb) n
60 if (ch->level >= 15
(gdb) n
63 pager_printf(ch, "&zSTRENGTH : &w%2.2d &zHITROLL: &w%-4d
&zSAVED: &w%s\r", get_curr_strength(ch), GET_HITROLL(ch), ch->save_time ? ctime(&(ch->save_
time)) : "no save this session\n" );
(gdb) n
64 pager_printf(ch, "&zPSYCHE : &w%2.2d &zDAMROLL: &w%-4d
&zTIME: &w%s\r", get_curr_psyche(ch), GET_DAMROLL(ch), ctime(&current_time) );
(gdb) n
72 if (GET_AC(ch) >= 101)
(gdb) n
74 else if (GET_AC(ch) >= 80)
(gdb) n
76 else if (GET_AC(ch) >= 55)
(gdb) n
77 sprintf(buf, "shabby and threadbare");
(gdb) n
103 if (ch->level > 24)
(gdb) n
104 pager_printf(ch, "&zENDURANCE : &w%2.2d &zARMOR: &w%4.4d, %s\n\r"
, get_curr_endurance(ch), GET_AC(ch), buf);
(gdb) n
108 if (ch->alignment > 900)
(gdb) n
110 else if (ch->alignment > 700)
(gdb) n
112 else if (ch->alignment > 350)
(gdb) n
114 else if (ch->alignment > 100)
(gdb) n
116 else if (ch->alignment > -100)
(gdb) n
117 sprintf(buf, "neutral");
(gdb) n
127 if (ch->level < 10)
(gdb) n
130 pager_printf(ch, "&zWARFARE : &w%2.2d &zALIGN: &w%+4.4d, %-14.14s
&zITEMS: &w%5.5d (max %5.5d)\n\r", get_curr_warfare(ch), ch->alignment, buf, ch->carry_num
ber, can_carry_n(ch));
(gdb) n
132 switch (ch->position)
(gdb) n
159 sprintf(buf, "standing");
(gdb) n
191 pager_printf(ch, "&zPOS'N: &w%-21.21s &zWEIGHT: &w%5.5d (MAX %7.7d)\n\r", ch->
carry_weight, can_carry_w(ch));
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
0x610d2874 in memchr () from /home/KK and Li Li/smaug/area/cygwin1.dll
(gdb)

This is what I got for do_score. Been looking through the fread_char's info and haven't been getting any luck.

-Toy

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #2 on Sat 20 Nov 2004 02:08 AM (UTC)
Message
Ok, as for your pfiles, it looks like its may still have some of the old data in it, like the attribute modifications for some of the stats.

As for score, the issue, obviously, is the last line before it crashed:
pager_printf(ch, "&zPOS'N: &w%-21.21s &zWEIGHT: &w%5.5d (MAX %7.7d)\n\r", ch->
carry_weight, can_carry_w(ch));
You'll notice two things, first that there are 3 variables to be printed, but only 2 are supplied, your missing the string for someones position. Secondly, and more likely why it crashed, is that it was trying to print an integer variable as a string, since it matched the first %* with the first supplied argument. If you add a 3rd argument before ch->carry_weight(the string representing their position), it should work out.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Toy   (206 posts)  Bio
Date Reply #3 on Sat 20 Nov 2004 02:45 AM (UTC)

Amended on Sun 21 Nov 2004 02:54 AM (UTC) by Toy

Message
Wow. Thanks Greven. Been looking at that all day and just kept looking past it. Now all I gotta do is track down and fix my AttrMod issues.

-Toy

--EDIT--------------------------------------------------------

Added to my "DUH" moments. My AttrMod issues came from a missing call at the in fread_char:

fMatch = TRUE;

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
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.


14,838 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.