Cuberite Forum
Hook adding - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: Hook adding (/thread-1325.html)



Hook adding - daniel0916 - 01-23-2014

I made 2 new hooks but i can't call them from a plugin.
Edited Files:
Plugin.h
PluginLua.cpp
PluginLua.h
PluginManager.cpp
PluginManager.h
and i call this in ClientHandle.

When you can't help me without code. Say it. I can push it on github.


RE: Hook adding - xoft - 01-23-2014

Sure, push them on a separate branch, there's very little worse than discussing non-working code without the actual code.
Also post the actual problem - does Lua say any specific error, or the hooks are simply ignored, or what?

Note that you usually need to regenerate the Bindings after such changes - CMake doesn't do that at-all for windows and almost-at-all for *nix. Otherwise you won't have the hook constants (HOOK_) exported to Lua.


RE: Hook adding - daniel0916 - 01-23-2014

(01-23-2014, 04:21 AM)xoft Wrote: Note that you usually need to regenerate the Bindings after such changes - CMake doesn't do that at-all for windows and almost-at-all for *nix. Otherwise you won't have the hook constants (HOOK_) exported to Lua.

How can i regenerate them?

(01-23-2014, 04:21 AM)xoft Wrote: Sure, push them on a separate branch, there's very little worse than discussing non-working code without the actual code.
Also post the actual problem - does Lua say any specific error, or the hooks are simply ignored, or what?

I will push the code to my github when it's ready. Because i think it's working with regenerated Bindings.


RE: Hook adding - tigerw - 01-23-2014

Navigate to src/Bindings and execute the AllToLua.bat batch file there.