Author Topic: Melee doesn't swing in first person  (Read 824 times)

I'm trying to make a melee weapon that has an offset of "0 0 -1000" and and make it so its visible in first person so I set the eyeOffset to "0.75 1.5 -0.7"

but it doesn't swing now, is there a way to achieve both of these things?

A Few Questions:
  • Does it swing in third person?
  • How does it swing? (Is it an item animation, or a player animation?)

Code: [Select]
datablock ShapeBaseImageData(StalkerKnifeImage)
{
shapeFile = "./knife.dts";
   emap = true;
   mountPoint = 0;
   offset = "0 0 -1000"
   rotation = eulerToMatrix("0 0 0");
   eyeOffset = "0.75 1.5 -0.7";
   correctMuzzleVector = false;

   className = "WeaponImage";

   melee = true;
   doRetraction = false;
   //raise your arm up or not
   armReady = false;

   item = StalkerKnifeItem;
   ammo = " ";
   projectile = stalkerKnifeProjectile;
   projectileType = Projectile;

   doColorShift = true;
   colorShiftColor = StalkerKnifeItem.colorShiftColor;

   //Image state crap
};

function StalkerKnifeImage::onFire(%this,%obj,%slot)
{
   %obj.playThread(2,armReadyRight);
%obj.playThread(3,shiftdown);

parent::onFire(%this,%obj,%slot);
}

It swings in third person
and it swings through playThread();

it swings normal when I don't mess with the offsets but thats what I need

Try this:

Code: [Select]
function StalkerKnifeImage::onFire(%this,%obj,%slot)
{
    %obj.playThread(2,armReadyRight);
%obj.playThread(3,shiftdown);
return parent::onFire(%this,%obj,%slot);
}


During my experience experimenting with ironsights I noticed an interesting detail. When the item is sighted (eyeoffset is not default) the player animations tend to not appear on first-person.

Now this is based on an experiment from a while ago, so things might have changed since then, I'd recommend finding a different way to do the stabbing animation, if you need to change the offset.

well I sort of found a solution thats okay for this case, so I'll just leave this topic here in case anyone finds a solution

During my experience experimenting with ironsights I noticed an interesting detail. When the item is sighted (eyeoffset is not default) the player animations tend to not appear on first-person.
This is true with any offset weapon, I believe. Notice how unlike many items, the default tools do not seem to move from the screen as the rocket launcher would when looking upward. This is also seen when using the build controls with default tools, i.e., the printer remains still in first person when you press the rotate keys, but flips in third person.

This is true with any offset weapon, I believe. Notice how unlike many items, the default tools do not seem to move from the screen as the rocket launcher would when looking upward. This is also seen when using the build controls with default tools, i.e., the printer remains still in first person when you press the rotate keys, but flips in third person.
I don't think the rocket launcher has any threads played though when you fire, I already knew this anyway I was asking if there was a way