Hooks: Difference between revisions
Jump to navigation
Jump to search
Thyraxxvoid (talk | contribs) Created page with "Hooks are script functions that are called at specific moments. This way, you can insert code into the game. They are specified in script files and tagged with the <code>Hook</code> specifier. They also must be placed within a namespace to avoid ambiguity between multiple mods. The following is an example of such a file: namespace MyTestMod { [Hook] void BaseGameModeConstructor(BaseGameMode@ baseGameMode){ print("Hello World"); } } == PlayerDam..." |
Thyraxxvoid (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
Hooks are script functions that are called at specific moments. This way, you can insert code into the game. | Hooks are script functions that are called at specific moments. This way, you can insert code into the game a bit easier without the need for overwriting existing files. | ||
This is mostly the recommended way, there is almost no need to update your mod if the game gets updates and it keeps the highest compatibility cause it won't affect other mods. | |||
They are specified in script files and tagged with the <code>Hook</code> specifier. They also must be placed within a namespace to avoid ambiguity between multiple mods. | They are specified in script files and tagged with the <code>Hook</code> specifier. They also must be placed within a namespace to avoid ambiguity between multiple mods. | ||
Revision as of 17:13, 19 November 2025
Hooks are script functions that are called at specific moments. This way, you can insert code into the game a bit easier without the need for overwriting existing files. This is mostly the recommended way, there is almost no need to update your mod if the game gets updates and it keeps the highest compatibility cause it won't affect other mods.
They are specified in script files and tagged with the Hook specifier. They also must be placed within a namespace to avoid ambiguity between multiple mods.
The following is an example of such a file:
namespace MyTestMod
{
[Hook]
void BaseGameModeConstructor(BaseGameMode@ baseGameMode){
print("Hello World");
}
}