exception 'invoke function call on non function value'

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
njg
Posts: 14
Joined: Thu Feb 12, 2015 3:10 pm

exception 'invoke function call on non function value'

Post by njg »

Hi,

the subject says it all,

exception 'invoke function call on non function value'

could someone tell me what this means? the c# function is defined to Lua the same as all the rest of them and has the same pattern. Its kind of odd…to me at least.

Thanks,

Nick
User avatar
Tony Li
Posts: 21636
Joined: Thu Jul 18, 2013 1:27 pm

Re: exception 'invoke function call on non function value'

Post by Tony Li »

Hi Nick,

This means Lua Interpreter (the default Lua implementation used by the Dialogue System) thinks you're trying to call a function, but it doesn't recognize the function name. Could there be a typo?

You can add a Lua Console to interactively test Lua code.

If that doesn't help, can you post the code here? Are you using Lua.RegisterFunction() to register the C# function with Lua? Please also feel free to email an example project to tony (at) pixelcrushers.com. I'll be happy to take a look.

If you're using Unity 4 Pro or Unity 5, another option is to import the package "Third Party Support/NLua Support", or "NLua Unity 5 Support" for Unity 5. This switches the Dialogue System to NLua, which is a different Lua implementation that has more intelligible error messages. (It also runs faster. In most cases the speed difference isn't noticeable, but if you're running a lot of Lua code it can make a difference.)
njg
Posts: 14
Joined: Thu Feb 12, 2015 3:10 pm

Re: exception 'invoke function call on non function value'

Post by njg »

yes there might be a typo … three p's in a row instead of two and my tired old eyes aren't what they used to be, thanks for the pointer,

Nick
User avatar
Tony Li
Posts: 21636
Joined: Thu Jul 18, 2013 1:27 pm

Re: exception 'invoke function call on non function value'

Post by Tony Li »

Let me know if that isn't the issue. We can get to the bottom of it. :-)
Post Reply