Set emap dynamically?
by Ken Davis · in Torque Game Engine · 11/14/2004 (3:49 am) · 5 replies
Does anyone know how to dynamical set emap=true for my player when he picks up an object. What we are doing is, if a player picks up a certain object, he becomes immune to damage for 30 seconds or so. We want to set his emap=true so he will no longer show the skins, but rather have that cool reflective appearance. I think we will also need a timer/scheduler to set emap back to false after 30 seconds. How do I do that. Can I do something line %this.setEmap(true)?
-Thanks,
Ken
-Thanks,
Ken
#2
11/14/2004 (9:36 am)
Unfortunately, emap is part of the datablock, so it won't take effect immediately. However, it would be easy to add a check in ShapeBase to accept a local override like you describe.
#4
11/14/2004 (11:58 am)
You may not be able to set the emap property dynamically, but you are able to set the skin dynamically. So, create 2 skins, one for wich the alpha channel is black, and one for wich the alpha channel is white. Then, switch skins, and the one with the white alpha channel will cuase the model to be reflective, and texture with the black alpha channel won't "reflect" at all.
#5
Ken, unfortunately, I don't have time to give you a detailed example. Basically, the difference is between defining a field on the datablock and defining one on the object itself. If you understand the difference between those two things you're well on the way to solving the problem.
11/14/2004 (10:13 pm)
Ward has a good idea.Ken, unfortunately, I don't have time to give you a detailed example. Basically, the difference is between defining a field on the datablock and defining one on the object itself. If you understand the difference between those two things you're well on the way to solving the problem.
Torque Owner Todd Harbour
Not sure about how to do that but I just tried making a white skin and that seemed to look pretty much the same (see below). You could just play around a bit with maybe a slightly greyer version etc till you get the look you're after.
Hope this helps.