blob: e5338fb5456602d13c0be7db38419f343b384ee0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
Callbacks in squirrel
======================
Callbacks within squirrel trigger functions when certain events occur and are defined serverside.
They will also often pass arguments to those functions based on the callbacks used
A few examples
-----------
```AddCallback_OnPlayerRespawned(OnRespawn)```
This script will trigger the function "OnRespawn" when any player respawns, this function can be defined later in the mods file and this callback will pass one argument, the player entity that respawned
```AddCallback_OnPlayerKilled(AddPoints)```
This callback triggers the function "AddPoints" when a player is killed. this function passes 3 arguments: an entity (the attacking player), an entity (the killed player), and the damage informtion
```AddCallback_OnClientConnected(Connected)```
This callback triggers the function "Connected" whenever a player joins and passes 1 argument, the player entity.
List of callbacks
----------
This is an **incomplete** list of callbacks, a better list can be found in the list of all functions:
https://github.com/ScureX/Titanfall2-ModdingDocumentation/blob/main/AllMethodsClean.md
AddCallback_EntitiesDidLoad()
AddCallback_GameStateEnter(gamestate, function to trigger)
AddCallback_KillReplayEnded()
AddCallback_KillReplayStarted()
AddCallback_LocalClientPlayerSpawned()
AddCallback_LocalViewPlayerSpawned()
AddCallback_MinimapEntSpawned()
AddCallback_OnClientConnected()
AddCallback_OnClientScriptInit()
AddCallback_OnNPCKilled()
AddCallback_OnPetTitanChanged()
AddCallback_OnPetTitanModeChanged()
AddCallback_OnPilotBecomesTitan()
AddCallback_OnPlayerDisconnected()
AddCallback_OnPlayerGetsNewPilotLoadout()
AddCallback_OnPlayerKilled()
AddCallback_OnPlayerLifeStateChanged()
AddCallback_OnPlayerRespawned()
AddCallback_OnSatchelPlanted()
AddCallback_OnSelectedWeaponChanged()
AddCallback_OnTimeShiftAbilityUsed()
AddCallback_OnTimeShiftTitanAbilityUsed()
AddCallback_OnTitanBecomesPilot()
AddCallback_OnUseEntity()
AddCallback_PlayerClassChanged()
AddCallback_ScriptTriggerEnter()
AddCallback_ScriptTriggerLeave()
AddCallback_UseEntGainFocus()
AddCallback_UseEntLoseFocus()
|