UE3 - UDK Needing some input for weapon checks

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

hicks16

New Member
Dec 6, 2010
34
0
0
Ok so I got the animations implemented but now that we are using multiple weapons I need to create a weapon check and once the check of the weapon is done it then does its correct animation. I have the bases of a weapon doing correct weapon animation on mouse click, but just not the weapon check.

What I have brainstorming wise is this:

var int Weapon[2];
var int weaponInHand;

Weapon[0] = 1; //sword
Weapon[1] = 2; //crossbow

weaponInHand = Weapon array

once the weaponInHand is assigned to weapon array then you move the weaponInHand to the Trace function we have made.

*note. DO NOT COMMENT ON THE TRACE FUNCTION, IT IS TEMP*
Code:
function canTrace(int weaponInHand, byte FireModeNum)
{
	if (WeaponOnHand == 1 )
        {
           if(FireModeNum == 0) //checks if mouse 1 was clicked
           {
              PlayEmote('SwingSword', 1); //plays sword animation
              SetTimer(8.0,false,'cantTrace');
           }        
           else //means mouse 2 was clicked
           {
                 PlayEmote('BashSword',0);
                 SetTimer(8.0,false,'cantTrace');
           }
        }
        if (WeaponOnHand == 2 ) //checks for crossbow in hand
        {
           if(FireModeNum == 0) //checks if mouse 1 was clicked
           {
              PlayEmote('Crossbow_Fire', 1); //does fire animation
              SetTimer(8.0,false,'cantTrace');
              PlayEmote('Crossbow_Reload, 1); //does reload animation
              SetTimer(8.0, false,'cantTrace');
           }        
           else //means mouse 2 was clicked
           {
                 PlayEmote('BashCrossBow',0);
                 SetTimer(8.0,false,'cantTrace');
           }
        }
}

Just would like to hear some input from some UnrealScripters
 

kiff

That guy from Texas. Give me some Cash
Jan 19, 2008
3,793
0
0
Tx.
www.desert-conflict.org
just curious.... are these animations just for effects or actual melee strikes. if they're for melee, you should probably just let the existing code call playfireeffects (?) (from weapon fired code).