Author Topic: Dumb Datablocks...  (Read 481 times)

I have a vehicle with a script that makes the vehicle explode when it flys into a wall. There's sapose to be a emitter that shows but it doesn't. I looked in the console and it says

Code: [Select]
Loading Add-On: Vehicle_Spitfire (CRC:-804758610)
Executing Add-Ons/Vehicle_Spitfire/server.cs.
Executing Add-Ons/Vehicle_Spitfire/Vehicle_Spitfire.cs.
Object 'SpitfireFinalExplosion' is not a member of the 'ExplosionData' data block class
Executing Add-Ons/Vehicle_Spitfire/support_shootonclick.cs.
Activating package: shootonclickspitfire_Pack
14 datablocks added.

But the .cs has a SpitfireFinalExplosion datablock in there already but for some reason it wont show up.

You need to define the datablock before having, say, a projectile reference it, or you'll get that error.

Code: [Select]
datablock ProjectileData(SpitfireFinalExplosionProjectile)
{
   directDamage        = 0;
   radiusDamage        = 0;
   damageRadius        = 0;
   explosion           = SpitfireFinalExplosion;

   directDamageType  = $DamageType::jeepExplosion;
   radiusDamageType  = $DamageType::jeepExplosion;

   explodeOnDeath = 1;

   armingDelay         = 0;
   lifetime            = 10;
};
datablock ExplosionData(SpitfireFinalExplosion)
{
   //explosionShape = "";
   lifeTimeMS = 150;

   soundProfile = vehicleExplosionSound;
   
   emitter[0] = vehicleFinalExplosionEmitter3;
   emitter[1] = vehicleFinalExplosionEmitter2;

   particleEmitter = vehicleFinalExplosionEmitter;
   particleDensity = 20;
   particleRadius = 1.0;


   faceViewer     = true;
   explosionScale = "1 1 1";

   shakeCamera = true;
   camShakeFreq = "7.0 8.0 7.0";
   camShakeAmp = "10.0 10.0 10.0";
   camShakeDuration = 0.75;
   camShakeRadius = 15.0;

   // Dynamic light
   lightStartRadius = 0;
   lightEndRadius = 20;
   lightStartColor = "0.45 0.3 0.1";
   lightEndColor = "0 0 0";

   //impulse
   impulseRadius = 15;
   impulseForce = 1000;
   impulseVertical = 2000;

   //radius damage
   damageRadius = 12;
   radiusDamage = 250;

   //burn the players?
   playerBurnTime = 5000;

};

Just move the ExplosionData above the ProjectileData.

It somehow works now... Thanks Truce :D