Rick Posted February 5, 2010 Posted February 5, 2010 If we have the lua state in C++, then I would expect that I could then expose a C++ method to use in lua using: static int KattSendMessage(lua_State* L) { char* _msg = (char*)lua_tostring(L, 1); char* _extra = (char*)lua_tostring(L, 2); return 1; } BP L = GetLuaState(); lua_register((lua_State*)L, "KattSendMessage", KattSendMessage); But that doesn't seem to work. My function never seems to get called and I also notice that when I save a script in the script editor that comes with the editor it always complains about KattSendMessage() being a nil value. I can do this with normal lua and it works. What would be different? Quote
Recommended Posts
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.