Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Damagething damages the wrong dude.
Damagething damages the wrong dude.
2003-08-04, 8:55 AM #1
Code:
damaged:
   dmg_player=getsenderref();
   dmg_source=getsourceref();

   dmg=getparam(0);

   if(GetParam(1) == 32) dmg=0;
   if(getparam(1) == 64) dmg=0;
   
   if(getcurweaponmode(getsenderref()) < 0)
   {
   dot=thingviewdot(getsenderref(), getsourceref());
   factor=((dot*-1)+1)/2;
   dmg=dmg*factor;
   if(dmg < 1) dmg=0;
   }
   else
   {
   settimerex(0.1, 2, dmg, dmg_source);
   }
   ReturnEx(dmg);
   Return;

That handles blocking, where damage taken decreases the closer it is to Lvec.
Code:
touched:
   sender=getsenderref();
   source=getsourceref();

   if(getcurweaponmode(sender) >= 0)
   {
   dot=thingviewdot(sender, source);
   factor=((dot)+1)/2;
   damage=15*factor;
   damagething(source, damage, 0x10, sender);
   }
return;


This handles the attacking.

For some reason, when I try to damage the other player, it damages ME, in relation to HIS lvec. I can't figure out what's wrong or why it does this, any help would be appreciated.

That's seriously all I've changed in the cog, too.

------------------
Brutally honest since 1998
2003-08-04, 4:34 PM #2
Gee, thanks.

------------------
Brutally honest since 1998
2003-08-05, 6:24 AM #3
Could you be damaging each other?

Meaning if two players touched each other, I would guess it would trigger both their touched messages. He damages you and you damage him. ?

------------------
- Wisdom is 99% experience, 1% knowledge. -
- Wisdom is 99% experience, 1% knowledge. -
2003-08-05, 7:50 AM #4
Edit:

Well, combined with a sendtrigger, that worked perfectly.

You pwn.

------------------
Brutally honest since 1998

[This message has been edited by Checksum (edited August 05, 2003).]

↑ Up to the top!