Skip to content

Callbacks

Callbacks from Respawn native code

Callbacks within squirrel trigger functions when certain events occur.

They will also often pass arguments to those functions based on the callbacks used.

Please refer to Custom Northstar Callbacks for callbacks defined in Northstar.

_codecallbacks_common.gnut:

void AddDamageCallback( string className, void functionref( entity, var ) callbackFunc )

void RemoveDamageCallback( string className, void functionref( entity, var ) callbackFunc )

void RunClassDamageCallbacks( entity ent, var damageInfo )

void AddDamageFinalCallback( string className, void functionref( entity, var ) callbackFunc )

void RunClassDamageFinalCallbacks( entity ent, var damageInfo )

void AddPostDamageCallback( string className, void functionref( entity, var ) callbackFunc )

void RunClassPostDamageCallbacks( entity ent, var damageInfo )

void AddDamageByCallback( string className, void functionref( entity, var ) callbackFunc )

void AddDamageCallbackSourceID( int id, void functionref(entity, var) callbackFunc )

void AddDeathCallback( string className, void functionref( entity, var ) callbackFunc )

void RemoveDeathCallback( string className, void functionref( entity, var ) callbackFunc )

void AddSoulDeathCallback( void functionref( entity, var ) callbackFunc )

void AddCallback_OnTouchHealthKit( string className, bool functionref( entity player, entity healthpack ) callbackFunc )

void AddCallback_OnPlayerRespawned( void functionref( entity ) callbackFunc )

void AddCallback_OnPlayerKilled( void functionref( entity victim, entity attacker, var damageInfo ) callbackFunc )

void AddCallback_OnNPCKilled( void functionref( entity victim, entity attacker, var damageInfo ) callbackFunc )

void AddCallback_OnTitanDoomed( void functionref( entity victim, var damageInfo ) callbackFunc )

void AddCallback_OnTitanHealthSegmentLost( void functionref( entity victim, entity attacker ) callbackFunc )

void AddCallback_OnClientConnecting( void functionref( entity player ) callbackFunc )

void AddCallback_OnClientConnected( void functionref( entity player ) callbackFunc )

void AddCallback_OnClientDisconnected( void functionref( entity player ) callbackFunc )

void AddCallback_OnPilotBecomesTitan( void functionref( entity pilot, entity npc_titan ) callbackFunc )

void AddCallback_OnTitanBecomesPilot( void functionref( entity pilot, entity npc_titan ) callbackFunc )

void AddCallback_OnPlayerAssist( void functionref( entity attacker, entity victim ) callbackFunc )

void AddCallback_EntityChangedTeam( string className, void functionref( entity ent ) callbackFunc )

void AddCallback_OnTitanGetsNewTitanLoadout( void functionref( entity titan, TitanLoadoutDef newTitanLoadout ) callbackFunc )

void AddCallback_OnPlayerGetsNewPilotLoadout( void functionref( entity player, PilotLoadoutDef newTitanLoadout ) callbackFunc )

void AddCallback_OnUpdateDerivedTitanLoadout( void functionref( TitanLoadoutDef newTitanLoadout ) callbackFunc )

void AddCallback_OnUpdateDerivedPlayerTitanLoadout( void functionref( entity player, TitanLoadoutDef newTitanLoadout ) callbackFunc )

void AddCallback_OnUpdateDerivedPilotLoadout( void functionref( PilotLoadoutDef newPilotLoadout ) callbackFunc )

void AddClientCommandCallback( string commandString, bool functionref( entity player, array args ) callbackFunc )

void AddPlayerDropScriptedItemsCallback( void functionref(entity player) callbackFunc )

void RegisterForDamageDeathCallbacks( entity ent )

void AddTitanCallback_OnHealthSegmentLost( entity ent, void functionref( entity titan, entity victim ) callbackFunc )

void RemoveTitanCallback_OnHealthSegmentLost( entity ent, void functionref( entity titan, entity victim ) callbackFunc )

void AddEntityCallback_OnDamaged( entity ent, void functionref( entity ent, var damageInfo ) callbackFunc )

void RemoveEntityCallback_OnDamaged( entity ent, void functionref( entity ent, var damageInfo ) callbackFunc )

void AddEntityCallback_OnPostDamaged( entity ent, void functionref( entity ent, var damageInfo ) callbackFunc )

void RemoveEntityCallback_OnPostDamaged( entity ent, void functionref( entity ent, var damageInfo ) callbackFunc )

void AddEntityCallback_OnKilled( entity ent, void functionref( entity, var ) callbackFunc )

void RemoveEntityCallback_OnKilled( entity ent, void functionref( entity, var ) callbackFunc )

void AddEntityCallback_OnPostShieldDamage( entity ent, void functionref( entity, var, float ) callbackFunc )

void RemoveEntityCallback_OnPostShieldDamage( entity ent, void functionref( entity, var, float ) callbackFunc )

void AddPlayerMovementEventCallback( entity player, int playerMovementEvent, void functionref( entity player ) callbackFunc )

void RemovePlayerMovementEventCallback( entity player, int playerMovementEvent, void functionref( entity player ) callbackFunc )

void AddCallback_OnPlayerInventoryChanged( void functionref( entity ) callbackFunc )

_codecallbacks_player_input.gnut:

void AddPlayerInputEventCallback_Internal( entity player, PlayerInputEventCallbackStruct inputCallbackStruct ) //Not really meant to be used directly unless you know what you're doing! Use utility functions like AddButtonPressedPlayerInputCallback instead

void RemovePlayerInputEventCallback_Internal( entity player, PlayerInputEventCallbackStruct inputCallbackStruct ) //Not really meant to be used directly unless you know what you're doing! Use utility functions like RemoveButtonPressedPlayerInputCallback instead

bool InputEventCallbackAlreadyExists( entity player, PlayerInputEventCallbackStruct inputCallbackStruct )

void AddPlayerHeldButtonEventCallback( entity player, int buttonEnum, void functionref( entity player ) callbackFunc, float buttonHeldTime = 1.0 )

void RemovePlayerHeldButtonEventCallback( entity player, int buttonEnum, void functionref( entity player ) callbackFunc, float buttonHeldTime = 1.0 )

bool HeldEventCallbackAlreadyExists( entity player, PlayerHeldButtonEventCallbackStruct callbackStruct )

void AddButtonPressedPlayerInputCallback( entity player, int buttonEnum, void functionref( entity player ) callbackFunc )

void RemoveButtonPressedPlayerInputCallback( entity player, int buttonEnum, void functionref( entity player ) callbackFunc )

void AddButtonReleasedPlayerInputCallback( entity player, int buttonEnum, void functionref( entity player ) callbackFunc )

void RemoveButtonReleasedPlayerInputCallback( entity player, int buttonEnum, void functionref( entity player ) callbackFunc )

void RunHeldCallbackAfterTimePasses( entity player, PlayerHeldButtonEventCallbackStruct callbackStruct )

string GetEndSignalNameForHeldButtonCallback( PlayerHeldButtonEventCallbackStruct callbackStruct )

bool InputCallbackStructsAreTheSame( PlayerInputEventCallbackStruct callbackStruct1, PlayerInputEventCallbackStruct callbackStruct2 ) //Really just a comparison function because == does a compare by reference, not a compare by value

bool PlayerInputsMatchCallbackInputs( int cmdsHeld, int cmdsPressed, int cmdsReleased, PlayerInputEventCallbackStruct callbackStruct )

bool HeldButtonCallbackStructsAreTheSame( PlayerHeldButtonEventCallbackStruct struct1, PlayerHeldButtonEventCallbackStruct struct2 ) //Really just a comparison function because == does a compare by reference, not a compare by value

void TurnOffInputCallbacksIfNecessary( entity player )

PlayerInputAxisEventCallbackStruct MakePressedForwardCallbackStruct()

void AddPlayerPressedForwardCallback( entity player, bool functionref( entity player ) callbackFunc, float debounceTime = 2.0 )

void RemovePlayerPressedForwardCallback( entity player, bool functionref( entity player ) callbackFunc, float debounceTime = 2.0 )

PlayerInputAxisEventCallbackStruct MakePressedBackCallbackStruct()

void AddPlayerPressedBackCallback( entity player, bool functionref( entity player ) callbackFunc, float debounceTime = 2.0 )

void RemovePlayerPressedBackCallback( entity player, bool functionref( entity player ) callbackFunc, float debounceTime = 2.0 )

PlayerInputAxisEventCallbackStruct MakePressedLeftCallbackStruct()

void AddPlayerPressedLeftCallback( entity player, bool functionref( entity player ) callbackFunc, float debounceTime = 2.0 )

void RemovePlayerPressedLeftCallback( entity player, bool functionref( entity player ) callbackFunc, float debounceTime = 2.0 )

PlayerInputAxisEventCallbackStruct MakePressedRightCallbackStruct()

void AddPlayerPressedRightCallback( entity player, bool functionref( entity player ) callbackFunc, float debounceTime = 2.0 )

void RemovePlayerPressedRightCallback( entity player, bool functionref( entity player ) callbackFunc, float debounceTime = 2.0 )

void AddPlayerInputAxisEventCallback_Internal( entity player, PlayerInputAxisEventCallbackStruct callbackStruct )

void RemovePlayerInputAxisEventCallback_Internal( entity player, PlayerInputAxisEventCallbackStruct callbackStruct )

bool InputAxisEventCallbackAlreadyExists( entity player, PlayerInputAxisEventCallbackStruct callbackStruct )

bool InputAxisCallbackStructsAreTheSame( PlayerInputAxisEventCallbackStruct callbackStruct1, PlayerInputAxisEventCallbackStruct callbackStruct2 ) //Really just a comparison function because == does a compare by reference, not a compare by value

bool ShouldRunPlayerInputAxisCallbackFunc( float horizAxis, float vertAxis, PlayerInputAxisEventCallbackStruct callbackStruct )

bool IsValidPlayerInputAxisEventCallbackStruct( PlayerInputAxisEventCallbackStruct callbackStruct )

void RunPlayerInputAxisCallbackFunc( entity player, PlayerInputAxisEventCallbackStruct callbackStruct )

void RunInputAxisCallbackAfterTimePasses( entity player, PlayerInputAxisEventCallbackStruct callbackStruct )

_global_entities.gnut:

function( callback )

_items.nut:

void StatsCallback_ItemUnlockUpdate( entity player, float changeInValue, string itemRef )

void StatsCallback_SubItemUnlockUpdate( entity player, float changeInValue, string fullRef )

_on_spawned.gnut:

void AddSpawnCallback( string classname, void functionref( entity ) func )

void AddSpawnCallbackEditorClass( string classname, string editorClassname, void functionref( entity ) func )

function( entity self )

function( entity self )

void RunScriptNameCallbacks( entity ent )

void AddSpawnCallback_ScriptName( string scriptName, void functionref( entity ) func )

void RunScriptNoteworthyCallbacks( entity ent )

void AddScriptNoteworthySpawnCallback( string script_noteworthy, void functionref( entity ) func )

_passives.gnut:

void PassiveDeathCallback( entity player, var damageInfo )

_script_triggers.gnut:

void AddCallback_ScriptTriggerEnter( entity trigger, void functionref( entity, entity ) callbackFunc )

void AddCallback_ScriptTriggerLeave( entity trigger, void functionref( entity, entity ) callbackFunc )

_utility_shared.nut:

void AddCallback_OnUseEntity( entity ent, callbackFunc )

void RunCallbacks_EntitiesDidLoad()

void AddCallback_EntitiesDidLoad( EntitiesDidLoadCallbackType callback )

_utility.gnut:

void AddCallback_GameStateEnter( int gameState, void functionref() callbackFunc )

void GM_SetObserverFunc( void functionref( entity ) callbackFunc )

void GM_AddPlayingThinkFunc( void functionref() callbackFunc )

void GM_AddThirtySecondsLeftFunc( void functionref() callbackFunc )

void GM_SetMatchProgressAnnounceFunc( void functionref( int ) callbackFunc )

void AddCallback_NPCLeeched( void functionref( entity, entity ) callbackFunc )

sh_loadouts.nut:

void UpdateDerivedPilotLoadoutData( PilotLoadoutDef loadout, bool doOverrideCallback = true )

ai/_ai_marvin_faces.gnut:

void MarvinSpawnCallback( entity npc_marvin )

ai/_ai_mortar_titans.gnut:

void MortarMissileFiredCallback( entity missile, entity weaponOwner )

ai/_ai_nuke_titans.gnut:

void AutoTitan_NuclearPayload_PostDamageCallback( entity titan, var damageInfo )

ai/_ai_pilots.gnut:

function( pilot, titan )

function( pilot, titan )

function( callbackFunc )

function( callbackFunc )

ai/_ai_suicide_spectres.gnut:

void SpectreSuicideOnDamaged_Callback( entity spectre, var damageInfo )

earn_meter/sv_earn_meter.gnut:

void AddEarnMeterThresholdEarnedCallback( float thresholdForCallback, void functionref( entity player ) callbackFunc, bool triggerFunctionOnFullEarnMeter = false )

bool AlreadyContainsThresholdCallback( EarnMeterThresholdEarnedStruct thresholdStruct )

void SetCallback_EarnMeterGoalEarned( void functionref( entity player ) callback )

void SetCallback_EarnMeterRewardEarned( void functionref( entity player ) callback )

void DummyRewardEarnedCallback( entity player )

void DummyGoalEarnedCallback( entity player )

gamemodes/_frontline.gnut:

void AddCalculateFrontlineCallback( void functionref() callbackFunc )

mp/_base_gametype.gnut:

bool ScriptCallback_ShouldEntTakeDamage( entity ent, damageInfo )

function( ent, callbackFunc )

mp/_bleedout.gnut:

void Bleedout_SetCallback_OnPlayerStartBleedout( void functionref(entity) callback )

void Bleedout_SetCallback_OnPlayerGiveFirstAid( void functionref(entity) callback )

mp/_spawn_functions.nut:

void EmptyDeathCallback( entity _1, var _2 )

mp/_spectre_rack.nut:

void AddSpectreRackCallback( void functionref( entity, entity ) func )

mp/_titan_tether.gnut:

void AddOnTetherCallback( void functionref( entity, entity ) callback )

mp/_vr.nut:

void VR_GroundTroopsDeathCallback( entity guy, var damageInfo )

pilot/_leeching.gnut:

void TryLeechStartCallback( entity self, entity leecher )

void TryLeechAbortCallback( entity self, entity leecher )

pilot/_zipline.gnut:

void AddCallback_ZiplineStart( void functionref(entity,entity) callback )

void AddCallback_ZiplineStop( void functionref(entity) callback )

rodeo/_rodeo_titan.gnut:

void AddOnRodeoStartedCallback( void functionref(entity,entity) callbackFunc )

void AddOnRodeoEndedCallback( void functionref(entity,entity) callbackFunc )

void SetApplyBatteryCallback( void functionref(entity,entity,entity) func )

weapons/_arc_cannon.nut:

void ClientDestroyCallback_ArcCannon_Stop( entity ent )

weapons/_grenade.nut:

void ClientDestroyCallback_GrenadeDestroyed( entity grenade )

weapons/_weapon_utility.nut:

unknown ServerCallback_GuidedMissileDestroyed()

unknown ServerCallback_AirburstIconUpdate( toggle )