Author Topic: "Flying Detection"  (Read 1052 times)

I am attempting to create a "Direct Hit".

So, I want to create a "Critical Hit" for when player is flying.

I wanted to know how. Can someone help me? c:

Just so you know, look at the kill message when you kill someone:

Inflicter () victim  -  the radius of the projectile killed them

Inflicter victim  -  the victim was killed right from the projectile.


It seems you're trying to reinvent the wheel?
« Last Edit: April 18, 2010, 08:11:19 PM by Kalphiter »


Just so you know, look at the kill message when you kill someone:

Inflicter () victim  -  the radius of the projectile killed them

Inflicter victim  -  the victim was killed right from the projectile.


It seems you're trying to reinvent the wheel?
That has nothing to do with it.

That has nothing to do with it.
Then what is he talking about?

Then what is he talking about?
If he fires a rocket in the air after a rocket jump at a person standing on the ground, the rocket will do more damage. When he lands, the damage modifier is gone and rockets will then do normal damage again.

If he fires a rocket in the air after a rocket jump at a person standing on the ground, the rocket will do more damage. When he lands, the damage modifier is gone and rockets will then do normal damage again.
No; if he fires a rocket and it hits someone who is in the air they take more damage.

No; if he fires a rocket and it hits someone who is in the air they take more damage.
I don't think so. The way that I interpreted it is also how it works in Tf2. (And the weapon is also called the 'Direct Hit')...Unless I am smoking crack.

I don't think so. The way that I interpreted it is also how it works in Tf2. (And the weapon is also called the 'Direct Hit')...Unless I am smoking crack.
In TF2 the direct hit is a weapon that does more damage against flying enemies.

In TF2 the direct hit is a weapon that does more damage against flying enemies.
Hmm, I guess I don't know what I am talking about then. You're right, sorry about that :/

Hmm, I guess I don't know what I am talking about then. You're right, sorry about that :/
The code will end up being mostly the same either way so...

I had made one of these before. Base damage was 70, and if you hit someone in the air, it would do an extra 35 damage to them. It also made you play the win emote so you know you got the bonus damage for it.

Quote

function directHitProjectile::damage(%this,%obj,%col,%a,%pos,%b)
{
   Parent::damage(%this,%obj,%col,%a,%pos,%b);
   %class = %col.getClassName();
   
   if(%class !$= "Player" && %class !$= "AIPlayer")
      return;
   
   %type = $TypeMasks::fxBrickAlwaysObjectType |
           $TypeMasks::PlayerObjectType        |
           $TypeMasks::StaticObjectType        |
           $TypeMasks::TerrainObjectType       |
           $TypeMasks::VehicleObjectType;
   
   %pos = %col.getPosition();
   %ray = firstWord(containerRaycast(%pos,vectorAdd(%pos,"0 0 -3"),%type,%col));
   
   if(!isObject(%ray))
   {
      %pl = %obj.sourceObject;
      %pl.emote(winStarProjectile);
      serverPlay3D(rewardSound,%pl.getEyePoint());
      
      %col.getDatablock().damage(%col,%obj,%pos,35,%this.directDamageType);
   }
}

Thanks, Truce. c:

Well now I just have to make it, fire the Critical Emote.
« Last Edit: April 19, 2010, 11:45:03 AM by Khain »

I believe you have to make your emote a projectile and insert it into this line:
Code: [Select]
     %pl.emote(winStarProjectile);

Please correct me if I'm wrong, someone.