Page 1 of 1

HEEEEEEELP

Posted: Sat Dec 17, 2016 9:40 am
by Kelkos
Okay, I have compiled a few animation calls, I want the pawn to stand still while having the shoot animation, I want the pawn to freeze and not play all the 6 shooting frames instead loop the first one, the pawn should completely freeze, and the gun should automatically fire in his hand, here is the code, if anyone wishes to help me :smile:

Code: Select all

// ----------------------------------------------------------------------
// PlayRunningAndFiring()
// ----------------------------------------------------------------------

function PlayRunningAndFiring()
{
	local DeusExWeapon W;
	local vector       v1, v2;
	local float        dotp;

	bIsWalking = FALSE;

	W = DeusExWeapon(Weapon);

	if (W != None)
	{
		if (Region.Zone.bWaterZone)
		{
			if (W.bHandToHand)
				LoopAnimPivot('Tread',,0.1,,GetSwimPivot());
			else
				LoopAnimPivot('TreadShoot',,0.1,,GetSwimPivot());
		}
		else
		{
			if (W.bHandToHand)
				LoopAnimPivot('Run',runAnimMult,0.1);
			else
			{
				v1 = Normal((Enemy.Location - Location)*vect(1,1,0));
				if (destPoint != None)
					v2 = Normal((destPoint.Location - Location)*vect(1,1,0));
				else
					v2 = Normal((destLoc - Location)*vect(1,1,0));
				dotp = Abs(v1 dot v2);
				if (dotp < 0.70710678)  // running sideways
				{
					if (HasTwoHandedWeapon())
						LoopAnimPivot('Strafe2H',runAnimMult,0.1);
					else
						LoopAnimPivot('Strafe',runAnimMult,0.1);
				}
				else
				{
					if (HasTwoHandedWeapon())
						LoopAnimPivot('RunShoot2H',runAnimMult,0.1);
					else
						LoopAnimPivot('RunShoot',runAnimMult,0.1);
				}
			}
		}
	}
}


// ----------------------------------------------------------------------
// TweenToShoot()
// ----------------------------------------------------------------------

function TweenToShoot(float tweentime)
{
	if (Region.Zone.bWaterZone)
		TweenAnimPivot('TreadShoot', tweentime, GetSwimPivot());
	else if (!bCrouching)
	{
		if (!IsWeaponReloading())
		{
			if (HasTwoHandedWeapon())
				TweenAnimPivot('Shoot2H', tweentime);
			else
				TweenAnimPivot('Shoot', tweentime);
		}
		else
			PlayReload();
	}
}


// ----------------------------------------------------------------------
// PlayShoot()
// ----------------------------------------------------------------------

function PlayShoot()
{
	if (Region.Zone.bWaterZone)
		PlayAnimPivot('TreadShoot', , 0, GetSwimPivot());
	else
	{
		if (HasTwoHandedWeapon())
			PlayAnimPivot('Shoot2H', , 0);
		else
			PlayAnimPivot('Shoot', , 0);
	}
}


// ----------------------------------------------------------------------
// TweenToCrouchShoot()
// ----------------------------------------------------------------------

function TweenToCrouchShoot(float tweentime)
{
	if (Region.Zone.bWaterZone)
		TweenAnimPivot('TreadShoot', tweentime, GetSwimPivot());
	else
		TweenAnimPivot('CrouchShoot', tweentime);
}


// ----------------------------------------------------------------------
// PlayCrouchShoot()
// ----------------------------------------------------------------------

function PlayCrouchShoot()
{
	if (Region.Zone.bWaterZone)
		PlayAnimPivot('TreadShoot', , 0, GetSwimPivot());
	else
		PlayAnimPivot('CrouchShoot', , 0);
}


// ----------------------------------------------------------------------
// TweenToAttack()
// ----------------------------------------------------------------------

function TweenToAttack(float tweentime)
{
	if (Region.Zone.bWaterZone)
		TweenAnimPivot('Tread', tweentime, GetSwimPivot());
	else
	{
		if (bUseSecondaryAttack)
			TweenAnimPivot('AttackSide', tweentime);
		else
			TweenAnimPivot('Attack', tweentime);
	}
}


// ----------------------------------------------------------------------
// PlayAttack()
// ----------------------------------------------------------------------

function PlayAttack()
{
	if (Region.Zone.bWaterZone)
		PlayAnimPivot('Tread',,,GetSwimPivot());
	else
	{
		if (bUseSecondaryAttack)
			PlayAnimPivot('AttackSide');
		else
			PlayAnimPivot('Attack');
	}
}

// ----------------------------------------------------------------------
// PlayFiring()
// ----------------------------------------------------------------------

/*
function PlayFiring()
{
	local DeusExWeapon W;

//	ClientMessage("PlayFiring()");

	W = DeusExWeapon(Weapon);

	if (W != None)
	{
		if (W.bHandToHand)
		{
			PlayAnimPivot('Attack',,0.1);
		}
		else
		{
			if (W.bAutomatic)
			{
				if (HasTwoHandedWeapon())
					LoopAnimPivot('Shoot2H',,0.1);
				else
					LoopAnimPivot('Shoot',,0.1);
			}
			else
			{
				if (HasTwoHandedWeapon())
					PlayAnimPivot('Shoot2H',,0.1);
				else
					PlayAnimPivot('Shoot',,0.1);
			}
		}
	}
}

Re: HEEEEEEELP

Posted: Sat Dec 17, 2016 9:48 am
by Kelkos
Like he should freeze in this position and the gun should fire in his hand without moving.

Re: HEEEEEEELP

Posted: Sun Jan 01, 2017 11:43 am
by Kelkos
Can someone help. I want the pawn to stand with the weapon i his hand, and not move it when firing regardless of the recoil