Need Help - Derivatives of DNumberWang Not Being Created
2 replies, posted
I don't know if I'm doing something stupidly specific, but it's not working, and I need help.
I'm creating custom vgui panels for my gamemode's menu. What's appearing to be causing problems is a custom DNumberWang panel nested inside a custom DPanel panel. Here's my broken-down code with all additional code (which has been tested commented out with no change in failure):
local AmmoWang = {}
vgui.Create( "AmmoWang", AmmoWang, "DNumberWang" )
vgui.Create( "LNumberWang", AmmoWang, "DNumberWang" )
function WeaponOptionPanel:SetWeapon( newWeaponClass, weaponCost, weaponType, specialName, specialModel )
--Stuff has been commented out here
self.ammowang = vgui.Create( "LNumberWang", self )
self.testwang1 = vgui.Create( "AmmoWang", self )
self.testwang2 = vgui.Create( "DNumberWang", self )
end
And client receives these errors when the 3 vgui.Create() functions are ran:
Warning: vgui.Create failed to create the VGUI component (LNumberWang)
Warning: vgui.Create failed to create the VGUI component (AmmoWang)
Am I missing something? AmmoWang had a bunch of additional function overrides attached to it which I've commented out but that's done nothing to help. Just leaving it an empty table does nothing to help, but if I try to create a regular DNumberWang, everything's fine. What gives? Any ideas? Can provide more code as needed.
Either the vgui.Register doesn't run, which can be caused by Lua errors as well, or its run too late
FOUND THE PROBLEM.
Turns out, out of all the custom vgui elements I was creating, this was the only one where I had vgui.Create instead of vgui.Register for it.
Lul I'm an idiot.
Sorry, you need to Log In to post a reply to this thread.