Author Topic: How can i unhidenode so the animation will play and then hide it again?  (Read 1568 times)

I am making a postal 2 kick thingy and I have no clue how to make it so when i press left click, the model appears, then a certain body part (right leg) hides itself and after the kick is done the leg appears and the model is hidden untill i fire the "weapon" again
Code: [Select]
//effects


datablock AudioProfile(kickfire)
{
  filename = "./kickmiss.wav";
  description = AudioClose3d;
  preload = true;
};

datablock AudioProfile(kickhit)
{
  filename = "./kickhit.wav";
  description = AudioClose3d;
  preload = true;
};

datablock ParticleData(pushBroomSparkParticle)
{
   dragCoefficient      = 4;
   gravityCoefficient   = 1;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   lifetimeMS           = 400;
   lifetimeVarianceMS   = 300;
   textureName          = "base/data/particles/chunk";

useInvAlpha = false;
spinSpeed = 150.0;
spinRandomMin = -150.0;
spinRandomMax = 150.0;

   colors[0]     = "0.30 0.10 0.0 0.0";
   colors[1]     = "0.30 0.10 0.0 0.5";
   colors[2]     = "0.30 0.10 0.0 0.0";
   sizes[0]      = 0.15;
   sizes[1]      = 0.15;
   sizes[2]      = 0.15;

   times[0] = 0.1;
   times[1] = 0.5;
   times[2] = 1.0;

   useInvAlpha = true;
};

datablock ParticleEmitterData(pushBroomSparkEmitter)
{
lifeTimeMS = 10;

   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 5;
   velocityVariance = 3.0;
   ejectionOffset   = 1.50;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = pushBroomSparkParticle;

   uiName = "Push Broom Chunk";
};




datablock ParticleData(pushBroomExplosionParticle)
{
   dragCoefficient      = 10;
   gravityCoefficient   = -0.15;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   lifetimeMS           = 800;
   lifetimeVarianceMS   = 500;
   textureName          = "base/data/particles/cloud";

spinSpeed = 50.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;

   colors[0]     = "1.0 1.0 1.0 0.25";
   colors[1]     = "0.0 0.0 0.0 0.0";
   sizes[0]      = 0.5;
   sizes[1]      = 1.0;

   useInvAlpha = true;
};

datablock ParticleEmitterData(pushBroomExplosionEmitter)
{
lifeTimeMS = 50;

   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 10;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 95;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = pushBroomExplosionParticle;

   uiName = "Push Broom Dust";
   emitterNode = HalfEmitterNode;
};

datablock ExplosionData(pushBroom2Explosion)
{
   //explosionShape = "";
   lifeTimeMS = 10;
   
   //emitter[0] = pushBroomExplosionEmitter;
   emitter[0] = pushBroomSparkEmitter;
   particleEmitter = pushBroomExplosionEmitter;
   particleDensity = 15;
particleRadius = 0.5;
   
   faceViewer     = true;
   explosionScale = "1 1 1";

   soundProfile = kickhit;

   
   shakeCamera = false;
   cameraShakeFalloff = false;
   camShakeFreq = "2.0 3.0 1.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 2.5;
   camShakeRadius = 0.0001;

   // Dynamic light
   lightStartRadius = 0;
   lightEndRadius = 0;
   lightStartColor = "0.0 0.0 0.0";
   lightEndColor = "0 0 0";
};



//audio
datablock AudioProfile(shotgunReloadSound)
{
   filename    = "./shotgunReload.wav";
   description = AudioClose3d;
   preload = true;
};

//shell
datablock DebrisData(shotgunShellDebris)
{
shapeFile = "./shotgunShell.dts";
lifetime = 2.0;
minSpinSpeed = -400.0;
maxSpinSpeed = 200.0;
elasticity = 0.5;
friction = 0.2;
numBounces = 3;
staticOnMaxBounce = true;
snapOnMaxBounce = false;
fade = true;

gravModifier = 2;
};

//emitter
datablock ParticleData(shotgunSmokeParticle)
{
dragCoefficient      = 3;
gravityCoefficient   = -0.5;
inheritedVelFactor   = 0.2;
constantAcceleration = 0.0;
lifetimeMS           = 525;
lifetimeVarianceMS   = 55;
textureName          = "base/data/particles/cloud";
spinSpeed = 10.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;
colors[0]     = "0.5 0.5 0.5 0.5";
colors[1]     = "0.5 0.5 0.5 0.0";
sizes[0]      = 0.15;
sizes[1]      = 0.1;

useInvAlpha = false;
};
datablock ParticleEmitterData(shotgunSmokeEmitter)
{
   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 1.0;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "shotgunSmokeParticle";
};

AddDamageType("Shotgun",   '<bitmap:add-ons/Weapon_Shotgun/CI_shotgun> %1',    '%2 <bitmap:add-ons/Weapon_Shotgun/CI_shotgun> %1',0.5,1);
datablock ProjectileData(shotgunProjectile)

{
   //projectileShapeName = "~/data/shapes/arrow.dts";
   directDamage        = 10;
   impactImpulse       = 500;
   verticalImpulse     = 500;
   explosion           = pushBroom2Explosion;
   //particleEmitter     = as;

   muzzleVelocity      = 50;
   velInheritFactor    = 1;

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

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

   uiName = "Kick Test";
};

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

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

//gui stuff
uiName = "Kick";
iconName = "./shotgunIcon";
doColorShift = true;
colorShiftColor = "0.5 0.5 0.5 1.000";

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

////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(shotgunImage)
{
   // Basic Item properties
   shapeFile = "./Kick.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.4 2.9 -0.45";
   rotation = eulerToMatrix( "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 = true;

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

   // Projectile && Ammo.
   item = shotgunItem;
   ammo = " ";
   projectile = shotgunProjectile;
   projectileType = Projectile;

   casing = shotgunShellDebris;
   shellExitDir        = "1.0 0.1 1.0";
   shellExitOffset     = "0 0 0";
   shellExitVariance   = 10.0;
   shellVelocity       = 5.0;

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

   doColorShift = true;
   colorShiftColor = shotgunItem.colorShiftColor;

   // 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.15;
stateTransitionOnTimeout[0]     = "Ready";
stateSound[0]   = weaponSwitchSound;

stateName[1]                    = "Ready";
stateTransitionOnTriggerDown[1] = "Fire";
stateAllowImageChange[1]        = true;
stateTimeoutValue[1]   = 0.01;

stateName[2]                    = "Fire";
stateTransitionOnTimeout[2]     = "Smoke";
stateTimeoutValue[2]            = 0.5;
stateFire[2]                    = true;
stateAllowImageChange[2]        = false;
stateSequence[2]                = "Fire";
stateScript[2]                  = "onFire";
stateWaitForTimeout[2]   = true;
// stateEmitter[2]   = gunFlashEmitter;
stateEmitterTime[2]   = 0.05;
stateEmitterNode[2]   = "muzzleNode";
stateSound[2]   = kickfire;
stateTransitionOnTimeout[2]   = "Smoke";

stateName[3]   = "Smoke";
// stateEmitter[3]   = shotgunSmokeEmitter;
// stateEmitterTime[3]   = 0.1;
// stateEmitterNode[3]   = "muzzleNode";
stateTimeoutValue[3]            = 0.4;
stateTransitionOnTimeout[3]     = "Ready";

// stateName[4]   = "Reload";
// stateTimeoutValue[4]   = 0.3;
// stateSequence[4]   = "reload";
// stateTransitionOnTimeout[4]   = "Wait";
// stateWaitForTimeout[4]   = true;
// stateEjectShell[4]          = true;
// stateSound[4]   = shotgunReloadSound;

// stateName[5]   = "Wait";
// stateTimeoutValue[5]   = 0.1;
// stateTransitionOnTimeout[5]   = "Ready";
};

function shotgunImage::onFire(%this,%obj,%slot)
{
if((%obj.lastFireTime+%this.minShotTime) > getSimTime())
return;
%obj.lastFireTime = getSimTime();
     
%obj.setVelocity(VectorAdd(%obj.getVelocity(),VectorScale(%obj.client.player.getEyeVector(),"-3")));
%obj.playThread(2, shiftAway);

%projectile = %this.projectile;
%spread = 0.0015;
%shellcount = 3;

for(%shell=0; %shell<%shellcount; %shell++)
{
%vector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%vector1 = VectorScale(%vector, %projectile.muzzleVelocity);
%vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor);
%velocity = VectorAdd(%vector1,%vector2);
%x = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%y = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%z = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%velocity = MatrixMulVector(%mat, %velocity);

%p = new (%this.projectileType)()
{
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
}
return %p;
}

function shotgunImage::onMount(%this, %obj, %slot)
{
        %obj.hidenode("Rshoe");
}


function shotgunImage::onUnMount(%this, %obj, %slot)
{
        %obj.unhidenode("Rshoe");
}


function shotgunImage::onMount(%this, %obj, %slot)
{
   Parent::onMount(%this, %obj, %slot);
   %obj.playThread(1, armreadyboth);
}
function shotgunImage::onUnMount(%this, %obj, %slot)
{
   Parent::onUnMount(%this, %obj, %slot);
}

the issue i see with this idea is players using pegleg instead of foot. im not sure if its possible to get what player nodes and player node colors players or clients have to know what image to use, but even so the colors are bound to be wrong since you cant colorshift individual images

the issue i see with this idea is players using pegleg instead of foot. im not sure if its possible to get what player nodes and player node colors players or clients have to know what image to use, but even so the colors are bound to be wrong since you cant colorshift individual images
i can force players to use a specific color and not the pegleg
all i need is to make the leg model (kick.dts) that has a kick animation appear on Fire
and dissapear on smoke/reload
and at the same time make the leg dissapear on fire and appear on smoke/reload

stateScript[Num] = "onWhatever"; gives you hook into yourWeaponImage::onWhatever(%this, %obj, %slot).
stateSequence[Num] = animationName; calls that animation play upon entering that state.

You can't hideNode on images as far as I'm aware so what I'd do is have an image for the foot, and then as soon as it's mounted it hides the players foot and plays the kick animation. When the image reaches it's last state it can then unMount itself and unHide the players real foot.

EDIT:

Code: [Select]
datablock ShapeBaseImageData(kickFootImage)
{
   // Basic Item properties
   shapeFile = "./Kick.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0; //change this to the right foot, I can't remember what number it is off the top of my head
   offset = "0 0 0";
   eyeoffset = "100 100 100"; //so we don't see it in first person
   rotation = eulerToMatrix( "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 = true;

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

   // Projectile && Ammo.
   item = shotgunItem;
   ammo = " ";
   projectile = shotgunProjectile; //is this really what you will use?
   projectileType = Projectile;

   casing = shotgunShellDebris;
   shellExitDir        = "1.0 0.1 1.0";
   shellExitOffset     = "0 0 0";
   shellExitVariance   = 10.0;
   shellVelocity       = 5.0;

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

   doColorShift = true;
   colorShiftColor = shotgunItem.colorShiftColor;

   // 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";
stateScript[0] = "onActivate";
stateTransitionOnTimeout[0]     = "Ready";
stateTimeoutValue[0]            = 0.05;
// stateSound[0]   = weaponSwitchSound;

stateName[1]                    = "Fire";
stateTransitionOnTimeout[1]     = "Smoke";
stateTimeoutValue[1]            = 0.5;
stateFire[1]                    = true;
stateAllowImageChange[1]        = false;
stateSequence[1]                = "put the name of your animation here";
stateScript[1]                  = "onFire";
stateWaitForTimeout[2]   = true;
stateSound[2]   = kickfire;
stateTransitionOnTimeout[2]   = "Smoke";

stateName[3]   = "Smoke";
stateScript[3] = "onSmoke";
stateTimeoutValue[3]            = 0.4;
stateTransitionOnTimeout[3]     = "Ready";
stateTimeoutValue[3] = 0.1;
};

function kickFootImage::onMount(%this, %obj, %slot)
{
   %obj.hideNode(rShoe);
   %obj.hideNode(rPeg);
}

function kickFootImage::onSmoke(%this, %obj, %slot)
{
   %obj.unMountImage(MountpointNumber); //I have forgotten the number the rShoe is
   %obj.client.applyBodyParts();
   %obj.client.applyBodyColors();
}

Read my comments carefully, some stuff in there needs changed
« Last Edit: July 05, 2016, 12:41:15 PM by Jervan »

additionally make sure to unhide the node also if the player unMounts the image before the animation finishes playing via
image::onUnMount(%db,%pl,%slot)

Something is wrong, when i pick up the weapon and try equiping it...
Well here is a picture of it
Here is the code
Code: [Select]


datablock AudioProfile(kickfire)
{
  filename = "./kickmiss.wav";
  description = AudioClose3d;
  preload = true;
};

datablock AudioProfile(kickhit)
{
  filename = "./kickhit.wav";
  description = AudioClose3d;
  preload = true;
};

datablock ParticleData(pushBroomSparkParticle)
{
   dragCoefficient      = 4;
   gravityCoefficient   = 1;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   lifetimeMS           = 400;
   lifetimeVarianceMS   = 300;
   textureName          = "base/data/particles/chunk";

useInvAlpha = false;
spinSpeed = 150.0;
spinRandomMin = -150.0;
spinRandomMax = 150.0;

   colors[0]     = "0.30 0.10 0.0 0.0";
   colors[1]     = "0.30 0.10 0.0 0.5";
   colors[2]     = "0.30 0.10 0.0 0.0";
   sizes[0]      = 0.15;
   sizes[1]      = 0.15;
   sizes[2]      = 0.15;

   times[0] = 0.1;
   times[1] = 0.5;
   times[2] = 1.0;

   useInvAlpha = true;
};

datablock ParticleEmitterData(pushBroomSparkEmitter)
{
lifeTimeMS = 10;

   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 5;
   velocityVariance = 3.0;
   ejectionOffset   = 1.50;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = pushBroomSparkParticle;

   uiName = "Push Broom Chunk";
};




datablock ParticleData(pushBroomExplosionParticle)
{
   dragCoefficient      = 10;
   gravityCoefficient   = -0.15;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   lifetimeMS           = 800;
   lifetimeVarianceMS   = 500;
   textureName          = "base/data/particles/cloud";

spinSpeed = 50.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;

   colors[0]     = "1.0 1.0 1.0 0.25";
   colors[1]     = "0.0 0.0 0.0 0.0";
   sizes[0]      = 0.5;
   sizes[1]      = 1.0;

   useInvAlpha = true;
};

datablock ParticleEmitterData(pushBroomExplosionEmitter)
{
lifeTimeMS = 50;

   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 10;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 95;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = pushBroomExplosionParticle;

   uiName = "Push Broom Dust";
   emitterNode = HalfEmitterNode;
};

datablock ExplosionData(pushBroom2Explosion)
{
   //explosionShape = "";
   lifeTimeMS = 10;
   
   //emitter[0] = pushBroomExplosionEmitter;
   emitter[0] = pushBroomSparkEmitter;
   particleEmitter = pushBroomExplosionEmitter;
   particleDensity = 15;
particleRadius = 0.5;
   
   faceViewer     = true;
   explosionScale = "1 1 1";

   soundProfile = kickhit;

   
   shakeCamera = false;
   cameraShakeFalloff = false;
   camShakeFreq = "2.0 3.0 1.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 2.5;
   camShakeRadius = 0.0001;

   // Dynamic light
   lightStartRadius = 0;
   lightEndRadius = 0;
   lightStartColor = "0.0 0.0 0.0";
   lightEndColor = "0 0 0";
};



//audio
datablock AudioProfile(shotgunReloadSound)
{
   filename    = "./shotgunReload.wav";
   description = AudioClose3d;
   preload = true;
};

//shell
datablock DebrisData(shotgunShellDebris)
{
shapeFile = "./shotgunShell.dts";
lifetime = 2.0;
minSpinSpeed = -400.0;
maxSpinSpeed = 200.0;
elasticity = 0.5;
friction = 0.2;
numBounces = 3;
staticOnMaxBounce = true;
snapOnMaxBounce = false;
fade = true;

gravModifier = 2;
};

//emitter
datablock ParticleData(shotgunSmokeParticle)
{
dragCoefficient      = 3;
gravityCoefficient   = -0.5;
inheritedVelFactor   = 0.2;
constantAcceleration = 0.0;
lifetimeMS           = 525;
lifetimeVarianceMS   = 55;
textureName          = "base/data/particles/cloud";
spinSpeed = 10.0;
spinRandomMin = -500.0;
spinRandomMax = 500.0;
colors[0]     = "0.5 0.5 0.5 0.5";
colors[1]     = "0.5 0.5 0.5 0.0";
sizes[0]      = 0.15;
sizes[1]      = 0.1;

useInvAlpha = false;
};
datablock ParticleEmitterData(shotgunSmokeEmitter)
{
   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 1.0;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "shotgunSmokeParticle";
};

AddDamageType("Shotgun",   '<bitmap:add-ons/Weapon_Shotgun/CI_shotgun> %1',    '%2 <bitmap:add-ons/Weapon_Shotgun/CI_shotgun> %1',0.5,1);
datablock ProjectileData(shotgunProjectile)

{
   //projectileShapeName = "~/data/shapes/arrow.dts";
   directDamage        = 10;
   impactImpulse       = 500;
   verticalImpulse     = 500;
   explosion           = pushBroom2Explosion;
   //particleEmitter     = as;

   muzzleVelocity      = 50;
   velInheritFactor    = 1;

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

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

   uiName = "Kick Test";
};

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

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

//gui stuff
uiName = "Kick";
iconName = "./shotgunIcon";
doColorShift = true;
colorShiftColor = "0.5 0.5 0.5 1.000";

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

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

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 1; //change this to the right foot, I can't remember what number it is off the top of my head
   offset = "0 0 0";
   eyeoffset = "0.4 2.9 -0.45";
   rotation = eulerToMatrix( "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 = true;

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

   // Projectile && Ammo.
   item = shotgunItem;
   ammo = " ";
   projectile = shotgunProjectile; //is this really what you will use?
   projectileType = Projectile;

   casing = shotgunShellDebris;
   shellExitDir        = "1.0 0.1 1.0";
   shellExitOffset     = "0 0 0";
   shellExitVariance   = 10.0;
   shellVelocity       = 5.0;

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

   doColorShift = true;
   colorShiftColor = shotgunItem.colorShiftColor;

   // 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.05;
                stateTransitionOnTimeout[0]    = "Ready";
                stateWaitForTimeout[0]         = true;
                stateSound[0]                  = weaponSwitchSound;

                stateName[1]                   = "Ready";
                stateTransitionOnTriggerDown[1]= "Fire";
                stateAllowImageChange[1]       = true;
//            stateEmitter[1]                = PyGunambientEmitter;
//            stateEmitterTime[1]            = 1000;
//            stateEmitterNode[1]            = "muzzlePoint";

stateName[2]                    = "Fire";
stateTransitionOnTimeout[2]     = "Smoke";
stateTimeoutValue[2]            = 0.2;
stateFire[2]                    = true;
stateAllowImageChange[2]        = false;
stateSequence[2]                = "Fire";
stateScript[2]                  = "onFire";
stateWaitForTimeout[2]   = true;
stateSound[2]   = kickfire;
stateTransitionOnTimeout[2]   = "Smoke";

stateName[3]   = "Smoke";
stateScript[3] = "onSmoke";
stateTimeoutValue[3]            = 0.5;
stateTransitionOnTimeout[3]     = "Ready";
stateTimeoutValue[3] = 0.1;
};

function kickImage::onFire(%this, %obj, %slot)
{
   %obj.hideNode(rShoe);
   %obj.hideNode(rPeg);
}

function kickImage::onSmoke(%this, %obj, %slot)
{
   %obj.unMountImage(Mountpoint1); //I have forgotten the number the rShoe is
   %obj.client.applyBodyParts();
   %obj.client.applyBodyColors();
}

Can you post your console log? Also    %obj.unMountImage(Mountpoint1); should be    %obj.unMountImage(1); in the last function

The console doesn't scream at me when it execs the addon.
I don't know what is wrong.

Code: [Select]
... datablock ItemData(shotgunItem){ ...???

You seem to be overwriting a good deal of the shotgun's datablocks.

Code: [Select]
... datablock ItemData(shotgunItem){ ...???

You seem to be overwriting a good deal of the shotgun's datablocks.
That doesn't change anything, the whole gun is still shotgun and not kick.