1

I'm new to using LuaJava in Java, and currently I only know how to call functions and push objects to Lua using Java.

luaState.getGlobal(function);
luaState.pushJavaObject(obj);
luaState.call(1, 1);

Now I was wondering how I can return a Lua array

array = {1,2,3}

Because as far as I know, only toString(), toBoolean(), toInteger() and toJavaObject() exist, but nothing for an array of any sort.

Also, how is it possible to get normal variables declared in Lua?

Any help would be greatly appreciated.

EDIT: I've come as far as getting back a Lua Table, but I don't want to use a Lua Table but I want to use an array. I don't want to label everything because I will always have a different amount of values in the array.

RayShawnOfNapalm
  • 210
  • 6
  • 20

0 Answers0