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 ➜ Odd combat messages

Odd combat messages

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


Posted by mudsonthetires   (5 posts)  Bio
Date Wed 27 Apr 2005 06:20 PM (UTC)
Message
I`m having some problems with combat. Basically, whenever a player hits a bob for damage, the next line has a little chunk of odd text in front of it. This text is sometimes something from another room in the area, and sometimes just nonsense(as far as I can tell. Let me give you an example:

Your slash lacerates a lemure! [1]
C"A lemure thrashes you! [1]

I can only think of two things that could be causing this, but I can't see in eaither of them what the problem is. In fight.c, I added an autoglance snippet to violence_update that looks like this:

if ( IS_AWAKE(ch) && ch->in_room == victim->in_room )
{
retcode = multi_hit( ch, victim, TYPE_UNDEFINED );
/*
* Just some checks to keep the code from going off at unnecessary times.
* Also moved the call to show_condition after the call to multi_hit. This
* is to make sure the damage shown is accurate. -Orion Elder
*/
if ( !IS_NPC( ch ) && xIS_SET( ch->act, PLR_AUTOGLANCE )
&& ch != NULL && victim != NULL && who_fighting( ch ) == victim
&& !char_died( victim ) && !char_died( ch ) )
{
show_condition( ch, victim );
}
}

And also in fight.c, I changed new_dam_message to numerically display the amount of damage inflicted or received. For regular hits:

if ( dt == TYPE_HIT )
{
sprintf( buf1, "$n %s $N%c [%i]", vp, punct, dam );
sprintf( buf2, "You %s $N%c [%i]", vs, punct, dam );
sprintf( buf3, "$n %s you%c [%i]", vp, punct, dam );
}

For poisoned hits:


if ( dt > TYPE_HIT && is_wielding_poisoned( ch ) )
{
if ( dt < TYPE_HIT + sizeof(attack_table)/sizeof(attack_table[0]) )
attack = attack_table[dt - TYPE_HIT];
else
{
sprintf(bugbuf, "Dam_message: bad dt %d from %s in %d.",
dt, ch->name, ch->in_room->vnum );
bug( bugbuf, 0);
dt = TYPE_HIT;
attack = attack_table[0];
}

sprintf( buf1, "$n's poisoned %s %s $N%c [%i]", attack, vp, punct, dam );
sprintf( buf2, "Your poisoned %s %s $N%c [%i]", attack, vp, punct, dam );
sprintf( buf3, "$n's poisoned %s %s you%c [%i]", attack, vp, punct, dam );
}

And another one of these:

sprintf( buf1, "$n's %s %s $N%c [%i]", attack, vp, punct, dam );
sprintf( buf2, "Your %s %s $N%c [%i]", attack, vp, punct, dam );
sprintf( buf3, "$n's %s %s you%c [%i]", attack, vp, punct, dam );

Any idea what the problem is? I can clarify anything you have questions about.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Wed 27 Apr 2005 07:00 PM (UTC)
Message
Does this happen only when fighting a certain mob? Or everyone, even players? Try using valgrind.

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

Posted by mudsonthetires   (5 posts)  Bio
Date Reply #2 on Thu 28 Apr 2005 03:04 AM (UTC)
Message
The messages happen no matter what you're fighting, and if you have autoglance toggled on or off. I'll try and take a look with valgrind.
Top

Posted by Txzeenath   USA  (54 posts)  Bio
Date Reply #3 on Fri 29 Apr 2005 12:49 PM (UTC)
Message
Hmm you could try adding a ch_printf or bug function in there to test what it could be.

Looking at the fight code you posted it all looks normal.. which is weird.

I'd print ch->name, victim->name, and anything else, than try printing $n .... Some weird stuff can happen... perhaps this is one of those times. It could very well simply be that your $n variable isn't getting the name correct. or your autoglance code is changing some stuff by being called.

Darkness comes along thy path, searching, wanting, calling wrath,
shadows awaken, release the light, one and only.. here to fight,
challenge the darkness, the shadows they call, hunting the living,
more and all. Roaring thunder, full of hate, a single bound, seals
your fate.

-Txzeenath

telnet://divineright.org:8088
Alumuble Arda -
*Player owned shops, clans, and housing
*Multiclass & Stat training
*Random mob name generation implemented and Overland mapping.
*Realistic equipment statistics
*Interactive enviroment(weather/sectors)
*Weapon sheaths(scabbards), Throwing weapons
*Automatic crash recovery, saving, and reporting without disconnecting
*Fully customizeable color, Automapper, "Smart" mobiles, Hiscore tables, and more!

Currently running AGE v1.9.6(Originated and modified from Smaug 1.4a)
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.


16,788 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.