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
➜ Fighting problems
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Saryn
USA (28 posts) Bio
|
Date
| Thu 28 Aug 2003 01:14 AM (UTC) |
Message
|
OK I have a slight problem. (dont I always?) I added damage numbers to the fight spam by popular request, and thanks to Yourdrunkendad. I changed:
sprintf( buf1, "$n's %s %s $N%c (%d)", attack, vp, punct );
sprintf( buf2, "Your %s %s $N%c (%d)", attack, vp, punct );
sprintf( buf3, "$n's %s %s you%c (%d)", attack, vp, punct );
to read
sprintf( buf1, "$n's %s %s $N%c (%d)", attack, vp, punct, dam );
sprintf( buf2, "Your %s %s $N%c (%d)", attack, vp, punct, dam );
sprintf( buf3, "$n's %s %s you%c (%d)", attack, vp, punct, dam );
Compiled and tried to fight. For future reference, I was using barehand damged (unarmed) when I tested this. I found a local mob and attacked him. I get this..
Your (null) jolts Rupart! (2)
then the mud crashes. Also in the console window I get
3 [main] SEMBIA 1924 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
593 [main] SEMBIA 1924 open_stackdumpfile: Dumping stack trace to sembia.exe
.stackdump
Means nothing to me. So then I take the , dam out of those 3 lines, recompile and fight the same mob.
Log: [*****] BUG: Dam_message: bad dt 204 from rupart in 2000.
Rupart brushes you.
Log: [*****] BUG: Dam_message: bad dt 170 from rupart in 2000.
Mud doen't crash, but I get those messages. Barehand or with a weapon..I think the message is forms omething that mob is doing cause no other mob gives me that when I fight them that I've seen. Anybody have any thoughts? | Top |
|
Posted by
| Meerclar
USA (733 posts) Bio
|
Date
| Reply #1 on Thu 28 Aug 2003 03:31 AM (UTC) |
Message
| Looks like you dont have a damage type assigned to your unarmed combat, you'll need to assign one and the problem should disappear. |
Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org | Top |
|
Posted by
| Boborak
USA (228 posts) Bio
|
Date
| Reply #2 on Thu 28 Aug 2003 04:35 PM (UTC) |
Message
| Creating a new post asking a question you've already asked normally creates less then favorable results >:-| Anyway, I've personally been a bit busy lately but I've kept your previous post in mind. I don't have my code handy so I can't verify all of this. But here's a few things I've noticed. Firstly your error message is returning a seemingly random 'dt' that is much higher then it should be. That's the first thing you need to start looking at. It appears that the 'dt' your code is returning is actually the damage. Secondly, ensure your barehanded damage types are listed in mud.h (search for the blunt/pierce types and use that as an example). Next ensure that you have amended the attack_table in const.c with your new damage_types. Adding new damage types is normally an ugly process the first time you do it and it's easy to miss something. But I really think you need to look at your code and figure out why your dt's are being returned as high as 200.
-Bobo | Top |
|
Posted by
| Saryn
USA (28 posts) Bio
|
Date
| Reply #3 on Fri 29 Aug 2003 12:14 AM (UTC) |
Message
| Bad thing is, is there are no new damage types. I tried added samson's snippet but that gave less favorable results in the the end. The weapontypes ae what the original SRC gave. And I craeated a new topic mostly compile all the new things I have cause this isnt really about the damage numbers in the fight spam anymore. | Top |
|
Posted by
| Yourdrunkendad
(35 posts) Bio
|
Date
| Reply #4 on Fri 29 Aug 2003 01:17 AM (UTC) |
Message
| Check the typedef enum for damage types in mud.h
(around line 2470)
Mine looks like this
typedef enum
{
DAM_HIT, DAM_SLICE, DAM_STAB, DAM_SLASH, DAM_WHIP, DAM_CLAW,
DAM_BLAST, DAM_POUND, DAM_CRUSH, DAM_GREP, DAM_BITE, DAM_PIERCE,
DAM_SUCTION, DAM_BOLT, DAM_ARROW, DAM_DART, DAM_STONE, DAM_PEA
} damage_types;
I believe dam_hit is the damage type for unarmed combat, see if that is there, if it isn't add it.
See if that helps if not, post back. And we'll go from there. I could be totally wrong, after all, I drink windex on a daily basis. |
Shampoo is for sissies real men use poo*
[werd]thewerd.com "Smacking Your Mom Then Running Away" | Top |
|
Posted by
| Saryn
USA (28 posts) Bio
|
Date
| Reply #5 on Fri 29 Aug 2003 01:38 AM (UTC) |
Message
| Heh yours looks like mine! Woohoo. I think dam_hit defines unarmed combat too. I just find it weird that when I add dam at the end of those 3 lines it returns the null for damagetype when fighting, then the stackdump. | Top |
|
Posted by
| Yourdrunkendad
(35 posts) Bio
|
Date
| Reply #6 on Fri 29 Aug 2003 02:18 AM (UTC) Amended on Fri 29 Aug 2003 02:19 AM (UTC) by Yourdrunkendad
|
Message
| well.. when I added that (, dam) in my fight.c
It doesn't show damage to unarmed hits, only if you're wielding a weapon, casting a spell, using a skill, etc.. which is fine by me, b/c the only time people are going to be getting hit for unarmed damage is against mobs, and I don't really want the whole room seeing how much the tank is getting hit for anyway. However I have no problems with unarmed combat causing crashes or dumps and the like.
as boborak said check const.c attack_table.. it should look like this in stock 1.4a
char * const attack_table [18] =
{
"hit",
"slice", "stab", "slash", "whip", "claw",
"blast", "pound", "crush", "grep", "bite",
"pierce", "suction", "bolt", "arrow", "dart",
"stone", "pea"
};
also check a little further down right below
char ** const s_message_table[18]
and make sure that
s_generic_messages, /* hit */ is in the list
You'll also want to take a look in fight.c in
weapon_prof_bonus_check
which looks like this in stock smaug 1.4a
int weapon_prof_bonus_check( CHAR_DATA *ch, OBJ_DATA *wield, int *gsn_ptr )
{
int bonus;
bonus = 0; *gsn_ptr = -1;
if ( !IS_NPC(ch) && ch->level > 5 && wield )
{
switch(wield->value[3])
{
default: *gsn_ptr = -1; break;
case DAM_HIT:
case DAM_SUCTION:
case DAM_BITE:
case DAM_BLAST: *gsn_ptr = gsn_pugilism; break;
case DAM_SLASH:
case DAM_SLICE: *gsn_ptr = gsn_long_blades; break;
case DAM_PIERCE:
case DAM_STAB: *gsn_ptr = gsn_short_blades; break;
case DAM_WHIP: *gsn_ptr = gsn_flexible_arms; break;
case DAM_CLAW: *gsn_ptr = gsn_talonous_arms; break;
case DAM_POUND:
case DAM_CRUSH: *gsn_ptr = gsn_bludgeons; break;
case DAM_BOLT:
case DAM_ARROW:
case DAM_DART:
case DAM_STONE:
case DAM_PEA: *gsn_ptr = gsn_missile_weapons; break;
}
if ( *gsn_ptr != -1 )
bonus = (int) ((LEARNED(ch, *gsn_ptr) -50)/10);
/* Reduce weapon bonuses for misaligned clannies.
if ( IS_CLANNED(ch) )
{
bonus = bonus * 1000 /
( 1 + abs( ch->alignment - ch->pcdata->clan->alignment ) );
}*/
if ( IS_DEVOTED(ch) )
bonus -= ch->pcdata->favor / -400 ;
}
return bonus;
}
If everything looks ok, then I'm baffled, which doesn't take much mind you, but good luck.
|
Shampoo is for sissies real men use poo*
[werd]thewerd.com "Smacking Your Mom Then Running Away" | Top |
|
Posted by
| Saryn
USA (28 posts) Bio
|
Date
| Reply #7 on Fri 29 Aug 2003 10:12 AM (UTC) |
Message
| I seriously don't think the mud like me. I put the code back in, compiled and it worked fine. Might have been me transfering a mob into a proto area and attacking it. Who knows. But now, I see what you said is true. When you attack a mob unarmed you don't see damage and when they attack you unarmed, you don't see the damage. Do you know any way to change this? | Top |
|
Posted by
| Boborak
USA (228 posts) Bio
|
Date
| Reply #8 on Fri 29 Aug 2003 03:30 PM (UTC) Amended on Fri 29 Aug 2003 03:31 PM (UTC) by Boborak
|
Message
| You should get in the habit of ensuring you do a clean compile when doing a large number of changes. You'd be amazed how many weird SEGFAULTS can be cleared up with a clean compile. If your system can handle it, I'd reccommend a clean compile after every change.
For the damage issue, there's a section of code that may be the issue.
if ( dt == TYPE_HIT || dam==0 )
{
sprintf( buf1, "$n %s $N%c", vp, punct );
sprintf( buf2, "You %s $N%c", vs, punct );
sprintf( buf3, "$n %s you%c", vp, punct );
}
else
It's seperate from the first chunk of code I think you modified to show damage. Since I believe this statement would be true if unarmed I think this may be why you're not getting your damage message. Something to look into at least. Hope it helps. | Top |
|
Posted by
| Saryn
USA (28 posts) Bio
|
Date
| Reply #9 on Fri 29 Aug 2003 09:47 PM (UTC) |
Message
| I do, do a clean compiles every time. I might have just done somrthing stupid knowing me. Who knows. ALl I know is it works now. THank you! I thought I saw that line this morning when I was fixing it around. Guess I went over it in my rush. AH well. Ok one more question.
One of my immorts is uing a spell. Spiral blast. When hes fighitng he gets this message (over log to everybody) when he uses the spell.
Log: [*****] BUG: Dam_message: bad dt 148 from Thomas in 4002.
Log: [*****] BUG: Dam_message: bad dt 148 from Thomas in 4002.
Log: [*****] BUG: Dam_message: bad dt 148 from Thomas in 4002.
Log: [*****] BUG: Dam_message: bad dt 148 from Thomas in 4002.
Log: [*****] BUG: Dam_message: bad dt 148 from Thomas in 4002.
148 is the spell number in slookup and 4002 is the room he is in when he is fighting, but the bad dt doesn't click any lights on in my mind. THe slookup looks fine on the spell so I dunno. any thoughts form the great coders and mudders? | Top |
|
Posted by
| Yourdrunkendad
(35 posts) Bio
|
Date
| Reply #10 on Sat 30 Aug 2003 08:21 PM (UTC) |
Message
| It sounds to me like someone forgot to set a damage type to the spell.
Do an slookup on the spell and see if "DamType:"
is set to something, ie: drain, fire, cold etc.
If it is, try and cast a spell with a similar damage type
ie. if it's drain cast another drain spell and see if you have problems with that as well, that should narrow things down. |
Shampoo is for sissies real men use poo*
[werd]thewerd.com "Smacking Your Mom Then Running Away" | Top |
|
Posted by
| Saryn
USA (28 posts) Bio
|
Date
| Reply #11 on Sat 30 Aug 2003 08:55 PM (UTC) |
Message
| Hmm so spell is not really a damage type. Doh. Neither is Skill. OK now lfe is starting to make sense again! THank you! | 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.
29,499 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top