callback::add_callback()
Adds a function to a named callback event. BO3's decompiled scripts carry no docs for this one: the description is ours, from its name and use.
Signature
callback::add_callback(event, func, obj)
Needs #using the script that defines it (scripts/shared/callbacks_shared.gsc).
Parameters
| Name |
|---|
| event |
| func |
| obj |
The decompiled scripts don't keep default values, so some of these may be optional: check the real uses below.
Real uses in BO3's scripts
Called 39 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm.csc, line 208
callback::add_callback(#"hash_da8d7d74", &basic_player_connect); - scripts/zm/_zm_ai_wasp.gsc, line 549
ai callback::add_callback(#"hash_acb66515", level._wasp_death_cb); - scripts/zm/_zm_ai_wasp_no_idgun.gsc, line 548
ai callback::add_callback(#"hash_acb66515", level._wasp_death_cb); - scripts/zm/zm_genesis_wasp.gsc, line 634
ai callback::add_callback(#"hash_acb66515", level._wasp_death_cb); - scripts/shared/callbacks_shared.csc, line 219
add_callback(#"hash_da8d7d74", func, obj);
More in callback::
- callback::on_spawned()Runs a function on each player whenever they spawn.
- callback::on_connect()Runs a function on each player when they connect.
- callback::on_start_gametype()Runs a function when the game type starts.
- callback::callback()Fires a named callback event, running every function added to it.
- callback::on_localclient_connect()Client: runs a function when a local client connects.
- callback::on_ai_killed()Runs a function on an AI when it is killed.
- callback::on_disconnect()Runs a function on a player when they disconnect.
- callback::on_localplayer_spawned()Client: runs a function when the local player spawns.
- callback::remove_callback()Removes a function from a named callback event.
- callback::add_weapon_type()Adds weapon type.
- callback::remove_on_ai_killed()Removes on AI killed.
- callback::remove_on_spawned()Removes a function added with on_spawned.
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).