.setSkinName problems
by Davis Ray Sickmon, Jr · in Torque Game Engine · 09/26/2002 (2:55 pm) · 1 replies
Greetings -
Ok, I are confused... I'm using %player.setSkinName(%thisskin); to load a new skin on the the model when the player enters the game. Actually, I've tried both passing a variable (%thisskin) that I've placed the path to the proper skin file, and I've tried just passing it directly as tagged (IE: %player.setSkinName('~/data/shapes/Players/player/gold.png'); )
Checking the console, it shows that the tagged name has been put in the index, so, no problems there. No error seems to be returned. However, the model does not change skins. Did the obvious stuff: Checked the file path, make sure the skin was valid using one of my other tools that shows a model with a new skin in Torque (well, not mine - Matt Webster's work :-), etc. And then I went forums-diving and resources-diving for a couple o' hours. Then did some C++ code diving to see if I was missing something. No dice.
Ok, any clues on what dumb thing I've done here to make it not work right? :-)
Ok, I are confused... I'm using %player.setSkinName(%thisskin); to load a new skin on the the model when the player enters the game. Actually, I've tried both passing a variable (%thisskin) that I've placed the path to the proper skin file, and I've tried just passing it directly as tagged (IE: %player.setSkinName('~/data/shapes/Players/player/gold.png'); )
Checking the console, it shows that the tagged name has been put in the index, so, no problems there. No error seems to be returned. However, the model does not change skins. Did the obvious stuff: Checked the file path, make sure the skin was valid using one of my other tools that shows a model with a new skin in Torque (well, not mine - Matt Webster's work :-), etc. And then I went forums-diving and resources-diving for a couple o' hours. Then did some C++ code diving to see if I was missing something. No dice.
Ok, any clues on what dumb thing I've done here to make it not work right? :-)
About the author
Torque Owner Sam Guffey
The models skin "MUST" be name with the prefix "base.nameoftheskin.png", I call mine based on the playes size just like tribes did.. example - "base.mmale.png".
After you have the skin named right and the model exported we can begin with the script part.
Now if you want it based on the team the person is on, then in the createPlayer function use this example.
if(%player.client.team == 1) %skin = "red"; else %skin = "blue"; %player.setSkinName(%skin);These are 2 different color skins, one called "red.mmale.png" and the other "blue.mmale.png".
The engine looks for "base" and replaces it with the name you want. No problem.
Hope this helps those that didnt know..
Sam