Hooks

From Heroes of Hammerwatch Wiki
Revision as of 17:10, 19 November 2025 by 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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 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");
   }
}

PlayerDamageActor

PlayerDamageActorNoWeapon

PlayerDamagedActor

PlayerKilledActor

PlayerDamage

PlayerDamageTaken

PlayerInitialize

PlayerRefreshScene

PlayerDamageActor

PlayerDamageActorNoWeapon

PlayerRecordConstructor

PickedCharacter

CreateCharacter

PlayerRecordSave

PlayerRecordLoad

PlayerRecordRefreshModifiers

LevelupCharacter

GameModeStart

GameModePostStart

GameModePreRenderFrame

GameModeRenderFrame

GameModeSpawnPlayer

GameModeSpawnPlayerCorpse

BaseGameModeConstructor

GameModeUpdatePaused

GameModeUpdate

LoadWidgetProducers

HUDConstructor

TownRecordConstructor

TownRecordSave

TownRecordLoad

TownRecordSpawnTown

TownRecordRefreshHeroTitles

TownRecordRefreshDonationTitles