DEFAULTSAAS Posted September 16, 2023 Share Posted September 16, 2023 Hello, I'm trying to use the hook on Map:Load() to call a Lua function every time an entity is loaded. However, the documentation describes the hook as a "pointer to a function that will be called for each loaded entity in the scene", but I do not know how to get a pointer for a Lua function, as it seems Lua doesn't have pointers. I do have the professional version of Leadwerks, and am familiar with C++, thus is there some interaction with C++ and Lua that I'm missing? Quote Link to comment Share on other sites More sharing options...
Solution Josh Posted September 16, 2023 Solution Share Posted September 16, 2023 Hi, A point to a Lua function is just the function name: function loadhook(progress) Print(progress) end LoadMap("Maps/test.map", "loadhook") In Ultra, the Lua binding system I am using provides more control, and the Lua function itself can be passed to functions. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
DEFAULTSAAS Posted September 16, 2023 Author Share Posted September 16, 2023 That works great, thanks! I look forward to the release of Ultra. Quote Link to comment Share on other sites More sharing options...
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.