Author Topic: Multible debris types.  (Read 597 times)

Is it possable to make more than one type of gunshell spawned through states, like gunshells on one state, and an empty clip on a different state.

Half-Life pulse rifle? :3

You could try spawning explosions relative to the player with debris set.

Is there a function for just debris?

You cannot manually spawn debris. Unfortunantly, debris can't be spawned without either the weapon image (which only supports one kind per image datablock as far as I know) or an explosion which also can't be spawned without a projectile.

Code: [Select]
datablock ExplosionData(debrisSpawnerExplosion)
{
className = "ExplosionData";
debris = %debris;
debrisNum = "1";
debrisNumVariance = "0";
debrisPhiMax = "0";
debrisPhiMin = "0";
debrisThetaMax = "0";
debrisThetaMin = "0";
debrisVelocity =  %speed;
debrisVelocityVariance = "0";
delayMS = "0";
delayVariance = "0";
explosionScale = "1 1 1";
faceViewer = "1";
lifetimeMS = "150";
lifetimeVariance = "0";
offset = "0";
particleDensity = "10";
particleRadius = "1";
playSpeed = "1";
shakeCamera = "0";
damageRadius = "0";
impulseForce = "0";
impulseRadius = "0";
radiusDamage = "0";
};

datablock ProjectileData(debrisSpawnerProjectile)
{
directDamage = 0;
radiusDamage = 0;
damageRadius = 0;
explosion = debrisSpawnerExplosion;
directDamageType = $DamageType::Generic;
radiusDamageType = $DamageType::Generic;
explodeOnDeath = 1;
armingDelay = 0;
lifetime = 10;
};

This will create the datablocks needed to spawn %debris at speed %speed. You can then spawn the projectile moving in the direction you want the debris to go:
Code: [Select]
   %p = new Projectile()
   {
      dataBlock = debrisSpawnerProjectile;
      initialPosition = %pos;
      initialVelocity = %vel;
      client = %client;
      sourceClient = %client;
   };
   %p.explode();

is it posable to change the %pos, to the ejectpoint?

No idea. You could do it relative to the muzzlepoint.

vectorAdd(%obj.getMuzzlePoint(0),vectorScale(%obj.getMuzzleVector(0),-0.5)); would move it back from wherever it normally fires by one brick width which would be close enough to an ejection point for a standard-sized gun.