Author Topic: Players flying away when shot and max player health  (Read 986 times)

I'm almost finished whit my Medic Gun but I would need to know two things:

1)
How can I prevent it that players fly away when they are hit by the gun?

2)
What is the standard max health?

I would be happy if someone could answer to these questions. :cookieMonster:

I'm almost finished whit my Medic Gun but I would need to know two things:

1)
How can I prevent it that players fly away when they are hit by the gun?

2)
What is the standard max health?

I would be happy if someone could answer to these questions. :cookieMonster:

1) Go in the .cs file and change the following:

Code: [Select]
AddDamageType("gun",   '<bitmap:add-ons/ci/gun> %1',    '%2 <bitmap:add-ons/ci/gun> %1',0.5,1);
datablock ProjectileData(gunProjectile)
{
   projectileShapeName = "./shapes/bullet.dts";
   directDamage        = 30;
   directDamageType    = $DamageType::gun;
   radiusDamageType    = $DamageType::gun;

   brickExplosionRadius = 0;
   brickExplosionImpact = true;          //destroy a brick if we hit it directly?
   brickExplosionForce  = 10;
   brickExplosionMaxVolume = 1;          //max volume of bricks that we can destroy
   brickExplosionMaxVolumeFloating = 2;  //max volume of bricks that we can destroy if they aren't connected to the ground

   impactImpulse      = 700;   <- these two values
   verticalImpulse   = 1000;     <- these two values
   explosion           = gunExplosion;
   particleEmitter     = bulletTrailEmitter;

   ...
   ...
};

Set them to 0.
If you are using the Rocket Launcher as the base script, go see the Explosion Datablock and change these two values:

Code: [Select]
datablock ExplosionData(rocketExplosion)
{
   //explosionShape = "";
   explosionShape = "./shapes/explosionSphere1.dts";
soundProfile = rocketExplodeSound;

   ...

   damageRadius = 3;
   radiusDamage = 100;

   impulseRadius = 6;            <-these two
   impulseForce = 4000;        <- these two
};

Change them to 0 as well. You will get impulse forces of 0 afterwards, which is pretty much no impulse at all.

2) I think it's 100, I'm not entirely certain.

Thanks,if I put -5 as Direct damage,it'll add 5 hp to the player being hit,right?

Thanks,if I put -5 as Direct damage,it'll add 5 hp to the player being hit,right?

I dunno, worth a try though.

Seems to not work - I've placed a arrow trap and used the Medic Gun the whole time while SanTing was attacked by the trap's arrows,had -50 as directDamage.
So..how to do that the shoots heal?

Code: [Select]
function gunProjectile::onDamage(%this,%obj,%col,%pos,%fade,%normal)
{
 //Ondamage has the "in minigame" checks, so will only be called if the player can be "Damaged" (Healed) by it
 %col.setDamageLevel(%col.getDamageLevel()-50);
 Parent::onDamage(%this,%obj,%col,%pos,%fade,%normal);
}

Change the 50 to however much you want it to heal.

Code: [Select]
function gunProjectile::onDamage(%this,%obj,%col,%pos,%fade,%normal)
{
 //Ondamage has the "in minigame" checks, so will only be called if the player can be "Damaged" (Healed) by it
 %col.setDamageLevel(%col.getDamageLevel()-50);
 Parent::onDamage(%this,%obj,%col,%pos,%fade,%normal);
}

Change the 50 to however much you want it to heal.
Thanks,I'll try that later.