Game Development Community

Noob Explosion Data Compiling Errors

by Benjamin Stoneking · in General Discussion · 04/30/2008 (5:16 pm) · 1 replies

Ok so I've been spending some time learning the engine, and I've been trying to write a script for the torque logo so that it can take damage and explode when its shot with the crossbow. After getting it written down and compiled, it runs but I keep running into these errors.

Object 'LogoExplosionPed' is not a member of the 'ParticleEmitterData' data block class

and

Object 'LogoExplosion' is not a member of the 'ExplosionData' data block class

Here is the script content...

//-----------------------------------------------------------------------------
// Torque Game Engine 
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------

datablock StaticShapeData(TorqueLogoItem)
{
   category = "Items";
   shapeFile = "~/data/shapes/3dtorquelogo/torque_logo.dts";
   maxDamage = 100;
   disabledLevel = 80;
   destroyedLevel = 100;
   renderWhenDestroyed = false;
   explosion = "LogoExplosion";
};

function TorqueLogoItem::onAdd( %DB, %theShape ) {
	%theShape.applyDamage( %someDamage );
}

function ShapeBase::determineDamageState( %theShape ) {
%curDamage = %theShape.getDamageLevel();
%disabledDamage = %theShape.getDatablock().disabledLevel;
%destroyedDamage = %theShape.getDatablock().destroyedLevel;

if( %curDamage >= %destroyedDamage ) {
	%theShape.setDamageState( Destroyed );
}
else if( %curDamage >= %disabledDamage ) {
	%theShape.setDamageState( Disabled );
}
else {
	%theShape.setDamageState( Enabled );
	}
}

datablock ExplosionData( LogoExplosion ) {
	delayMS = 4000;
	delayVariance = 1000;
	explosionScale = 5.0;
	sizes[0] = "1.0 1.0 1.0";
	sizes[1] = "1.0 1.0 1.5";
	sizes[2] = "1.0 1.0 2.0";
	sizes[3] = "0.1 0.1 0.1";
	times[0] = 0.0;
	times[1] = 0.33;
	times[2] = 0.66;
	times[3] = 1.0;
	faceViewer = true;
	playSpeed = 1.0;
	lifetimeMS = 2000;
	lifeTimeVariance = 100;
	particleEmitter = "LogoExplosionPED";
	particleDensity = 0.6;
	particleRadius = 1.2;
};

datablock ParticleData( LogoExplosionPD ) {
   textureName          = "~/data/shapes/particles/fire";
   dragCoefficient      = 1;
   gravityCoefficient   = 0;
   inheritedVelFactor   = 0;
   windCoefficient      = 0;
   constantAcceleration = 0;
   lifetimeMS           = 800;
   lifetimeVarianceMS   = 100;
   spinSpeed     = 0;
   spinRandomMin = -90.0;
   spinRandomMax =  90.0;
   useInvAlpha   = true;

   colors[0]     = "0.8 0.3 0.0 1.0";
   colors[1]     = "0.1 0.1 0.1 0.7";
   colors[2]     = "0.1 0.1 0.1 0.0";

   sizes[0]      = 0.2;
   sizes[1]      = 0.3;
   sizes[2]      = 0.4;

   times[0]      = 0.1;
   times[1]      = 0.2;
   times[2]      = 1.0;
};

datablock ParticleEmitterData( LogoExplosionPED )
{
   ejectionPeriodMS = 30;
   periodVarianceMS = 0;
   ejectionVelocity = 0.0;
   velocityVariance = 0.0;
   ejectionOffset   = 0.0;
   thetaMin         = 170;
   thetaMax         = 180;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   //overrideAdvances = false;
   //orientParticles  = true;
   lifetimeMS       = 5000;
   particles = "LogoExplosionPD";
};

please tell me what i'm doing wrong if you know... i'm just starting out and i need some help.

#1
05/06/2008 (3:08 am)
I might be wrong but I think you need to define before they are called in for use.
so LogoExplosion uses LogoExplosionPED so you need to define LogoExplosionPED before LogoExplosion .
TorqueLogoItem uses LogoExplosion so define LogoExplosion before TorqueLogoItem and so on.