Author Topic: Staff lightsaber projectile problems  (Read 641 times)

My staff lightsaber wont fire a projectile on swings or make sounds, and i dont understand what Ive done wrong. Could someone please help me out?

Heres the code:
Code: [Select]
//dmls.cs
datablock AudioProfile(dmlsDrawSound)
{
   filename    = "./lrlsDraw.wav";
   description = AudioClosest3d;
   preload = true;
};
datablock AudioProfile(dmlstuffSound)
{
   filename    = "./lrlstuff.wav";
   description = AudioClosest3d;
   preload = true;
};
datablock AudioProfile(dmlsLoopSound)
{
   filename    = "./lrlsLoop.wav";
   description = AudioCloseLooping3d;
   preload = true;
};
datablock AudioProfile(dmlswingSound)
{
   filename    = "./lrlsSwing.wav";
   description = AudioClosest3d;
   preload = true;
};



//effects
datablock ParticleData(dmlloveplosionParticle)
{
   dragCoefficient      = 2;
   gravityCoefficient   = 1.0;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   spinRandomMin = -90;
   spinRandomMax = 90;
   lifetimeMS           = 500;
   lifetimeVarianceMS   = 300;
   textureName          = "./spark";
   colors[0]     = "1.0 0.9 0.0 0.9";
   colors[1]     = "0.9 0.8 0.0 0.0";
   sizes[0]      = 0.2;
   sizes[1]      = 0.1;
};

datablock ParticleEmitterData(dmlloveplosionEmitter)
{
   ejectionPeriodMS = 4;
   periodVarianceMS = 0;
   ejectionVelocity = 5;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 60;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "dmlloveplosionParticle";

   uiName = "LEGO Mauls Lightsaber Hit";
};

datablock ExplosionData(dmlloveplosion)
{
   //explosionShape = "";
   lifeTimeMS = 300;

   soundProfile = dmlstuffSound;

   particleEmitter = dmlloveplosionEmitter;
   particleDensity = 8;
   particleRadius = 0.2;

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

   shakeCamera = true;
   camShakeFreq = "20.0 22.0 20.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 0.5;
   camShakeRadius = 10.0;

   // Dynamic light
   lightStartRadius = 3;
   lightEndRadius = 0;
   lightStartColor = "1.0 0.0 0.0 0.8";
   lightEndColor = "0.8 0.0 0.0 0.5";
};


//projectile
AddDamageType("dmls",   '<bitmap:add-ons/Pack_LEGOweapons/CI_dmls> %1',    '%2 <bitmap:add-ons/Pack_LEGOweapons/CI_dmls> %1',0.75,1);
datablock ProjectileData(dmlsProjectile)
{
   directDamage        = 40;
   directDamageType  = $DamageType::dmls;
   radiusDamageType  = $DamageType::dmls;
   explosion           = dmlloveplosion;
   //particleEmitter     = as;

   muzzleVelocity      = 50;
   velInheritFactor    = 1;

   armingDelay         = 0;
   lifetime            = 100;
   fadeDelay           = 70;
   bounceElasticity    = 0;
   bounceFriction      = 0;
   isBallistic         = false;
   gravityMod = 0.0;

   hasLight    = true;
   lightRadius = 3.0;
   lightColor  = "1.0 0 0 0.5";

   uiName = "LEGO Mauls Lightsaber Slice";
};


//////////
// item //
//////////
datablock ItemData(dmlsItem)
{
category = "Weapon";  // Mission editor category
className = "Weapon"; // For inventory system

// Basic Item Properties
shapeFile = "./dmlsspawned.dts";
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;

//gui stuff
uiName = "LEGO Mauls Lightsaber";
iconName = "./icon_dmls";
doColorShift = false;
colorShiftColor = "0.471 0.471 0.471 1.000";

// Dynamic properties defined by the scripts
image = dmlsImage;
canDrop = true;
};

////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(dmlsImage)
{
   // Basic Item properties
   shapeFile = "./dmls.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   offset = "0 0 0";
   //eyeOffset = "0 0 0";

   // When firing from a point offset from the eye, muzzle correction
   // will adjust the muzzle vector to point to the eye LOS point.
   // Since this weapon doesn't actually fire from the muzzle point,
   // we need to turn this off.  
   correctMuzzleVector = false;

   eyeOffset = "0 0 0";

   // Add the WeaponImage namespace as a parent, WeaponImage namespace
   // provides some hooks into the inventory system.
   className = "WeaponImage";

   // Projectile && Ammo.
   item = dmlsItem;
   ammo = " ";
   projectile = dmlsProjectile;
   projectileType = Projectile;

   //melee particles shoot from eye node for consistancy
   melee = true;
   doRetraction = false;
   //raise your arm up or not
   armReady = true;

   //casing = " ";
   doColorShift = true;
   colorShiftColor = "0.471 0.471 0.471 1.000";

   // Images have a state system which controls how the animations
   // are run, which sounds are played, script callbacks, etc. This
   // state system is downloaded to the client so that clients can
   // predict state changes and animate accordingly.  The following
   // system supports basic ready->fire->reload transitions as
   // well as a no-ammo->dryfire idle state.

   // Initial start up state
stateName[0]                     = "Activate";
stateTimeoutValue[0]             = 0.5;
stateTransitionOnTimeout[0]      = "Ready";
stateSound[0]                    = dmlsDrawSound;
stateSequence[0] = "Activate";

stateName[1]                     = "Ready";
stateTransitionOnTriggerDown[1]  = "ratck";
stateAllowImageChange[1]         = true;
stateSound[1] = dmlsLoopSound;
stateSequence[1] = "Ready";
stateTransitionOnTimeout[1]     = "Ready";
stateTimeoutValue[1]            = 0.0;


stateName[2] = "ratck";
stateAllowImageChange[2]        = false;
stateTimeoutValue[2]            = 0.1;
stateTransitionOnTimeout[2]     = "rback";
stateSound[2] = dmlsswingSound;
stateSequence[2] = "ratck";
stateAllowImageChange[2]        = false;
stateFire[2]                    = true;

stateName[3]                    = "rback";
stateTransitionOnTimeout[3]     = "checklfire";
stateTimeoutValue[3]            = 0.1;
stateSequence[3]                = "rback";
stateWaitForTimeout[3] = true;

stateName[4] = "checklfire";
stateTransitionOnTriggerUp[4] = "Ready";
stateTransitionOnTriggerDown[4] = "latck";

stateName[5]                    = "latck";
stateTransitionOnTimeout[5]     = "lback";
stateTimeoutValue[5]            = 0.1;
stateAllowImageChange[5]        = false;
stateWaitForTimeout[5] = true;
stateSequence[5]                = "latck";
stateSound[5] = dmlsswingSound;
stateFire[5]                    = true;

stateName[6]                    = "lback";
stateTransitionOnTimeout[6]     = "checkrfire";
stateTimeoutValue[6]            = 0.1;
stateSequence[6]                = "lback";
stateWaitForTimeout[6] = true;

stateName[7] = "checkrfire";
stateTransitionOnTriggerUp[7] = "Ready";
stateTransitionOnTriggerDown[7] = "ratck";

};

function dmlsImage::onMount(%this, %obj, %slot)
{
%obj.hidenode("RHand");
        %obj.hidenode("LHand");
}


function dmlsImage::onUnMount(%this, %obj, %slot)
{
%obj.unhidenode("RHand");
        %obj.unhidenode("LHand");
}

Heres the console error:
Code: [Select]
Loading Add-On: Pack_LEGOweapons (CRC:-437660630)
Executing Add-Ons/Pack_LEGOweapons/server.cs.
Executing Add-Ons/Pack_LEGOweapons/Weapon_lrls.cs.
Executing Add-Ons/Pack_LEGOweapons/Weapon_lgls.cs.
Executing Add-Ons/Pack_LEGOweapons/Weapon_lbls.cs.
Executing Add-Ons/Pack_LEGOweapons/Weapon_lpls.cs.
Executing Add-Ons/Pack_LEGOweapons/Weapon_wcb.cs.
Executing Add-Ons/Pack_LEGOweapons/Weapon_lbs.cs.
Executing Add-Ons/Pack_LEGOweapons/Weapon_lls.cs.
Executing Add-Ons/Pack_LEGOweapons/Weapon_ldls.cs.
Executing Add-Ons/Pack_LEGOweapons/Weapon_dmls.cs.
Object 'dmlsswingSound' is not a member of the 'AudioProfile' data block class
Object 'dmlsswingSound' is not a member of the 'AudioProfile' data block class
« Last Edit: September 03, 2009, 03:19:17 AM by Dalek »

You used dmlsswing instead of dmlswing. dmlsswing does not exist. Also, what do you mean by it won't swing?

You used dmlsswing instead of dmlswing. dmlsswing does not exist. Also, what do you mean by it won't swing?
It makes a sound when you swing it. Any idea on why it wont fire projectiles?