different player animations using different weapons?
by David Robert Pemberton · in Torque Game Engine Advanced · 02/05/2009 (3:01 pm) · 5 replies
Is it possible in script to get different player animations when using different weapons?
Eg. if a player is carrying a pistol, to change (blend) his root animation to that of a pistol carrier. or if he’s carrying a bazooka to his arms holding the bazooka and not his default root of holding a low slung rifle
I can do the blend animations myself (with a bit of fiddling)
I have got a basic pistol animation, but if I %obj.setActionThred("Pistol");
The avatar, raises his right hand, lowers his left then snaps back to the root animation.
I’m new to Torque and am not sure If I have missed something,
I have tried to do a search of the forums to see If someone else has asked or indeed done similar things but other than a couple of unanswered queries have found nothing.
I would like to do this in script as I plan to release a complete drop in contents pack starting with a Desert Eagle .50, fully animated with all the scripts ready to drop right into a clean build of torque, I already have my fully animated Desert Eagle model with 5 different skins, normal maps, LoD’s etc. complete with scripts for reloading magazines but am having trouble with the Avatar animations.
Any pointers to help me in the right direction would be appreciated.
I’ll be posting a blog later with screenshots of the Desert Eagle in TGEA.
Eg. if a player is carrying a pistol, to change (blend) his root animation to that of a pistol carrier. or if he’s carrying a bazooka to his arms holding the bazooka and not his default root of holding a low slung rifle
I can do the blend animations myself (with a bit of fiddling)
I have got a basic pistol animation, but if I %obj.setActionThred("Pistol");
The avatar, raises his right hand, lowers his left then snaps back to the root animation.
I’m new to Torque and am not sure If I have missed something,
I have tried to do a search of the forums to see If someone else has asked or indeed done similar things but other than a couple of unanswered queries have found nothing.
I would like to do this in script as I plan to release a complete drop in contents pack starting with a Desert Eagle .50, fully animated with all the scripts ready to drop right into a clean build of torque, I already have my fully animated Desert Eagle model with 5 different skins, normal maps, LoD’s etc. complete with scripts for reloading magazines but am having trouble with the Avatar animations.
Any pointers to help me in the right direction would be appreciated.
I’ll be posting a blog later with screenshots of the Desert Eagle in TGEA.
About the author
http://www.deadlyassets.com I have a love of computers and programming them, have written a few games (ADV, Demon's Domain to name a couple) and even a couple of engines lost in the distant past of floppy disks
#2
yes, the .DSQ I'm using is interchangable with all the TorquOrc/ForgeSoldire etc Avatars, I have the script in place to use it, but It dosn't blend it just plays then snaps back to the default at rest, low slung, 2 handed weapon pose when I want the arm to remain raised so the pistol can be seen in 1st person and look like the player is using a pistol not an smg in 3rd person.
plus I'm not a good enough animator to totaly replace all the DSQ's plus when I swap weapons, I would like the avatar to look like hes holding the appropriate weapon :)
02/05/2009 (3:28 pm)
Hi JesseLyes, the .DSQ I'm using is interchangable with all the TorquOrc/ForgeSoldire etc Avatars, I have the script in place to use it, but It dosn't blend it just plays then snaps back to the default at rest, low slung, 2 handed weapon pose when I want the arm to remain raised so the pistol can be seen in 1st person and look like the player is using a pistol not an smg in 3rd person.
plus I'm not a good enough animator to totaly replace all the DSQ's plus when I swap weapons, I would like the avatar to look like hes holding the appropriate weapon :)
#3
Basically, you'd probably want something like an FSM system which plays animations sets based on a getMountedImage($WeaponSlot); return.
If all of that sounds like goobledigook then I don't blame you! Do a search for FSMs (finite state machines) there's a few demonstrated in Torque scripts. You'd probably have to put it in right at the top of the hierarcy controlling the players animations, however I think that the standard animations of the stock characters do feature a root pose for unarmed as well as the more usual "holding a gun" pose.
02/05/2009 (3:32 pm)
There are some resources for new stances/player positions like duck/crouch (you might have to port them from TGE). If you used them as a guide you should be able to set up a whole range of weapon holding animations.Basically, you'd probably want something like an FSM system which plays animations sets based on a getMountedImage($WeaponSlot); return.
If all of that sounds like goobledigook then I don't blame you! Do a search for FSMs (finite state machines) there's a few demonstrated in Torque scripts. You'd probably have to put it in right at the top of the hierarcy controlling the players animations, however I think that the standard animations of the stock characters do feature a root pose for unarmed as well as the more usual "holding a gun" pose.
#4
02/05/2009 (3:41 pm)
Thanks Steve, FSM sounds interesting I'll try find it and take a look
#5
Although am having trouble with blended animations on the standard torque player Avatars. They only seem to work anywhere near correctly if I re-export the Avatars meshes (using the already predifined root pose) this dosn't seem to change any of there pre existing animations.
anyone any ideas why this is? unless the stock .dts's aren't the same node structure as the .max's?
I'm using Maxtodtsexporter in Max 9 could this be causing the problem?
I'm also having the problem that the dsq's aren't showing in ShowTool Pro unless I export the root avatar
plus unmessdts has stitched a bit of the orc's pants to his hand hehe
02/10/2009 (10:07 am)
It seems %obj.setArmThred("Pistol"); was closer to what I wanted.Although am having trouble with blended animations on the standard torque player Avatars. They only seem to work anywhere near correctly if I re-export the Avatars meshes (using the already predifined root pose) this dosn't seem to change any of there pre existing animations.
anyone any ideas why this is? unless the stock .dts's aren't the same node structure as the .max's?
I'm using Maxtodtsexporter in Max 9 could this be causing the problem?
I'm also having the problem that the dsq's aren't showing in ShowTool Pro unless I export the root avatar
plus unmessdts has stitched a bit of the orc's pants to his hand hehe
Torque Owner JesseL
Pyrotronics-Games