Page 1 of 1

exception 'invoke function call on non function value'

Posted: Sat Jun 06, 2015 12:55 pm
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

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

Posted: Sun Jun 07, 2015 9:22 pm
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.)

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

Posted: Mon Jun 08, 2015 4:17 pm
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

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

Posted: Mon Jun 08, 2015 8:23 pm
by Tony Li
Let me know if that isn't the issue. We can get to the bottom of it. :-)