Load Compiled Lua Script?

Started by Cyndanera, December 24, 2017, 05:19:32

Previous topic - Next topic

Cyndanera

I get a error when I load a compile lua script. compiled with luac53, do I need to move to c++ to do this?

RonTek

Perhaps you could post your code and the LUA mod that you're trying to use? Are you using vanilla or NG?

Cyndanera

#2
Just using blitzmax NG.
bmx source code.

'for loading script source
LoadAppScript("image/demodata/scripts/config/application.lua")
'for loading script machine code
'LoadAppScript("image/demodata/scripts/config/application.lub")
Function LoadAppScript(filename:String)
Local LuaState:Byte Ptr = luaL_newstate()
luaL_openlibs(LuaState)
lua_register(LuaState, "setwindowtitle", SetWindowTitle_Lua)
luaL_dofile(LuaState,filename)
lua_close(LuaState)
End Function

Function SetWindowTitle_Lua:Int(LuaState:Byte Ptr)
Local title:String = luaL_checkstring(LuaState, 1)
AppTitle = title
Return 0
End Function


lua code

setwindowtitle("Game")

lua compiled script
https://drive.google.com/open?id=1ZVJl0t5ahWU03jqJozKpzIlakHzjJmpU

Does anyone know how to load compiled lua script???

RonTek

#3
I see. Are you using the official Pub.Lua mod?

I have not touched Lua that much with bmx, but have gathered some info.

As for the compiled stuff I'm not sure, but there's a reference thread here..

http://wasted.nz/posts.php?topic=88590