11.03.2015, 05:07
Hello there,
As I was working on the inventory script I wondered what would happen if I colored a weapon. Turns out that the weapon becomes invisible if you recolor it using SetObjectMaterial no matter what index or color you input:
I took an object, recolored it to red using parameters
Result: http://i.imgur.com/lqzCT0Z.jpg
Using my script I swapped the object which retains the material information
Swap: http://i.imgur.com/SXb8h4p.jpg
Object ID: 355 (AK47 model)
Object became invisible
Result: http://i.imgur.com/f2Q4NmX.jpg
Then swapped the object back to something else to test the material
Result: http://i.imgur.com/tWWs6AP.jpg
So the materials were correctly set, but the object became invisible as soon as SetObjectMaterial was applied; oddly enough, recoloring them when on your hand does work:
Result: http://i.imgur.com/N3e4007.jpg
(This is the actual color that is stored in the db for the object, which is -10092289 (FF6600FF), and yes, I have an RGBA to ARGB)
So, how do you recolor a weapon object dropped on the ground, what parameters do you need exactly?
As I was working on the inventory script I wondered what would happen if I colored a weapon. Turns out that the weapon becomes invisible if you recolor it using SetObjectMaterial no matter what index or color you input:
I took an object, recolored it to red using parameters
Код:
0, -1, "none", "none", FFFF0000 1, -1, "none", "none", FFFF0000
Using my script I swapped the object which retains the material information
Swap: http://i.imgur.com/SXb8h4p.jpg
Object ID: 355 (AK47 model)
Object became invisible
Result: http://i.imgur.com/f2Q4NmX.jpg
Then swapped the object back to something else to test the material
Result: http://i.imgur.com/tWWs6AP.jpg
So the materials were correctly set, but the object became invisible as soon as SetObjectMaterial was applied; oddly enough, recoloring them when on your hand does work:
Result: http://i.imgur.com/N3e4007.jpg
(This is the actual color that is stored in the db for the object, which is -10092289 (FF6600FF), and yes, I have an RGBA to ARGB)
So, how do you recolor a weapon object dropped on the ground, what parameters do you need exactly?