Material Weapon Namespace error/fix
by Steve Acaster · in Torque Game Engine Advanced · 02/22/2009 (3:40 pm) · 0 replies
I'm still using 1.7.1 as I haven't fully ported all of my "inner workings" to 1.8.1 yet. But it's probably the same there too.
Starting to normal and spec map my weapons' textures and ran into this bug when trying to apply a material.cs, and my texture vanished to be replaced with the orange horror of "no material".
To cut a long story of #hours trial_and_error_bughunt short, it's caused by your weapon's texture and weapon name (from the cs file) being the same (in the above example that's my weapon called Shotgun and my texture also called Shotgun. It seems to cause a conflict/total_nervous_breakdown where TGEA thinks the weapon_object_type and the material are the same thing).
So, an easy fix, just don't call your weapon texture the same name as your weapon. eg: shotgun = the weapon (in shotgun.cs) and shotguntex = the shotgun model's texture (in material.cs).
A quick re-export of the shotgun model with a link to the renamed texture, and diffuse, spec and normal mapping now all work fine!
As I didn't see this issue mentioned when I did a search, I figured I'd post this problem/solution.
Starting to normal and spec map my weapons' textures and ran into this bug when trying to apply a material.cs, and my texture vanished to be replaced with the orange horror of "no material".
Namespace::unlinkClass - cannot unlink namespace parent linkage for Shotgun for Material. Error: cannot change namespace parent linkage of Shotgun from Material to Weapon.
To cut a long story of #hours trial_and_error_bughunt short, it's caused by your weapon's texture and weapon name (from the cs file) being the same (in the above example that's my weapon called Shotgun and my texture also called Shotgun. It seems to cause a conflict/total_nervous_breakdown where TGEA thinks the weapon_object_type and the material are the same thing).
So, an easy fix, just don't call your weapon texture the same name as your weapon. eg: shotgun = the weapon (in shotgun.cs) and shotguntex = the shotgun model's texture (in material.cs).
A quick re-export of the shotgun model with a link to the renamed texture, and diffuse, spec and normal mapping now all work fine!
As I didn't see this issue mentioned when I did a search, I figured I'd post this problem/solution.
About the author
One Bloke ... In His Bedroom ... Making Indie Games ...