Obscure lua.log error

whoward69

DLL Minion
Joined
May 30, 2011
Messages
8,699
Location
Near Portsmouth, UK
Anyone seen this one before?

Code:
Incorrect type for pointer argument.  Using NULL instead.

No context, nothing, just that line appearing.

Looks like a C++ warning being reported in the lua.log file!

Probably going to have to add a lot of print()s to track it down :(
 
I have encountered this about 2 weeks ago, but I can't recall what it was (wasn't hard to fix for sure, otherwise I would remember this). And yes, I have used some prints :) to find the error line. It was in UnitPanel, but seriously I can't recall the issue itself.
 
WHOA WHOA WHOA Hold up...!
whoward... has a problem... with code... that he doesn't know how to fix...?!? :dubious:
(Countdown to the apocalypse)
Half-Life 3 confirmed

But seriously, you're saying that it appears to be a C++ error in the lua log... is that to say that you're not working with any lua for this mod? Or if so, what is it? Are you, as LastSword suggests, trying to edit UnitPanel.lua?
 
The whole issue is that Error doesn't show the code line. Depends on how much content Whoward added since last "bug free" testing, it will be less or more hard to fix.

I think it was something related to UI, so it doesn't necessary must be an UnitPanel as in my case.
 
Depends on how much content Whoward added since last "bug free" testing, it will be less or more hard to fix.

It's a port of an existing (working) mod to CivBE, so the answer is lots - over 1000 lines of code as a replacement core Lua file, a new UI context and a couple of supporting event handling Lua only contexts.
 
This error is coming from the UI implementation (C++ code), specifically when a UI method is expecting a control and doesn't get one.

There are very few such methods, so finding the error in your own code once you know what it's trying to tell you, should be fairly quick.

The two methods that I know of both relate to stacks

Code:
ContextPtr:BuildInstanceForControl("Item", instance, [COLOR="Red"]Controls.MyStack[/COLOR])
Controls.TheStack:ReleaseChild([COLOR="red"]instance.Container[/COLOR])

If Controls.MyStack or instance.Container don't refer to a valid UI control (usually nil due to a typo), you'll get the error message.

You could also get it when using the InstanceManager (although it's less likely as that explicitly checks for a nil being passed as the parent)

Code:
local IM = InstanceManager:new("Instance", "Root", [COLOR="Red"]Controls.MyButton[/COLOR])
where Controls.MyButton is not nil, but also not a valid stack
 
Top Bottom