Game Development Community

I swear the forum ate my answer, anyone remember this?

by Svengali · in Torque 3D Professional · 09/08/2011 (6:48 am) · 7 replies

Long story short, our project is now 96 hrs overdue from being back online. Due to a ton of last minute issues we had to revert from 1.1 back to beta 3. Somewhere along the way, I lost an old change that stopped the weapon animation from continuously looping.
I posted this once before like a year and a half ago, and Steve Acaster knew what to do to fix it, however it seems that forum has eaten some of the past posts. Can anyone help me out with this real quick, or remind me at least where to look for the lost code?
Thanks guys!

About the author

Creator of SvengaliGames, and developing the once up coming title NightLife: The MMORPG Of Dark Horror. Now named ATROX NOCTIS: Daemons Cradle- www.svengaligames.com


#1
09/08/2011 (7:40 am)
Quote:
change that stopped the weapon animation from continuously looping

Doesn't ring a bell ...

... do you mean semi-automatic, when you fire once button every time you press it? WaitForRelease?
#2
09/08/2011 (9:46 am)
The weapons not even being used, from the time of weapon mount the guns just cycles through the whole animation loop. I'm not even sure if its part of the weapon script or not. What ever it was it was one line of script, lol. I guess thats why I lost it. I'm tearing apart my office now trying to find the notes on it. It's a real shame the old post is gone... the weapon animation system I'm using is completely stock, although we do plan to modify it slightly, none of our weapons actualy produce projectiles so our combat is all done with smoke and mirrors. Crap, this is what happens when you haven't slept in a week, but I'm sure you've experienced that too.
#3
09/08/2011 (10:49 am)
Could you post your weapon datablock? I'm not sure what would be happening unless you are transitioning to the root animation.
#4
09/08/2011 (1:23 pm)
Sure, all the datablocks for the weapons are basicly the same other than names(there's like 30+ guns). They all do it.
//--------------------------------------------------------------------------
// Glock image which does all the work.  Images do not normally exist in
// the world, they can only be mounted on ShapeBase objects.
datablock ShapeBaseImageData(GlockImage_11)
{
   // Basic Item properties
   shapeFile = "art/shapes/MMWeaponPack/Glock19/Glock19.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   //mountPoint = 1;
   offset = "0 0.1 -0.1";
   scale = "2 2 2";
   eyeOffset = "0.1 0.4 -0.6";
   //correctMuzzleVector = true;
   // 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 = Glock;
   ammo = GlockAmmo;
   projectile = GlockProjectile;
   projectileType = Projectile;
   
   //added weapon flash
   lightType = WeaponFireLight;
   lightRadius = 10;
   lightTime = 5; // Time in ms
   lightColor = "0.9 0.9 0.8";

   // 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]                     = "Preactivate";
   stateTransitionOnLoaded[0]       = "Activate";
   stateTransitionOnNoAmmo[0]       = "NoAmmo";

   // Activating the gun.  Called when the weapon is first
   // mounted and there is ammo.
   stateName[1]                     = "Activate";
   stateTransitionOnTimeout[1]      = "Ready";
   stateTimeoutValue[1]             = 0.6;
   stateSequence[1]                 = "Activate";

   // Ready to fire, just waiting for the trigger
   stateName[2]                     = "Ready";
   stateTransitionOnNoAmmo[2]       = "NoAmmo";
   stateTransitionOnTriggerDown[2]  = "Fire";

   // Fire the weapon. Calls the fire script which does 
   // the actual work.
   stateName[3]                     = "Fire";
   stateTransitionOnTimeout[3]      = "Reload";
   stateTimeoutValue[3]             = 0.2;
   stateFire[3]                     = true;
   stateRecoil[3]                   = LightRecoil;
   stateAllowImageChange[3]         = false;
   stateSequence[3]                 = "Sequence_Fire";
   stateScript[3]                   = "onFire";
   stateSound[3]                    = GlockFireSound;

   // Play the relead animation, and transition into
   stateName[4]                     = "Reload";
   stateTransitionOnNoAmmo[4]       = "NoAmmo";
   stateTransitionOnTimeout[4]      = "Ready";
   stateTimeoutValue[4]             = 0.8;
   stateAllowImageChange[4]         = false;
   stateSequence[4]                 = "Sequence_Fire";
   stateEjectShell[4]               = true;
   stateSound[4]                    = GlockReloadSound;

   // No ammo in the weapon, just idle until something
   // shows up. Play the dry fire sound if the trigger is
   // pulled.
   stateName[5]                     = "NoAmmo";
   stateTransitionOnAmmo[5]         = "Reload";
   stateSequence[5]                 = "Sequence_Reload";
   stateTransitionOnTriggerDown[5]  = "DryFire";

   // No ammo dry fire
   stateName[6]                     = "DryFire";
   stateTimeoutValue[6]             = 1.0;
   stateTransitionOnTimeout[6]      = "NoAmmo";
   stateSound[6]                    = GlockFireEmptySound;
};

Here's a vid of the undesired behavior, lol.As you can see, I'm still chasing a tone of other bugs down too...
#5
09/08/2011 (1:35 pm)
dumb question -- is the animation sequence set to loop?
#6
09/08/2011 (1:46 pm)
I figured it out, and as normal I'm a dambass. I forgot to put the max ammo in the defaultPlayer datablock, so it kept cycling the reload animation, whick made me mistake it for a total loop in the animation. Thanks everyone for your help! Past and Present!
#7
09/08/2011 (2:22 pm)
That was exactly the kind of thing that I thought was happening. I ended up making weapons do very strange things when I was writing on the weapon tutorial for 1.2! Glad you figured it out!