Author Topic: updateArm but with left arm  (Read 740 times)

Is there any way to properly do what Player::updateArm does but with the player's left arm instead of right arm, and make a weapon shoot from the left arm?

You could play the hug animation.
And when you shoot the animation that flails both hands.
As far as i know there is no real way to have that separate, sadly.

updateArm essentially just set the proper armReady thread for the player
just do

Code: [Select]
function leftHandImage::onMount(%db,%pl,%slot)
{
    %pl.playThread(1,armReadyLeft);
}
and you can use leftRecoil for gun shot animations (make sure you do it on a slot other than 1)
Code: [Select]
function leftHandImage::onFire(%db,%pl,%slot)
{
   if(%pl.getDamagerPercent() >= 1)
    return;
   %pl.playThread(2,leftRecoil);
   parent::onFire(%db,%pl,%slot);
}

since armReady animations are generally put all on slot 1 your armReadyLeft will overwrite any other thread that was on that thread ie armReadyRight or armReadyBoth

alternatively if your are hell bent on this updateArm thing you can package that function

Code: [Select]
package swol_updateArm
{
function Player::updateArm(%pl, %newImage)
{
if(%newImage.mountPoint == $LeftHandSlot)
{
if(!isObject(%pl.getMountedImage($RightHandSlot)))
{
if(isObject(%leftOld = %pl.getMountedImage($LeftHandSlot)))
{
if(%leftOld.armReady)
return;
if(%newImage.armReady)
{
%pl.playThread(1,armReadyLeft);
return;
}
}
else
{
if(%newImage.armReady)
{
%pl.playThread(1,armReadyLeft);
return;
}
}
}
}
parent::updateArm(%pl, %newImage);
}
};
activatePackage(swol_updateArm);
« Last Edit: June 20, 2016, 01:20:21 PM by Swollow »

There is an armReadyLeft? This is good to know actually.
How did i not know that. Urgh.

There is an armReadyLeft? This is good to know actually.
How did i not know that. Urgh.
you can find all the dsq animations in
base/data/shapes/player

I like to refer to this post
https://forum.blockland.us/index.php?topic=186156.msg4922149#msg4922149
Quote
root
run
walk
back
side
crouch
crouchRun
crouchBack
crouchSide
look
headside
headUp
jump
standjump
fall
land
armAttack
armReadyLeft
armReadyRight
armReadyBoth
spearready
spearthrow
talk
death1
shiftUp
shiftDown
shiftAway
shiftTo
shiftLeft
shiftRight
rotCW
rotCCW
undo
plant
sit
wrench
activate
activate2
leftrecoil
« Last Edit: June 20, 2016, 03:22:11 PM by Swollow »

Thanks, i should really do a bit more searching next time.

Thanks, i should really do a bit more searching next time.
we're always learning~