Game Development Community

Sniper Postion

by Anthony Rosenbaum · in Artist Corner · 06/20/2002 (7:12 pm) · 4 replies

O.K. remember in Tribes 2, when you hold a normal gun (spinfusor) that the player holds the gun at his waist. Like the default player holds a weapon. But remember when you hold a sniper rifle the player changed it's stance so that he looks down the barrel of the gun. How do you do that. I presume there is an animation that is built into the .dts but where in the code does the player change stance? Could someone help me with this? Eventually I need 3 poses for gun Normal/Sniper/Pistol

#1
06/20/2002 (8:00 pm)
I don't know how to do this, but I'm fairly sure that the default Torque model doesn't include such animations.
#2
06/20/2002 (8:12 pm)
Got it . . .from T2

is the weapons's .cs file my example is uzi.cs I put the variable
armThread = lookms;
in the datablock ShapeBaseImageData(UziImage)
then in weapon.cs go to function WeaponImage::onMount() and add
//CHANGE  ANIMATION FOR SNIPER/SNOOPER/Pistol too RIFLER
       if (%this.armthread $= "")
       {
          %obj.setArmThread(look);
       }
       else
       {
        %obj.setArmThread(%this.armThread);
        }
also add a new function
function WeaponImage::onUnmount(%this,%obj,%slot)
{
   %obj.setArmThread(look);
   Parent::onUnmount(%this, %obj, %slot);
}
this will set the player back to normal.
Finally in the player.dts the animations are called
lookms is for pistols and looksn is for sniper positions.
#3
06/14/2010 (7:26 am)
Anthony's script works. I did the same thing. I'm not a proffesional game developer I just fool around, and I'm using the t2 models.
#4
06/14/2010 (4:35 pm)
The best necro so far.