How to switch meshes for things like clothing and equipment?
by Aaron Maldonado · in Torque 3D Beginner · 06/03/2013 (10:40 pm) · 6 replies
I know that I would like to give players abilities for to switch cloths. That is pretty much a must for typical online games though it obviously depends on the game. I am not absolutely clear on how to go about doing this in Torque 3D, so I would like some help understanding how to do this.
About the author
#2
06/04/2013 (7:57 am)
@Ahsan isn't it setSkinName(string skin) ;)
#3
base_shirt_material (what the mapTo material is - first word must be "base")

blue_shirt_material
green_shirt_material
loud_shirt_material
ugly_shirt_material
SetSkinName swaps "base" for the first word of the new material.
%obj.setSkinName("ugly");

eeeewwwwww ....
For meshes you can call them whatever you want and use "setMeshHidden(%meshName, %bool)".
%obj.setMeshHidden("shirt_mesh", false);
%obj.setMeshHidden("jacket_mesh", true);
Show the shirt and hide the jacket. Mesh names are the names of the actual meshes inside the DAE/DTS model.
06/04/2013 (8:45 am)
How to use "setSkinName(%skin)".base_shirt_material (what the mapTo material is - first word must be "base")

blue_shirt_material
green_shirt_material
loud_shirt_material
ugly_shirt_material
SetSkinName swaps "base" for the first word of the new material.
%obj.setSkinName("ugly");

eeeewwwwww ....
For meshes you can call them whatever you want and use "setMeshHidden(%meshName, %bool)".
%obj.setMeshHidden("shirt_mesh", false);
%obj.setMeshHidden("jacket_mesh", true);
Show the shirt and hide the jacket. Mesh names are the names of the actual meshes inside the DAE/DTS model.
#4
last time i worked with t3d's gui part and it was setskin for guiobjectview.
for shapebase (player) it will be setSkinName(%skin).
for example look into "scripts\server\gameCore.cs"
then search for "%player.setSkinName(%client.skin);".
for example skin list look into "game\art\shapes\actors\Soldier\materials.cs"
u will see defination like "singleton Material(Mat_XXX_Soldier_Main){}"
in this case XXX->is the part which determine which skin will be used.
06/04/2013 (9:13 am)
my mistake.last time i worked with t3d's gui part and it was setskin for guiobjectview.
for shapebase (player) it will be setSkinName(%skin).
for example look into "scripts\server\gameCore.cs"
then search for "%player.setSkinName(%client.skin);".
for example skin list look into "game\art\shapes\actors\Soldier\materials.cs"
u will see defination like "singleton Material(Mat_XXX_Soldier_Main){}"
in this case XXX->is the part which determine which skin will be used.
#5
06/05/2013 (3:06 am)
Thank you all for the help. It helps a lot to know this.
Ahsan Muzaheed
Default Studio Name
better go for texture changing using setSkin()
do a forum search with "setSkin"
http://www.garagegames.com/community/search#gsc.q=setskin&gsc.ref=forums&gsc.tab=0