Jump to content

get current lua state in bMax


Recommended Posts

I can turn on Lua in bMax just like

local LuaState:byte ptr = luaL_newstate()


and then run my own scripts with this.


Leadwerks on start creating own Lua state, and attach all of own methods to it.


Do anyone knows, how can i get current Lua state in bMax?

"Better" is big enemy of "good"

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

oppsie, just been playing with it as it happens.



luastate.L is the Leadwerks Lua state


Thanks, it realy works.


Include "lua-gluefunctions.bmx"

Function run(fullpath$)
Print "Run script: "+fullpath
If luaL_dofile(luastate.L,fullpath)
 Notify "Error in script: "+fullpath+Chr(13)+lua_tostring( luastate.L, lua_gettop(luastate.L) )
End If
End Function
run "index.lua"

"Better" is big enemy of "good"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...