Author Topic: How to make spear to stick into bricks?  (Read 1245 times)

Hello.

I am working on making spear stick into wall. (I am a newbie at making addons.) Can someone tell me how?
my try:

//projectile
AddDamageType("JavelinDirect",   '<bitmap:add-ons/Weapon_Javelin/CI_javelin> %1',       '%2 <bitmap:add-ons/Weapon_Javelin/CI_javelin> %1',1,1);
AddDamageType("JavelinRadius",   '<bitmap:add-ons/Weapon_Javelin/CI_javelinRadius> %1', '%2 <bitmap:add-ons/Weapon_Javelin/CI_javelinRadius> %1',1,0);
datablock ProjectileData(javelinProjectile)
{
   projectileShapeName = "./javelinProjectile.dts";
   directDamage        = 50;
   directDamageType  = $DamageType::JavelinDirect;
   radiusDamageType  = $DamageType::JavelinRadius;
   impactImpulse      = 1000;
   verticalImpulse      = 1000;
   explosion           = spearExplosion;
   particleEmitter     = spearTrailEmitter;

   brickExplosionRadius = 0;
   brickExplosionImpact = true; //destroy a brick if we hit it directly?
   brickExplosionForce  = 20;
   brickExplosionMaxVolume = 200;
   brickExplosionMaxVolumeFloati ng = 200;

   muzzleVelocity      = 50;
   velInheritFactor    = 1;

   armingDelay         = 0;
   lifetime            = 20000;
   fadeDelay           = 19500;

   isBallistic         = true;
   bounceAngle         = 170; //stick almost all the time
   minStickVelocity    = 10;
   bounceElasticity    = 0.2;
   bounceFriction      = 0.01;
   gravityMod = 0.50;

   hasLight    = false;
   lightRadius = 3.0;
   lightColor  = "0 0 0.5";

   uiName = "Javelin";

Renamed to javelin cause Spear is already made and overwrites edited spear.

Quote
datablock ProjectileData(arrowProjectile)
{
   projectileShapeName = "./arrow.dts";

   directDamage        = 30;
   directDamageType    = $DamageType::ArrowDirect;

   radiusDamage        = 0;
   damageRadius        = 0;
   radiusDamageType    = $DamageType::ArrowDirect;

   explosion             = arrowExplosion;
   stickExplosion        = arrowStickExplosion;
   bloodExplosion        = arrowStickExplosion;
   particleEmitter       = arrowTrailEmitter;
   explodeOnPlayerImpact = true;
   explodeOnDeath        = true; 

   armingDelay         = 4000;
   lifetime            = 4000;
   fadeDelay           = 4000;

   isBallistic         = true;
   bounceAngle         = 170; //stick almost all the time
   minStickVelocity    = 10;
   bounceElasticity    = 0.2;
   bounceFriction      = 0.01;   
   gravityMod = 0.25;

   hasLight    = false;
   lightRadius = 3.0;
   lightColor  = "0 0 0.5";

   muzzleVelocity      = 65;
   velInheritFactor    = 1;

   uiName = "Arrow";
};

Here is the projectile data used by the default bow. Just match your projectile data with this, you should get the effect you want.

Here is the projectile data used by the default bow. Just match your projectile data with this, you should get the effect you want.

Thx alot, made it
« Last Edit: June 07, 2012, 02:00:08 PM by superluigi123 »

That's not all you have to do, you need to add an arming delay. You should also set brickExplosionImpact to false, you don't want it trying to stick to bricks it has destroyed.

Quote
That's not all you have to do, you need to add an arming delay. You should also set brickExplosionImpact to false, you don't want it trying to stick to bricks it has destroyed.
Listen to him since I don't know much about weapon addons.