DTS shapes & textures
by Marcin Zygmunt · in Torque Game Engine · 04/25/2005 (11:52 am) · 5 replies
I need to change a texture of DTS object when it is hit. I found that StaticShapeData has a filed called cloakTexture. Can I change it during runtime? Will there be any problems with lighting?
About the author
#2
04/25/2005 (11:36 pm)
Yes, no. cloakTexture is a red herring. Try using dump().
#3
%bot.setSkinName(texturename);
The texture you want to change must be called base.something.jpg. The new one you want to use should be called whatever.something.jpg, and then use setSkinName(whatever).
So, your bot uses base.soldier.jpg.
When hit, you want iamhit.soldier.jpg
just call %bot.setSkinName(iamhit); :)
04/26/2005 (12:57 am)
Don't StaticShapes have something called setSkinName? I used it for changing my bot's clothes.%bot.setSkinName(texturename);
The texture you want to change must be called base.something.jpg. The new one you want to use should be called whatever.something.jpg, and then use setSkinName(whatever).
So, your bot uses base.soldier.jpg.
When hit, you want iamhit.soldier.jpg
just call %bot.setSkinName(iamhit); :)
#4
04/26/2005 (9:13 am)
Uhm, I tried to do so and... nothing happened. Is there any other way to do this?
#5
04/26/2005 (10:06 am)
Try again, maybe under a debugger so you can see what it's trying to do. The alternative is to just implement some other functionality to do the same thing - your choice, learn/fix or reimplement. :)
Torque Owner Marcin Zygmunt