The Lua command set exposure is a little tricky when you get into multiple levels of command sets, like when you have the engine command set, and you want to expose something else beyond that, like the Framewerk commands.
The attached example shows how Lua command set generation works. To expose types, all you have to do is add an "expose" tag in the meta data. To expose procedural functions, you add the functions as a method in a type with the "noclass" setting. To generate your command set file, do this:
generateGlueCode("lua-gluefunctions.bmx")
End
To run your program with the command set, do this:
Include "lua-gluefunctions.bmx"
I just include all three lines together, and comment them out depending on what I am doing:
Include "lua-gluefunctions.bmx"
'generateGlueCode("lua-gluefunctions.bmx")
'End
'Include "lua-gluefunctions.bmx"
generateGlueCode("lua-gluefunctions.bmx")
End
Any time you make changes to any of your exposed class commands, you have to generate a new lua command set file. Otherwise your program might not even compile, because it will have function declarations that don't match the commands you changed.
Does this make sense? I could pull the Lua commands out of the engine and make this a requirement of any BlitzMax program that uses Lua. It's a little more complicated, but it allows you to change the commands I have exposed, add ones that may be missing, or expose your own types. For example, if you imported the framewerk module and generated the command set, you would have access to all the framewerk commands in Lua. This is how the editor and interpreter do it.
MyGame.zip