Hooks: Difference between revisions
Jump to navigation
Jump to search
Thyraxxvoid (talk | contribs) No edit summary |
No edit summary |
||
| Line 14: | Line 14: | ||
} | } | ||
== PlayerDamagedActor == | == PlayerDamagedActor == | ||
== PlayerKilledActor == | == PlayerKilledActor == | ||
Revision as of 13:32, 20 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");
}
}