Game Development Community

Different pose for different weapon

by CIMO · in General Discussion · 04/20/2006 (10:58 am) · 39 replies

Any resource or boy for help my? I have a different weapon and i would create a different pose on use...
Example:
I have a pistol and i use a pistol my play stay in pose of pistol....
I have a bazooka and i use this my player stay in pose of bazooka....
Thanks plase =D
Page «Previous 1 2
#1
04/20/2006 (11:06 am)
I havnt done it yet, but I know its possible from the research ive done.

You have to have a Blend Sequence for each gun pose.
And as the gun is picked up trigger whichever Blend animation
is desired.

Im sure someone else can post some hard code to this.


-Surge
#2
04/20/2006 (11:12 am)
I search the code....Animation no problem....But i would a code for different pose for different weapon...Any?
#3
04/20/2006 (11:18 am)
??? what ???
#4
04/20/2006 (11:24 am)
I'm looking into doing this for my game sometime soon, I'll post the code up when it's done.
#5
04/20/2006 (11:26 am)
I would a code for use my different animation:

root_pistol with weapon: pistol
and
root_bazooka with weapon: bazooka

in game when select a different weapon
#6
04/20/2006 (12:04 pm)
Yes, use setArmThread. I call it in the image onMount callback like this:

function WeaponImage::onMount(%this,%obj,%slot)
{
   // Images assume a false ammo state on load.  We need to
   // set the state according to the current inventory.
   if (%obj.getInventory(%this.ammo))
      %obj.setImageAmmo(%slot,true);

    // Set the appropriate arm animation thread.
    if(%this.armthread !$= "")
        %obj.setArmThread(%this.armThread);
    else
        %obj.setArmThread("look");
}

%this.armthread being a datablock variable
#7
04/20/2006 (1:11 pm)
Can you stack blends like this though? M'not wholly sure how it will work... guess s'about time I started playing with it though.
#8
04/21/2006 (12:19 am)
Ok .... and i put in place of ("look") my -> root_pistol ?
the rest all equal?
Any questions.....But how change a image for different weapon with this?!?!?
#9
04/25/2006 (11:02 am)
Help....I use this code...but my pose use for all weapon!!!
I would use a different pose for different weapon....Help please...THANKS
#10
04/27/2006 (12:23 am)
Cimo.

this function %obj.setArmThread(%this.armThread);
will use your animation
here it looks like the weapon has a string to specify which arm animation.
you probably have not configured each weapon to specify the animation string.


I think you need to maybe grasp a little more about the scripting language to get this accomplished.
#11
04/27/2006 (12:38 am)
Under the weapon script you need to define an armthread
#12
04/27/2006 (3:22 am)
Ok...But i put this function in weapon.cs --- in my pistol.cs...
But for ALL weapon my player use a pose for pistol...
Step by step help my?.....THANKS for learn THANKS
#13
04/27/2006 (4:54 am)
Yes I would be interested in a step-by-step guide as well please.
#14
04/27/2006 (7:30 am)
Cimo this is mainly an exporter issue. you have setarmthread(), playthread(), and setactionthread() functions at your disposal. the script code calls setarmthread() using whatever animation is specified for that weapon. if you want different animations to run simultaneously, like running + weapon poses, you have to do special things to flag some animations as "blend" animations before theyll work properly in torque. basically, this isn't going to be easy. if you just want your mesh to perform general animations playthread() will suffice, but getting different parts of your model to perform different animation sequences at the same time takes more time to set up.

heres a thread where I'm begging for animation info:
www.garagegames.com/mg/forums/result.thread.php?qt=33157

if you're using Milkshape, this thread explains alot:
www.garagegames.com/mg/forums/result.thread.php?qt=32651

Rex's Milkshape blend animations tutorial:
pages.sbcglobal.net/rexpiscator/_wsn/page9.html

google is your friend for this.
#15
04/27/2006 (2:56 pm)
Ok but my problem is a put a script in the game....
For the graphic not problem...The pose for my pistol and my bazooka exist and i call "root_pistol" and "root_bazooka"
I would learn step by step to use a script for take a my player a different pose for my different weapon why i don't understood to use this code for take a different pose for my pistol and my bazooka....If i use this code...my player use same pose (root_pistol) for also my bazooka....Thanks for the help THANKS =)
#16
04/27/2006 (2:59 pm)
Correct me if im wrong.

but i'm sure you can simply do this:
%obj.setArmThread("root_pistol");
%obj.setArmThread("root_bazooka");

now that should allow you (one at a time) to play the desired animation.


is that correct?
#17
04/27/2006 (3:23 pm)
I think they should be exported as blend animations, to overlay with your movement animations. It's how my system works, though it's more complex and uses a blend per arm and playThread.
#18
04/28/2006 (3:38 am)
Ok but this is my problem =)
I put this code
function WeaponImage::onMount(%this,%obj,%slot)
{
   // Images assume a false ammo state on load.  We need to
   // set the state according to the current inventory.
   if (%obj.getInventory(%this.ammo))
      %obj.setImageAmmo(%slot,true);

    // Set the appropriate arm animation thread.
    if(%this.armthread !$= "")
        %obj.setArmThread(%this.armThread);
    else
        %obj.setArmThread("root_pistol");
}
In weapon.cs and my player use a "root_pistol" for all weapon....
Then i put this code in pistol.cs on end of file and my player use this pose for all weapon....
I would learn a put the all code in way correct to step by step...
THANKS
#19
04/28/2006 (4:44 am)
From the looks of your code your armThread datablock may not exist?

so it fails during the line...
// Set the appropriate arm animation thread.
    if(%this.armthread !$= "")

it will then always play root_pistol instead - possibly all the time no matter what your character is supposed to be doing.
#20
04/28/2006 (4:53 am)
Then i put this code
function WeaponImage::onMount(%this,%obj,%slot)
{
   // Images assume a false ammo state on load.  We need to
   // set the state according to the current inventory.
   if (%obj.getInventory(%this.ammo))
      %obj.setImageAmmo(%slot,true);

    // Set the appropriate arm animation thread.
    if(%this.armthread !$= "root_pistol")
        %obj.setArmThread(%this.armThread);
    else
        %obj.setArmThread("root_pistol");
}
To end of the my pistol.cs?
Page «Previous 1 2