A work-in-progress Hook for the games "The Settlers 6" and "The Settlers 6: History Edition". Will very likely never be truly finished ;)
Uses the "BigNum.lua" library. Special thanks to the authors!
Include the file "emxhooklib.bin" in your map folder and load it with "Script.Load()" in the global map script. Then call the function EMXHookLibrary.Initialize(_useLoadGameOverride, _maxMemorySizeToAllocate, _useGeneralGameBugfixes)
and after that, you can use the exported methods (listed below) however you like. All three function arguments are optional. The boolean return value suggests if the initialization was successful.
Hint: To reset the hooked values, use the function argument EMXHookLibrary.Initialize(true)
and have the function EMXHookLibrary_ResetValues(_source, _stringParam)
in your global map script, which will be automatically called when the map is closed. Put all your functions in there to reset your changed values.
Should you be interested in an example map script that uses the features of the HookLibrary extensively, look Here and Here.
Currently, the Hook supports the following general game bug fixes. These become active when the third argument to the Initialize function is true. In Multiplayer maps, set the first argument _useLoadGameOverride to nil.
- Fix Entertainercrash: When dismissing an entertainer, the game would crash.
- Fix GUI.SendScriptCommand: In the History Edition Multiplayer (without activated Development-Mode), the function was not executed.
For a list of features, take a look at either the German Features or the English Features file.
When errors occur, please notify me so they can be fixed! ;)