Attachable: self.RootID = self.ID? What?
Now I'm modding a sniper gun, which uses Lua to charge and fire bullets.
So I added an attachable with Lua script:
to the HDFirearm:
and then used:
Code:
if not self.gun then
print("1");
if self.RootID == self.ID then
print("3");
end
mo = MovableMan:GetMOFromID(self.RootID);
if IsHDFirearm(mo) then
print("2");
self.gun = ToHDFirearm(mo);
end
...
to check it. It print "3", the RootID of the attachable is its self.ID.
The attachable thing did attach to the gun in game. Oh and, even with DrawAfterParent = 0, it showed beyond the sniper. What's wrong?