Change Player Shape changing weapon
by University of Pisa (#0004) · in Torque Game Engine · 04/16/2006 (3:06 am) · 4 replies
Hi,
I need to change appearance of player when he gets a new weapon,
i.e. if i have a rifle i don't hold it like a gun, and so on.
Anyone can help me?
I need to change appearance of player when he gets a new weapon,
i.e. if i have a rifle i don't hold it like a gun, and so on.
Anyone can help me?
About the author
#2
This is setup in the model and a tiny bit in script.
In your weapon.cs script you'll need something like this...
Then all you have to do is create the arm thread in your model and you're set.
04/16/2006 (4:40 am)
If you're talking about different holding positions then you need to specify 'arm threads'. This lets a character hold different weapons in a different position. E.g. select a pistol and one hand is used, machine gun and two hands and so on. This is setup in the model and a tiny bit in script.
In your weapon.cs script you'll need something 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 (%this.armthread $= "")
%obj.setArmThread(lookms);
else
%obj.setArmThread(%this.armThread);
}and in each individual weapon script, ie rifle.cs...datablock ShapeBaseImageData(rifleImage)
{
// Basic Item properties
...
...
armThread = "looknw";Then all you have to do is create the arm thread in your model and you're set.
#3
04/16/2006 (5:49 am)
Thx for your help, now it's clear.
#4
04/16/2006 (7:50 am)
...and make certain they're Blend type animation sequences[for any look*], or they may not sync up correctly inside the engine to what you see in the modelling program.
Torque Owner Paul /*Wedge*/ DElia