The proper documentation should be in the answers to 2 and 3. The hooks should all be properly documented as to what causes them to be called, what data they provide, and what results they expect to receive/acheive, and the script should be properly commented.XeryusTC wrote:Only an example script won't help, we would also need a bit of documentation/manual .
And, just in case there's a misunderstanding: By "hooks" I meant "things that cause the Lua code to be called", not "things that the Lua code can call". Maybe that's not the right word (callbacks? bindings?) but that's the one I used.
Clearly, there also has to be some way for the Lua scripts to query, and possibly set, the game state, and those should also be properly documented in #2.
This is basically a "Show me it can be done sanely" line of questioning. What game-state is required? How complex is the script? How often does it get called?