mardi 10 mars 2015

SetObjectMaterial + Weapon Objects

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


Code:



0, -1, "none", "none", FFFF0000

1, -1, "none", "none", FFFF0000



Result: http://ift.tt/1MrYga5



Using my script I swapped the object which retains the material information

Swap: http://ift.tt/1MrYhut

Object ID: 355 (AK47 model)



Object became invisible

Result: http://ift.tt/19aT2BE



Then swapped the object back to something else to test the material

Result: http://ift.tt/1MrYga7





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://ift.tt/19aT2RS

(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?




Aucun commentaire:

Enregistrer un commentaire