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 ➜ Dual wielding/multiple attacks wrong

Dual wielding/multiple attacks wrong

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


Posted by Zeno   USA  (2,871 posts)  Bio
Date Tue 01 Aug 2006 10:03 PM (UTC)
Message
This is stock FUSS with 4 attacks (dual wield):
Quote:
Your slash nicks Test Goblin.
Your pierce cuts Test Goblin!
Your slash misses Test Goblin.
Your pierce nicks Test Goblin.
Your slash cuts Test Goblin!


This is my MUD with 5 attacks (dual wield):
Quote:
Your slash scratches A Fire Cat. You do 1215 points of damage.
You injure A Fire Cat! You do 559479 points of damage.
You scratch A Fire Cat. You do 1180 points of damage.
You graze A Fire Cat. You do 139624 points of damage.
You scratch A Fire Cat. You do 1236 points of damage.


The damage verbs are missing (slash etc). Maybe from the 2nd weapon. That isn't right. Anyone know where to start looking for this? I did install Samson's Weapon Proficiency Patch, I have a feeling that might be it. Might have installed it wrong, or something wasn't compatible.

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

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Tue 01 Aug 2006 10:08 PM (UTC)
Message
This kind of stuff is handled in dam_msg, I think. One of the parameters is the type of damage being done, which for weapons should be the weapon type. You would want to find all cases where dam_msg is called and make sure the values are sane.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #2 on Tue 01 Aug 2006 10:30 PM (UTC)
Message
Yeah I've been looking over some of the main fight functions, but don't see anything wrong. Something must be called wrong or the sort. I'll have to look into it some more.

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

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Tue 01 Aug 2006 10:49 PM (UTC)
Message
Basically you'll have to follow the call tree of calls to dam_msg, and make sure that every time that is called (or its parent functions) the damage type being sent in is the right one.

It's possible that you're passing in the weapon proficiency skill instead of the weapon's damage type. That's how the skill model tends to work; the skill number itself is used as the damage type.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #4 on Tue 01 Aug 2006 10:50 PM (UTC)
Message
One thing you could try would be to run this through the debugger, setting a breakpoint in dam_msg and looking at it when it happens, instead of trudging through the code, constructing it all in your head. Might be easier. :)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #5 on Wed 02 Aug 2006 12:45 AM (UTC)
Message
Pretty sure it's not new_dam_message at all. Although while looking it over, I noticed something odd.

This is the header:
void new_dam_message( CHAR_DATA *ch, CHAR_DATA *victim, int dam, int dt, OBJ_DATA *obj )

Below the function we find this:
#ifndef dam_message
void dam_message( CHAR_DATA *ch, CHAR_DATA *victim, int dam, int dt )
{
    new_dam_message(ch, victim, dam, dt);
}
#endif


In the damage function, we find this:
        dam_message(ch, victim, dam, dt);


How is dam_message calling new_dam_message with one short of the argument? It's missing the obj arg. That shouldn't compile.

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

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #6 on Wed 02 Aug 2006 12:48 AM (UTC)
Message
C is somewhat forgiving of that kind of thing even though you're not supposed to do it. It's also a rather strange check, because defining a function won't cause #ifdef function to be true.

But I wasn't talking about new_dam_message but rather how it gets called. Obviously somewhere you're not passing in the right damage type, which is why it reverts to the standard damage messages instead of using the weapon damage messages.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #7 on Wed 02 Aug 2006 12:52 AM (UTC)

Amended on Wed 02 Aug 2006 12:53 AM (UTC) by Zeno

Message
Yeah I know. Forgot to mention, dt is being passed as the wrong value. Since damage calls it, that may be the problem function.

Even more odd is that I posted the only call to the dam_message functions. Yet there are ifchecks in them for the obj (being passed in) while it will never be passed in.

[EDIT] Uh oh, it's not damage. It's called into damage wrong too.

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

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #8 on Wed 02 Aug 2006 01:00 AM (UTC)
Message
This is where the debugger starts being very useful. :-) If you don't use it you'll have to do a grep of some kind to find all places that call damage.

But, I would start with the stuff in violence_update, that actually takes care of the attacks. I think the function that launches the attacks is called multi_hit or something like that, and is called from violence_update.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #9 on Wed 02 Aug 2006 01:05 AM (UTC)

Amended on Wed 02 Aug 2006 01:11 AM (UTC) by Zeno

Message
Got it. It was in multi_hit. It was fixed in a more recent version of FUSS. Early on in multi_hit, it had this:
   if ( !dt || dt == TYPE_UNDEFINED )
        dt = TYPE_HIT;

Which wasn't good for various reasons. Commented it out.

Now I can get dual elements working. :)
Quote:
Your a lumber axe's Lightning attack overwhelms A Fire Cat's Fire element!
Your hack barely scratches A Fire Cat. You do 1487 points of damage.
A Fire Cat's Fire element disrupts your A No-Dachi's Ice attack!
Your slash barely scratches A Fire Cat. You do 653 points of damage.
Your a lumber axe's Lightning attack overwhelms A Fire Cat's Fire element!
Your hack barely scratches A Fire Cat. You do 1440 points of damage.
A Fire Cat's Fire element disrupts your A No-Dachi's Ice attack!
Your slash barely scratches A Fire Cat. You do 585 points of damage.
Your a lumber axe's Lightning attack overwhelms A Fire Cat's Fire element!
Your hack barely scratches A Fire Cat. You do 1421 points of damage.

Whoops, need to fix those names.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
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.


21,422 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.