SetSkinName troubles (multiple materials per object)
by Daniel Buckmaster · in Torque Game Engine · 04/12/2008 (6:32 am) · 3 replies
Yes, I know this has been brought up before. I've searched and I don't think my issue is any of the above.
I don't want any extraordinarily fancy skin swapping in my game - just an option like in Tribes to change your player's skin for different factions. I tried this out with a simple test model. It has two cubes in it, both of which have a different material assigned (base.skinRed and base.skinBlue). In other detail levels, other colours are used (base.LGreen/base.DGreen and base.LBrown/base.DBrown).
I then made skin variants, naming these unbase.skined, unbase.skinBlue, etcetera.
When I call %object.setSkinName('unbase'); odd things happen. For one of the two cubes in the model, everything works nicely. Its former base.skinBlue changes to unbase.skinBlue, etc. However, the other cube has problems. In the highest detail level, its skin is unchanged - and in the lower ones, the skin disappears entirely (it goes the colour that DTSs normally do when a texture can't be found). No console errors or anything.
I added this resource, but nothing seems to have changed.
I'm thinking this is a problem with having multiple mesh objects, rather than multiple materials... I guess a code fix is required.
I don't want any extraordinarily fancy skin swapping in my game - just an option like in Tribes to change your player's skin for different factions. I tried this out with a simple test model. It has two cubes in it, both of which have a different material assigned (base.skinRed and base.skinBlue). In other detail levels, other colours are used (base.LGreen/base.DGreen and base.LBrown/base.DBrown).
I then made skin variants, naming these unbase.skined, unbase.skinBlue, etcetera.
When I call %object.setSkinName('unbase'); odd things happen. For one of the two cubes in the model, everything works nicely. Its former base.skinBlue changes to unbase.skinBlue, etc. However, the other cube has problems. In the highest detail level, its skin is unchanged - and in the lower ones, the skin disappears entirely (it goes the colour that DTSs normally do when a texture can't be found). No console errors or anything.
I added this resource, but nothing seems to have changed.
I'm thinking this is a problem with having multiple mesh objects, rather than multiple materials... I guess a code fix is required.
About the author
Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!
#2
EDIT: Seems to have worked! Thank you very much for the pointer.
04/16/2008 (7:32 am)
Thanks very much for the link! I'll have a go at it.EDIT: Seems to have worked! Thank you very much for the pointer.
#3
04/17/2008 (12:51 pm)
Glad I could help. We've noticed we can't use this for items mounted as images (declared as ShapeBaseImageData), which does reduce it's usefulness a little. But it's still really useful :-)
Torque Owner Ed Zavada
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=14366