Game Development Community

TGEA setSkinName

by Rudolf Kajan · in Torque Game Engine Advanced · 06/22/2007 (6:02 am) · 6 replies

Is setSkinName working on TGEA ? I have problems with it - I have a character, textures named
body1.body.jpg,
body2.body.jpg,
legs1.body.jpg,
legs2.body.jpg,

and material

new Material(body1)
{
mapTo = "base.body";
baseTex[0] = "body1.body";
};

when I enter mission, body texture is OK, when I change it through setSkinName I have yellow No Texture texture on chracter's body. In TGE it was working. Any ideas ?

#1
06/22/2007 (7:45 am)
You need a Material entry for every one of those texture files. Create one that has each of them as the "baseTex" entry and remove the "mapTo" entry.
#2
06/22/2007 (9:39 am)
Still that yellow texture :(

in materials.cs I have

new Material(NPC_body)
{
baseTex[0] = "body19.body";
baseTex[1] = "body20.body";
baseTex[2] = "body21.body";
};

console command is : $NPC1.setskinname("body21");

what do I wrong ?
#3
06/22/2007 (9:33 pm)
Still not quite. You need different Materials for each one:
new Material(body19)
{
    baseTex = "body19.body";
};

new Material(body20)
{
    baseTex = "body20.body";
};

new Material(body21)
{
    baseTex = "body21.body";
}
#4
06/23/2007 (4:56 am)
Now it works but only the first time I call setskinname(). second call makes nothing. is something like refresh then needed ? thanks.
#5
06/23/2007 (5:01 pm)
Preload = true; perhaps? know thats what i needed to add to get that other swapping rescource to work...
#6
06/24/2007 (1:50 am)
No, preload didn't help :(