do you have this entire code in your bmax program?
Function SetScriptObject(name:String, o:Object)
Local size:Int=GetStackSize()
lua_pushbmaxobject(luastate.L,o)
lua_setglobal(luastate.L,name)
SetStackSize(size)
EndFunction
Function GetStackSize:Int()
Return lua_gettop(luastate.L)
EndFunction
Function SetStackSize(size:Int)
Local currentsize:Int=GetStackSize()
If size<currentsize
lua_pop(luastate.L,currentsize-size)
EndIf
EndFunction
are you setting the ScriptObject?
Global fw:TFramework = TFramework.Create()
If Not fw RuntimeError "Failed to initialize engine."
SetScriptObject("fw", fw)