Do mountImage skinTags work in T3D/MIT?
by Gibby · in Torque 3D Professional · 11/06/2013 (6:43 pm) · 7 replies
Greets all:
I have a mech model that is skinned using the legacy Torque convention, i.e., it has a 'base' skin and eight other team colors. Problem is, the weapons, which use the same skin, won't change to team skins.
I define a %skinName variable ['red' blue' etc] that works fine with the model's body. I then use the following to mount the weapon:
This doesn't change the weapon's skin, even though the model's skin is correct and the weapon mounts correctly and fires just fine.
I have a mech model that is skinned using the legacy Torque convention, i.e., it has a 'base' skin and eight other team colors. Problem is, the weapons, which use the same skin, won't change to team skins.
I define a %skinName variable ['red' blue' etc] that works fine with the model's body. I then use the following to mount the weapon:
%mech.mountImage(MechaGun01ImageL, "0", true, %skinName);
This doesn't change the weapon's skin, even though the model's skin is correct and the weapon mounts correctly and fires just fine.
#2
Do you mean setSkinName on the weaponImage? I have tried that and then mounting but it doesn't seem to, nor do I believe that it should work on a weaponImage...
11/06/2013 (7:30 pm)
@Richard:Do you mean setSkinName on the weaponImage? I have tried that and then mounting but it doesn't seem to, nor do I believe that it should work on a weaponImage...
#3
I used this to add different skins to my Complete Desert Eagle pack, you can see the skin swap code here:-
www.deadlyassets.com/phpbb/viewtopic.php?f=4&t=4
I keep meaning to re look at it to update it for 2.0+ as I am Still working on my 2.0 update for my Complete Desert Eagle pack seems to have taken forever but ill health has slowed me down some as has my dog and my lady friend who thinks this is all s huge waste of time... don't you just love encouragement!
11/07/2013 (2:36 pm)
Hi Gibby, haven't looked into T3D 2.0+ but TGEA & T3D 1.0 and lower had a skin swap you could use at mount time.I used this to add different skins to my Complete Desert Eagle pack, you can see the skin swap code here:-
www.deadlyassets.com/phpbb/viewtopic.php?f=4&t=4
I keep meaning to re look at it to update it for 2.0+ as I am Still working on my 2.0 update for my Complete Desert Eagle pack seems to have taken forever but ill health has slowed me down some as has my dog and my lady friend who thinks this is all s huge waste of time... don't you just love encouragement!
#4
11/07/2013 (10:28 pm)
Ah - right, forgot that the Image objects aren't from the same base....
#5
11/08/2013 (5:26 am)
@David: I've been using the 'skinTag' for weapons since TGE, which is why my models are all still setup to work with TGE naming convention (base, red, blue, etc.) 'though I do have non-conventional DAE models working with team colors. Again after checking my syntax, I don't get why it won't work - wondering if there's a bug there. Know what you mean about IRL issues, trips to ER and calls to GF have been taking up my development time, too...
#6
Here's the function I'm using [sans a few ai bits]:
The mech spawns correctly but the weapons do not, even thought they share textures/materals with the body...
11/08/2013 (5:36 am)
@David: I've been using the 'skinTag' for weapons since TGE, which is why my models are all still setup to work with TGE naming convention (base, red, blue, etc.) 'though I do have non-conventional DAE models working with team colors. Again after checking my syntax, I don't get why it won't work - wondering if there's a bug there. Know what you mean about IRL issues, trips to ER and calls to GF have been taking up my development time, too...Here's the function I'm using [sans a few ai bits]:
function AIPlayer::spawnMech(%spawn, %team)
{
%mech = new AIPlayer()
{
dataBlock = Mecha01Data;
position = %spawn.getTransform();
};
MissionCleanup.add(%mech);
if ( %team $= "" || %team < 1 || %team > (theLevelInfo.numTeams) )
%team = getRandom(1,4));
%mech.team = %team;
if(theLevelInfo.numTeams >= 2)
{
%skinName = $Pref::Server::teamColor[%team];
%mech.setSkinName(%skinName);
}
%mech.mountImage(MechaGun01ImageL, "0", true, %skinName);
%mech.mountImage(MechaGun01ImageR, "1", true, %skinName);
return %mech;
}The mech spawns correctly but the weapons do not, even thought they share textures/materals with the body...
#7
11/08/2013 (6:38 am)
update, tried David's suggestion of adding to the Weapon::onUse, still doesn't seem to work
Torque Owner Richard Ranft
Roostertail Games