Author Topic: Melee weapon help  (Read 998 times)

So I've made a melee weapon for a video I'm going to make (not telling, wheee)
and I've got it into Blockland, and I've got everything working, except for one of the most omportant things: the weapon does not move in 1st person view when attacking. it doesn't swing, yet it does the damage. And, it swings when in 3rd person, but not 1st. How do I fix this?

it was viewoffset or something like that, you have to set it to 0 0 0, there are 2 instances of it in a normal script

it was viewoffset or something like that, you have to set it to 0 0 0, there are 2 instances of it in a normal script
True.


Wait...
I used the Sword script and edited, and I never edited something like viewoffset

well, you need to since it is not 0 0 0 on the sword script


That is script related.
If I recall correctly, it has something to do with this block of code.

Code: [Select]
////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(swordImage)
{
   // Basic Item properties
   shapeFile = "./sword.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   offset = "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.7 1.2 -0.25";

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

   // Projectile && Ammo.
   item = swordItem;
   ammo = " ";
   projectile = swordProjectile;
   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]                    = swordDrawSound;

stateName[1]                     = "Ready";
stateTransitionOnTriggerDown[1]  = "PreFire";
stateAllowImageChange[1]         = true;

stateName[2] = "PreFire";
stateScript[2]                  = "onPreFire";
stateAllowImageChange[2]        = false;
stateTimeoutValue[2]            = 0.1;
stateTransitionOnTimeout[2]     = "Fire";

stateName[3]                    = "Fire";
stateTransitionOnTimeout[3]     = "CheckFire";
stateTimeoutValue[3]            = 0.2;
stateFire[3]                    = true;
stateAllowImageChange[3]        = false;
stateSequence[3]                = "Fire";
stateScript[3]                  = "onFire";
stateWaitForTimeout[3] = true;

stateName[4] = "CheckFire";
stateTransitionOnTriggerUp[4] = "StopFire";
stateTransitionOnTriggerDown[4] = "Fire";


stateName[5]                    = "StopFire";
stateTransitionOnTimeout[5]     = "Ready";
stateTimeoutValue[5]            = 0.2;
stateAllowImageChange[5]        = false;
stateWaitForTimeout[5] = true;
stateSequence[5]                = "StopFire";
stateScript[5]                  = "onStopFire";


};

I just realized I cross posted, sowwies. :c
Eitherway, it's not your model. This has to do with either the sequences, eyeOffset, or offset (of course, I may have recalled incorrectly).
« Last Edit: February 16, 2011, 02:40:38 PM by Blastdown »

I never edited any of that, I think. I just replaced almost every "sword" there was with my weapon name.

Set eyeOffset to 0 0 0.

2 Finns and 1 Swede in the same topic :D
On-Topic: Alright, I'll try that, tomorrow. I need to sleep, you know.