lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

I'm just now learning Lua in order to use it as an embedded Language for a game project.

Using C# and trying LuaInterface 2.02 and 1.53, I can pass C# classes between the two and get most everything
to work correctly... except with the return values of Lua functions called from C#.

If a call a Lua function from C#, I can get the result by setting a global variable in the Lua VM.
But the LuaInterface DoString method -- which is supposed to return an object array -- only does
so if I pass a simple chunk -- such as DoString("return 5,x");

 Any use such as:

 in Lua --

 function SomeFunc()
     return 5
 end

 in C#

 DoString("SomeFunc()");

 will execute the function -- but always returns null.

 This behavior happens in all the examples I've downloaded as well...

 If anyone has any ideas what might be causing this strange behavior, I'd be
 extremely appreciative.

 Other than that, Lua looks like a great way to handle scripting in .Net.

 Thanks,
 Scott Southworth