HEEEEEEELP

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Post Reply
User avatar
Kelkos
UNATCO
Posts: 214
Joined: Fri Oct 28, 2016 12:54 pm

HEEEEEEELP

Post 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);
			}
		}
	}
}
Being a soldier isn't just following orders, it's following those orders in the service of a higher cause. When that cause is betrayed, we're not soldiers anymore, just pieces on a chess board dying for the wrong reason.
User avatar
Kelkos
UNATCO
Posts: 214
Joined: Fri Oct 28, 2016 12:54 pm

Re: HEEEEEEELP

Post by Kelkos »

Like he should freeze in this position and the gun should fire in his hand without moving.
Attachments
Capture.JPG
Being a soldier isn't just following orders, it's following those orders in the service of a higher cause. When that cause is betrayed, we're not soldiers anymore, just pieces on a chess board dying for the wrong reason.
User avatar
Kelkos
UNATCO
Posts: 214
Joined: Fri Oct 28, 2016 12:54 pm

Re: HEEEEEEELP

Post 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
Being a soldier isn't just following orders, it's following those orders in the service of a higher cause. When that cause is betrayed, we're not soldiers anymore, just pieces on a chess board dying for the wrong reason.
Post Reply