‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
util_shared.csc File Reference

Go to the source code of this file.

Macros

#define MAX_CLIENT_OBJECTIVE_IDS   32
 

Functions

function _delay (time_or_notify, str_endon, func, arg1, arg2, arg3, arg4, arg5, arg6)
 
function _delay_notify (time_or_notify, str_notify, str_endon)
 
function _timeout (delay)
 
function _waitlogic (s_tracker, notifies)
 
function add_listen_thread (wait_till, func, param1, param2, param3, param4, param5)
 
function add_listen_thread_internal (wait_till, func, param1, param2, param3, param4, param5)
 
function add_trigger_to_ent (ent, trig)
 
function array_ent_thread (entities, func, arg1, arg2, arg3, arg4, arg5)
 
function call_func (s_func)
 
function debug_line (from, to, color, time)
 
function debug_star (origin, color, time)
 
function delay (time_or_notify, str_endon, func, arg1, arg2, arg3, arg4, arg5, arg6)
 
function delay_notify (time_or_notify, str_notify, str_endon)
 
function empty (a, b, c, d, e)
 
function ent_already_in_trigger (trig)
 
function error (message)
 
function field_set_lighting_ent (localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
 
function field_use_lighting_ent (localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
 
function friend_not_foe (localClientIndex, predicted)
 
function friend_not_foe_team (localClientIndex, team, predicted)
 
function get_dvar_float_default (str_dvar, default_val)
 
function get_dvar_int_default (str_dvar, default_val)
 
function get_eye ()
 
function get_next_safehouse (str_next_map)
 
function get_time ()
 
function get_time_frac (n_end_time)
 
function get_time_in_seconds ()
 
function get_time_left ()
 
function getNextObjID (localClientNum)
 
function getStatsTableName ()
 
 if (on_off)
 
function init_utility ()
 
function is_gib_restricted_build ()
 
function is_mature ()
 
function is_player_view_linked_to_entity (localClientNum)
 
function is_safehouse (str_next_map)
 
function is_time_left ()
 
function is_valid_type_for_callback (type)
 
function IsEnemyPlayer (player)
 
function lerp_dvar (str_dvar, n_start_val, n_end_val, n_lerp_time, b_saved_dvar, b_client_dvar, n_client=0)
 
function local_player_entity_thread (localClientNum, entity, func, arg1, arg2, arg3, arg4)
 
function local_player_trigger_thread_always_exit (ent, on_enter_payload, on_exit_payload)
 
function local_players_entity_thread (entity, func, arg1, arg2, arg3, arg4)
 
function new_func (func, arg1, arg2, arg3, arg4, arg5, arg6)
 
function new_timer (n_timer_length)
 
function register_system (sSysName, cbFunc)
 
function registerSystem (sSysName, cbFunc)
 
function releaseObjID (localClientNum, objID)
 
function remove_trigger_from_ent (ent, trig)
 
function server_wait (localClientNum, seconds, waitBetweenChecks, level_endon)
 
function serverTime ()
 
function single_func (entity, func, arg1, arg2, arg3, arg4, arg5, arg6)
 
function single_thread (entity, func, arg1, arg2, arg3, arg4, arg5, arg6)
 
function spawn_model (n_client, str_model, origin=(0, 0, 0), angles=(0, 0, 0))
 
function spawn_player_arms ()
 
function timeout (n_time, func, arg1, arg2, arg3, arg4, arg5, arg6)
 
function timer_wait (n_wait)
 
function trigger_thread (ent, on_enter_payload, on_exit_payload)
 
function wait_till_not_touching (e_to_check, e_to_touch)
 
function waitforallclients ()
 
function waitforclient (client)
 
function waittill_any (str_notify1, str_notify2, str_notify3, str_notify4, str_notify5)
 
function waittill_any_array (a_notifies)
 
function waittill_any_array_return (a_notifies)
 
function waittill_any_ents (ent1, string1, ent2, string2, ent3, string3, ent4, string4, ent5, string5, ent6, string6, ent7, string7)
 
function waittill_any_ents_two (ent1, string1, ent2, string2)
 
function waittill_any_ex (...)
 
function waittill_any_return (string1, string2, string3, string4, string5, string6, string7)
 
function waittill_any_timeout (n_timeout, string1, string2, string3, string4, string5)
 
function waittill_dobj (localClientNum)
 
function waittill_multiple (...)
 
function waittill_multiple_ents (...)
 
function waittill_notify_or_timeout (msg, timer)
 
function waittill_string (msg, ent)
 
 while (!done &&array.size > 0)
 
function within_fov (start_origin, start_angles, end_origin, fov)
 

Variables

function add_remove_list a
 
function clean_deleted array
 
 else
 

Macro Definition Documentation

◆ MAX_CLIENT_OBJECTIVE_IDS

#define MAX_CLIENT_OBJECTIVE_IDS   32

Definition at line 7 of file util_shared.csc.

Function Documentation

◆ _delay()

function _delay ( time_or_notify  ,
str_endon  ,
func  ,
arg1  ,
arg2  ,
arg3  ,
arg4  ,
arg5  ,
arg6   
)

Definition at line 789 of file util_shared.csc.

References single_func().

Referenced by delay().

◆ _delay_notify()

function _delay_notify ( time_or_notify  ,
str_notify  ,
str_endon   
)

Definition at line 827 of file util_shared.csc.

Referenced by delay_notify().

◆ _timeout()

function _timeout ( delay  )

Definition at line 456 of file util_shared.csc.

References delay().

Referenced by waittill_any_ex(), and waittill_any_timeout().

◆ _waitlogic()

function _waitlogic ( s_tracker  ,
notifies   
)

Definition at line 182 of file util_shared.csc.

References ARRAY_ADD, and waittill_any_array().

Referenced by waittill_multiple(), and waittill_multiple_ents().

◆ add_listen_thread()

function add_listen_thread ( wait_till  ,
func  ,
param1  ,
param2  ,
param3  ,
param4  ,
param5   
)

Definition at line 733 of file util_shared.csc.

References add_listen_thread_internal(), and wait_till().

◆ add_listen_thread_internal()

function add_listen_thread_internal ( wait_till  ,
func  ,
param1  ,
param2  ,
param3  ,
param4  ,
param5   
)

Definition at line 738 of file util_shared.csc.

References single_thread(), and wait_till().

Referenced by add_listen_thread().

◆ add_trigger_to_ent()

function add_trigger_to_ent ( ent  ,
trig   
)

Definition at line 1369 of file util_shared.csc.

Referenced by local_player_trigger_thread_always_exit(), and trigger_thread().

◆ array_ent_thread()

function array_ent_thread ( entities  ,
func  ,
arg1  ,
arg2  ,
arg3  ,
arg4  ,
arg5   
)

Description:
"Function Name: array_ent_thread( <entities>, <func>, [arg1], [arg2], [arg3], [arg4], [arg5] )"
"Summary: Threads the <func> function on self for every entity in the <entities> array, passing the entity has the first argument." "Module: Array" "CallOn: NA"
"Mandatory Argument(s): entities : array of entities to thread the process"
"Mandatory Argument(s): func : pointer to a script function"
"Optional Argument(s): arg1 : parameter 1 to pass to the func (after the entity)"
"Optional Argument(s): arg2 : parameter 2 to pass to the func (after the entity)"
"Optional Argument(s): arg3 : parameter 3 to pass to the func (after the entity)"
"Optional Argument(s): arg4 : parameter 4 to pass to the func (after the entity)"
"Optional Argument(s): arg5 : parameter 5 to pass to the func (after the entity)"
"Example:array_ent_thread( GetAITeamArray("allies"),&do_something, false );"
"Single Player / Multi Player: both"

Definition at line 660 of file util_shared.csc.

References single_thread().

◆ call_func()

function call_func ( s_func  )

Description:
"Function Name: call_func( <func_struct> )"
"Summary: Runs the func and args stored on a struct created with new_func." "Module: Utility" "CallOn: NA"
"Mandatory Argument(s): func_struct> : struct return by new_func"
"Example:self call_func( s_callback );"
"Single Player / Multi Player: both"

Definition at line 639 of file util_shared.csc.

References single_func().

◆ debug_line()

function debug_line ( from  ,
to  ,
color  ,
time   
)

Definition at line 1502 of file util_shared.csc.

◆ debug_star()

function debug_star ( origin  ,
color  ,
time   
)

Definition at line 1519 of file util_shared.csc.

◆ delay()

function delay ( time_or_notify  ,
str_endon  ,
func  ,
arg1  ,
arg2  ,
arg3  ,
arg4  ,
arg5  ,
arg6   
)

Description:
"Function Name: delay(<time_or_notify>, [str_endon], <function>, [arg1], [arg2], [arg3], [arg4], [arg5])"
"Summary: Delay the execution of a thread."
"Mandatory Argument(s): <time_or_notify> : Time to wait( in seconds ) or notify to wait for before sending the notify."
"Optional Argument(s): [str_endon] : endon to cancel the function call"
"Mandatory Argument(s): <function> : The function to run."
"Optional Argument(s): [arg1] : parameter 1 to pass to the process"
"Optional Argument(s): [arg2] : parameter 2 to pass to the process"
"Optional Argument(s): [arg3] : parameter 3 to pass to the process"
"Optional Argument(s): [arg4] : parameter 4 to pass to the process"
"Optional Argument(s): [arg5] : parameter 5 to pass to the process"
"Example:delay( &flag::set, "player_can_rappel", 3 );"

Definition at line 784 of file util_shared.csc.

References _delay().

Referenced by _timeout(), ai_sets_goal_with_delay(), animate_crack(), announce_round_winner(), announceGameWinner(), announceRoundWinner(), arm_test(), auto_revive(), awardLootXPToPlayers(), bomblet_camera_waiter(), cf_cracks_off(), cf_cracks_on(), clear_ride_intro(), clock_timer(), death_make_badplace(), delay_set_gravity(), delayed_fx_thread(), detonateWhenStationary(), disable_end_game_intermission(), do_zombie_explode(), dog_health_regen_think(), door_activate(), exploder_damage(), getShaderConstantValue(), give_perk_presentation(), gunfireloopfxVecthread(), head_gib_damage_over_time(), hud_update(), Laststand_Bleedout(), lightninggun_arc(), lightninggun_find_arc_targets(), notify_player(), on_spawn(), onSpawnPlayer(), paths(), Pin_first_three_spikes_to_ground(), play_going_down_vo(), power_electric_switch(), proximityGrenadeChain(), razTorpedoDetonate(), razTorpedoMoveToTarget(), removeSpawnMessageShortly(), resetFlashStartAndEndAfterDelay(), revive_success(), round_pause(), screen_message_delete(), sndPA_DoVox(), specific_powerup_drop(), startLineEmitters(), startRattles(), startSoundLoops(), teleport_core_think(), toggle_fx_bundle(), treasure_chest_move(), waitAndDetonate(), waitAndFizzleOut(), and zombie_ragdoll_then_explode().

◆ delay_notify()

function delay_notify ( time_or_notify  ,
str_notify  ,
str_endon   
)

Description:
"Function Name: delay_notify( <n_delay>, <str_notify>, [str_endon] )"
"Summary: Notifies self the string after waiting the specified delay time" "Module: Entity" "CallOn: An entity"
"Mandatory Argument(s): <time_or_notify> : Time to wait( in seconds ) or notify to wait for before sending the notify."
"Mandatory Argument(s): <str_notify> : The string to notify"
"Optional Argument(s): <str_endon> : Endon to cancel the notify"
"Example:vehicle delay_notify( 3.5, "start_to_smoke" );"
"Single Player / Multi Player: singleplayer"

Definition at line 822 of file util_shared.csc.

References _delay_notify().

Referenced by check_for_sacrifice().

◆ empty()

function empty ( a  ,
,
,
,
 
)

Description:
"Function Name: empty( <a>, <b>, <c>, <d>, <e> )"
"Summary: Empty function mainly used as a place holder or default function pointer in a system." "Module: Utility" "CallOn: "
"Optional Argument(s): <a> : option arg"
"Optional Argument(s): <b> : option arg"
"Optional Argument(s): <c> : option arg"
"Optional Argument(s): <d> : option arg"
"Optional Argument(s): <e> : option arg"
"Example:default_callback = &empty;"
"Single Player / Multi Player: both"

Definition at line 32 of file util_shared.csc.

Referenced by go_to_node().

◆ ent_already_in_trigger()

function ent_already_in_trigger ( trig  )

Definition at line 1390 of file util_shared.csc.

Referenced by local_player_trigger_thread_always_exit(), and trigger_thread().

◆ error()

function error ( message  )

Definition at line 1067 of file util_shared.csc.

Referenced by register_system(), and registerSystem().

◆ field_set_lighting_ent()

function field_set_lighting_ent ( localClientNum  ,
oldVal  ,
newVal  ,
bNewEnt  ,
bInitialSnap  ,
fieldName  ,
bWasTimeJump   
)

Definition at line 1099 of file util_shared.csc.

Referenced by __init__().

◆ field_use_lighting_ent()

function field_use_lighting_ent ( localClientNum  ,
oldVal  ,
newVal  ,
bNewEnt  ,
bInitialSnap  ,
fieldName  ,
bWasTimeJump   
)

Definition at line 1104 of file util_shared.csc.

Referenced by __init__().

◆ friend_not_foe()

◆ friend_not_foe_team()

function friend_not_foe_team ( localClientIndex  ,
team  ,
predicted   
)

Definition at line 1198 of file util_shared.csc.

References IS_TRUE.

Referenced by get_fx_state().

◆ get_dvar_float_default()

function get_dvar_float_default ( str_dvar  ,
default_val   
)

Definition at line 69 of file util_shared.csc.

◆ get_dvar_int_default()

function get_dvar_int_default ( str_dvar  ,
default_val   
)

Definition at line 75 of file util_shared.csc.

◆ get_eye()

function get_eye ( )

Description:
"Function Name: get_eye()"
"Summary: Get eye position accurately even on a player when linked to an entity." "Module: Utility" "CallOn: Player or AI"
"Example:eye_pos = player get_eye();"
"Single Player / Multi Player: both"

Definition at line 948 of file util_shared.csc.

Referenced by gameobject_is_player_looking_at(), get_dot_direction(), is_player_looking_at(), turret_can_be_hacked(), and weapon_spawn_think().

◆ get_next_safehouse()

function get_next_safehouse ( str_next_map  )

Definition at line 1593 of file util_shared.csc.

◆ get_time()

function get_time ( )

Definition at line 858 of file util_shared.csc.

Referenced by get_time_in_seconds().

◆ get_time_frac()

function get_time_frac ( n_end_time  )

Definition at line 869 of file util_shared.csc.

References DEFAULT, and get_time_in_seconds().

◆ get_time_in_seconds()

function get_time_in_seconds ( )

Definition at line 864 of file util_shared.csc.

References get_time().

Referenced by get_time_frac(), get_time_left(), and timer_wait().

◆ get_time_left()

function get_time_left ( )

Definition at line 875 of file util_shared.csc.

References get_time_in_seconds().

Referenced by is_time_left(), and timer_wait().

◆ getNextObjID()

function getNextObjID ( localClientNum  )

Definition at line 1549 of file util_shared.csc.

References MAX_CLIENT_OBJECTIVE_IDS.

Referenced by bomblets_deployed(), and missile_fired().

◆ getStatsTableName()

function getStatsTableName ( )

◆ if()

◆ init_utility()

function init_utility ( )

Definition at line 1259 of file util_shared.csc.

Referenced by CodeCallback_MapRestart(), init(), and main().

◆ is_gib_restricted_build()

◆ is_mature()

◆ is_player_view_linked_to_entity()

function is_player_view_linked_to_entity ( localClientNum  )

◆ is_safehouse()

function is_safehouse ( str_next_map  )

Definition at line 1615 of file util_shared.csc.

References DEFAULT.

◆ is_time_left()

function is_time_left ( )

Definition at line 886 of file util_shared.csc.

References get_time_left().

◆ is_valid_type_for_callback()

function is_valid_type_for_callback ( type  )

Definition at line 1017 of file util_shared.csc.

◆ IsEnemyPlayer()

◆ lerp_dvar()

function lerp_dvar ( str_dvar  ,
n_start_val  ,
n_end_val  ,
n_lerp_time  ,
b_saved_dvar  ,
b_client_dvar  ,
n_client  = 0 
)

Definition at line 988 of file util_shared.csc.

References DEFAULT, IS_TRUE, new_timer(), and timer_wait().

◆ local_player_entity_thread()

function local_player_entity_thread ( localClientNum  ,
entity  ,
func  ,
arg1  ,
arg2  ,
arg3  ,
arg4   
)

Definition at line 1469 of file util_shared.csc.

References single_thread(), and waittill_dobj().

Referenced by local_players_entity_thread().

◆ local_player_trigger_thread_always_exit()

function local_player_trigger_thread_always_exit ( ent  ,
on_enter_payload  ,
on_exit_payload   
)

◆ local_players_entity_thread()

function local_players_entity_thread ( entity  ,
func  ,
arg1  ,
arg2  ,
arg3  ,
arg4   
)

Description:
"Function Name: local_players_entity_thread( <entity> , <func> , <arg1> , <arg2> , <arg3>, <arg4> )"
"Summary: Threads the < func > function on entity on all local players when the dobj becomes valid. The entity will become "self" in the specified function." "Module: Array" "CallOn: "
"Mandatory Argument(s): <entity> : entity to thread the process"
"Mandatory Argument(s): <func> : pointer to a script function. Function must have the first parameter of localCientNum"
"Optional Argument(s): <arg1> : parameter 1 to pass to the func"
"Optional Argument(s): <arg2> : parameter 2 to pass to the func"
"Optional Argument(s): <arg3> : parameter 3 to pass to the func"
"Optional Argument(s): <arg4> : parameter 4 to pass to the func"
"Example:local_players_entity_thread( chopper,&spawn_fx );"
"Single Player / Multi Player: mp"

Definition at line 1493 of file util_shared.csc.

References local_player_entity_thread().

Referenced by spawned().

◆ new_func()

function new_func ( func  ,
arg1  ,
arg2  ,
arg3  ,
arg4  ,
arg5  ,
arg6   
)

Description:
"Function Name: new_func( <func>, [arg1], [arg2], [arg3], [arg4], [arg5], [arg6] )"
"Summary: Creates a new func with the args stored on a struct that can be called with call_func." "Module: Utility" "CallOn: NA"
"Mandatory Argument(s): func> : pointer to a script function"
"Optional Argument(s): arg1 : parameter 1 to pass to the func"
"Optional Argument(s): arg2 : parameter 2 to pass to the func"
"Optional Argument(s): arg3 : parameter 3 to pass to the func"
"Optional Argument(s): arg4 : parameter 4 to pass to the func"
"Optional Argument(s): arg5 : parameter 5 to pass to the func"
"Optional Argument(s): arg6 : parameter 6 to pass to the func"
"Example:s_callback = new_func(&set_ignoreme, false );"
"Single Player / Multi Player: both"

Definition at line 616 of file util_shared.csc.

◆ new_timer()

function new_timer ( n_timer_length  )

Definition at line 850 of file util_shared.csc.

Referenced by lerp_dvar().

◆ register_system()

function register_system ( sSysName  ,
cbFunc   
)

Definition at line 1074 of file util_shared.csc.

References error().

Referenced by __init__(), init(), and main().

◆ registerSystem()

function registerSystem ( sSysName  ,
cbFunc   
)

Definition at line 1318 of file util_shared.csc.

References error().

Referenced by main().

◆ releaseObjID()

function releaseObjID ( localClientNum  ,
objID   
)

Definition at line 1582 of file util_shared.csc.

Referenced by destruction_watcher(), and missile_fired().

◆ remove_trigger_from_ent()

function remove_trigger_from_ent ( ent  ,
trig   
)

Definition at line 1379 of file util_shared.csc.

Referenced by local_player_trigger_thread_always_exit(), and trigger_thread().

◆ server_wait()

function server_wait ( localClientNum  ,
seconds  ,
waitBetweenChecks  ,
level_endon   
)

◆ serverTime()

function serverTime ( )

◆ single_func()

function single_func ( entity  ,
func  ,
arg1  ,
arg2  ,
arg3  ,
arg4  ,
arg5  ,
arg6   
)

Description:
"Function Name: single_func( <entity>, <func>, [arg1], [arg2], [arg3], [arg4], [arg5], [arg6] )"
"Summary: Runs the < func > function on the entity. The entity will become "self" in the specified function." "Module: Utility" "CallOn: NA"
"Mandatory Argument(s): entity : the entity to run through <func>"
"Mandatory Argument(s): func> : pointer to a script function"
"Optional Argument(s): arg1 : parameter 1 to pass to the func"
"Optional Argument(s): arg2 : parameter 2 to pass to the func"
"Optional Argument(s): arg3 : parameter 3 to pass to the func"
"Optional Argument(s): arg4 : parameter 4 to pass to the func"
"Optional Argument(s): arg5 : parameter 5 to pass to the func"
"Optional Argument(s): arg6 : parameter 6 to pass to the func"
"Example:single_func( guy,&set_ignoreme, false );"
"Single Player / Multi Player: both"

Definition at line 563 of file util_shared.csc.

Referenced by _delay(), call_func(), foreach(), and timeout().

◆ single_thread()

function single_thread ( entity  ,
func  ,
arg1  ,
arg2  ,
arg3  ,
arg4  ,
arg5  ,
arg6   
)

Description:
"Function Name: single_thread( <entity>, <func>, [arg1], [arg2], [arg3], [arg4], [arg5], [arg6] )"
"Summary: Threads the < func > function on the entity. The entity will become "self" in the specified function." "Module: Utility" "CallOn: "
"Mandatory Argument(s): <entity> : the entity to thread <func> on"
"Mandatory Argument(s): <func> : pointer to a script function"
"Optional Argument(s): [arg1] : parameter 1 to pass to the func"
"Optional Argument(s): [arg2] : parameter 2 to pass to the func"
"Optional Argument(s): [arg3] : parameter 3 to pass to the func"
"Optional Argument(s): [arg4] : parameter 4 to pass to the func"
"Optional Argument(s): [arg5] : parameter 5 to pass to the func"
"Optional Argument(s): [arg6] : parameter 6 to pass to the func"
"Example:single_func( guy,&special_ai_think, "some_string", 345 );"
"Single Player / Multi Player: both"

Definition at line 699 of file util_shared.csc.

Referenced by _do_trigger_function(), _watch_for_hijacked_vehicles(), add_listen_thread_internal(), array_ent_thread(), local_player_entity_thread(), run_spawn_functions(), and simple_spawn().

◆ spawn_model()

function spawn_model ( n_client  ,
str_model  ,
origin  = ( 0, 0, 0 ),
angles  = ( 0, 0, 0 ) 
)

Description:
"Function Name: spawn_model(<model_name>, [origin], [angles])"
"Summary: Spawns a model at an origin and angles." "Module: Utility"
"Mandatory Argument(s): <model_name> the model name."
"Optional Argument(s): [origin] the origin to spawn the model at."
"Optional Argument(s): [angles] the angles to spawn the model at."
"Example:fx_model = spawn_model("tag_origin", org, ang);"
"Single Player / Multi Player: SP"

Definition at line 92 of file util_shared.csc.

References Spawn().

Referenced by _scene_link(), cSceneObject::_spawn(), cSecurityLight::activate(), activate_camera_light(), camera_death_watcher(), create_gravity_trap_spikes_in_ground(), exit_variable(), cRailTurret::follow_mover(), gravity_trap_fx_on(), cContainer::init_xmodel(), lc_play_arc_fx(), linkToCustomCharacter(), pap_play_fx(), perk_fx(), perk_machine_spawn_init(), play(), cRailTurret::play_cooldown_fx(), play_slam_fx(), player_throw_octobomb(), sentinel_drone_initialize(), setup(), cSecurityMover::setup_mover(), spawn_at_struct(), cRailTurret::spawn_at_struct(), use_hold_think(), and zombie_lift().

◆ spawn_player_arms()

function spawn_player_arms ( )

Definition at line 970 of file util_shared.csc.

References spawn().

◆ timeout()

function timeout ( n_time  ,
func  ,
arg1  ,
arg2  ,
arg3  ,
arg4  ,
arg5  ,
arg6   
)

Description:
"Function Name: timeout( <n_time>, <func>, [arg1], [arg2], [arg3], [arg4], [arg5], [arg6] )"
"Summary: Run any function with a timeout. The function will exit when the timeout is reached." "CallOn: any"
"Mandatory Argument(s): <n_time> : the timeout"
"Mandatory Argument(s): <func> : the function"
"Optional Argument(s): [arg1] : parameter 1 to pass to the func"
"Optional Argument(s): [arg2] : parameter 2 to pass to the func"
"Optional Argument(s): [arg3] : parameter 3 to pass to the func"
"Optional Argument(s): [arg4] : parameter 4 to pass to the func"
"Optional Argument(s): [arg5] : parameter 5 to pass to the func"
"Optional Argument(s): [arg6] : parameter 6 to pass to the func"
"Example:ent timeout( 10, &my_function, 12, "hi" );"

Definition at line 762 of file util_shared.csc.

References single_func(), and TIMEOUT.

Referenced by _play_movie_for_player_with_timeout(), add(), destroy_slowly(), get_hacked_timeout_duration_ms(), iff_override(), loop_stop(), loop_thread(), play_movie_with_timeout(), raps_timeout_after_xsec(), serverTimedRotateTo(), SpawnPlaceable(), timeout_lerp_thread(), timeout_lerp_thread_per_player(), wait_till_something_happens(), waittill_asm_complete(), waittill_asm_timeout(), and waitTillTimeoutOrDeath().

◆ timer_wait()

function timer_wait ( n_wait  )

Definition at line 891 of file util_shared.csc.

References get_time_in_seconds(), and get_time_left().

Referenced by lerp_dvar().

◆ trigger_thread()

function trigger_thread ( ent  ,
on_enter_payload  ,
on_exit_payload   
)

◆ wait_till_not_touching()

function wait_till_not_touching ( e_to_check  ,
e_to_touch   
)

Description:
"Function Name: wait_till_not_touching( <ent> )"
"Summary: Blocking function. Returns when entity one is no longer touching entity two or either entity dies." "Module: Util"
"Mandatory Argument(s): <e_to_check>: The entity you want to check"
"Mandatory Argument(s): <e_to_touch>: The entity you want to touch"

"Example:util::wait_till_not_touching( player, t_player_safe )"
"Single Player / Multi Player: singleplayer"

Definition at line 1052 of file util_shared.csc.

◆ waitforallclients()

function waitforallclients ( )

◆ waitforclient()

◆ waittill_any()

function waittill_any ( str_notify1  ,
str_notify2  ,
str_notify3  ,
str_notify4  ,
str_notify5   
)

Description:
"Function Name: waittill_any( <str_notify1>, <str_notify2>, <str_notify3>, <str_notify4>, <str_notify5> )"
"Summary: Waits for any of the the specified notifies." "Module: Utility" "CallOn: Entity"
"Mandatory Argument(s): <str_notify1> name of a notify to wait on"
"Optional Argument(s): <str_notify2> name of a notify to wait on"
"Optional Argument(s): <str_notify3> name of a notify to wait on"
"Optional Argument(s): <str_notify4> name of a notify to wait on"
"Optional Argument(s): <str_notify5> name of a notify to wait on"
"Example:guy waittill_any( "goal", "pain", "near_goal", "bulletwhizby" );"
"Single Player / Multi Player: both"

Definition at line 375 of file util_shared.csc.

References array, and waittill_any_array().

Referenced by _allowPainRestore(), _CloneWatchOwnerDisconnect(), _force_goal(), _reach(), aigroup_spawner_death(), boost_fx_interrupt_handler(), CancelOnPlayerDisconnect(), carryQRDrone_handleExistence(), check_for_player_switch_or_time_jump(), clean_up_suicide_hud_on_bled_out(), clean_up_suicide_hud_on_end_game(), cleanup_bombs(), cleanupFX(), CleanupFx(), cleanupWaiter(), cleanUpWatcherOnDeath(), clear_lockon_after_grapple(), clearFXOnDeath(), clearInvalidDroneTarget(), croc_movementupdate(), custom_class_start_threads(), death_firesound(), deleteOnDeath(), deleteOnOwnerleave(), deleteShieldOnPlayerDeathOrDisconnect(), deleteShieldOnTriggerDeath(), demo_jump_monitor(), demo_think(), destroy_gravity_trap_spikes_in_ground(), destroyHeadIconsOnDeath(), destruction_watcher(), do_knuckle_crack(), dog_behind_audio(), end_gameover_snapshot(), escort_drone_movementupdate(), finish_corner(), firefly_watch_for_target_death(), firefly_watch_fx_finished(), flipping_shooting_dmg_snd(), fog_vol_to_visionset_instant_transition_monitor(), give_melee_weapon(), go_back_on_navvolume(), goal_flag_monitor(), hackerTriggerSetVisibility(), healthOverlay_remove(), heat_wave_fx_cleanup(), heli_protect(), heliGuardSupport_fireStop(), heliGuardSupport_watchForEarlyLeave(), killMineMoverOnPickup(), laststand_clean_up_on_interrupt(), laststand_clean_up_reviving_any(), ListenForMove(), lock_weapon_models(), MarkerCleanupThread(), metalstorm_movementupdate(), MissileCleanupThread(), missileFireWatcher(), missileLockWatcher(), monitor_detectnearbyenemies(), monitor_when_player_acquires_perk(), overdrive_boost_fx_interrupt_handler(), ownerHadActiveDogs(), path_update_interrupt_by_attacker(), pickup_placeable_mine_trigger_listener_enable(), planeMortar_watchForEndNotify(), plant_gravity_trap(), play_crashing_loop(), play_spinning_plane_sound(), player_too_many_weapons_monitor_takeaway_simultaneous(), player_watch_blood_shutdown(), player_watch_drown_shutdown(), PlayFaceThread(), PlayPilotDialog(), powerup_zombie_grab_trigger_cleanup(), projectile_abort_think(), projectile_target_search(), proximityWeaponObject_RemoveSpawnProtectOnDeath(), QRDrone_dmg_snd(), QRDrone_explode_on_notify(), qrotor_dmg_snd(), quadrotor_movementupdate(), release_spawner_target_node(), remote_killstreak_abort(), repulsor_fx(), SAMTurretWatcher(), set_drone_target(), ShutdownOnCancelEvent(), sndProxAlert_EntCleanup(), SpawnDart(), state_combat_update(), stunFxThink(), swarm_killstreak_abort(), tank_watch_owner_events(), target_death_watch(), target_stop_sounds(), trackActiveKillstreak(), treasure_chest_think(), turret_microwave_sound_off_waiter(), turret_watch_owner_events(), updateSpeedOnLock(), UseRemoteControlWeapon(), vehicle_damage_filter_exit_watcher(), vending_weapon_upgrade(), WaitUntilTeamChange(), WaitUntilTeamChangeSingleTon(), wasp_behind_audio(), watch_for_skip_killcam(), watch_player_fx_finished(), watch_stop_player_fx(), watch_vision_pulse_owner_death(), watch_world_pulse_end(), WatchBurnFinished(), WatchCarryCancelEvents(), watchClearHacking(), watchClearLockedOn(), watchClearLockingOn(), WatchCombatRobotOwnerDisconnect(), watchEntityShutdown(), watchForEarlyLeave(), watchForGrenadePutDown(), WatchForKillstreakEnd(), watchForOwnerExit(), WatchGameEvents(), WatchMoveTriggerShutdown(), WatchOwnerDisconnect(), WatchOwnerEvents(), WatchOwnerGameEvents(), WatchOwnerNonDeathEvents(), WatchPlayerTeamChangeThread(), WatchRemoveRemoteControlledWeapon(), watchRestartFX(), watchRiotshieldStuckEntityDeath(), watchShutdown(), WatchTeamChange(), WatchWeaponDeath(), weaponObjectDetectionTrigger(), and zombie_eyes_handle_demo_jump().

◆ waittill_any_array()

function waittill_any_array ( a_notifies  )

Description:
"Function Name: waittill_any_array( <a_notifies> )"
"Summary: Waits for any of the the specified notifies in the array." "Module: Utility" "CallOn: Entity"
"Mandatory Argument(s): <a_notifies> array of notifies to wait on"
"Example:guy waittill_any_array( array( "goal", "pain", "near_goal", "bulletwhizby" ) );"
"Single Player / Multi Player: both"

Definition at line 392 of file util_shared.csc.

Referenced by _waitlogic(), wait_till_any(), wait_till_clear_any(), and waittill_any().

◆ waittill_any_array_return()

function waittill_any_array_return ( a_notifies  )

Description:
"Function Name: waittill_any_array_return( <a_notifies> )"
"Summary: Waits for any of the the specified notifies and return which one it got." "Module: Utility" "CallOn: Entity"
"Mandatory Argument(s): <a_notifies> array of notifies to wait on"
"Example:str_which_notify = guy waittill_any_array_return( array( "goal", "pain", "near_goal", "bulletwhizby" ) );"
"Single Player / Multi Player: both"

Definition at line 339 of file util_shared.csc.

References waittill_string().

◆ waittill_any_ents()

function waittill_any_ents ( ent1  ,
string1  ,
ent2  ,
string2  ,
ent3  ,
string3  ,
ent4  ,
string4  ,
ent5  ,
string5  ,
ent6  ,
string6  ,
ent7  ,
string7   
)

Description:
"Function Name: waittill_any_ents( ent1, string1, ent2, string2, ent3, string3, ent4, string4 )"
"Summary: Waits for any of the the specified notifies on their associated entities." "Module: Utility" "CallOn: Entity"
"Mandatory Argument(s): <ent1> entity to wait for <string1> on"
"Mandatory Argument(s): <string1> notify to wait for on <ent1>"
"Optional Argument(s): <ent2> entity to wait for <string2> on"
"Optional Argument(s): <string2> notify to wait for on <ent2>"
"Optional Argument(s): <ent3> entity to wait for <string3> on"
"Optional Argument(s): <string3> notify to wait for on <ent3>"
"Optional Argument(s): <ent4> entity to wait for <string4> on"
"Optional Argument(s): <string4> notify to wait for on <ent4>"
"Example:guy waittill_any_ents( guy, "goal", guy, "pain", guy, "near_goal", player, "weapon_change" );"
"Single Player / Multi Player: both"

Definition at line 496 of file util_shared.csc.

Referenced by _kill_on_ent_death(), gravity_trap_notify_watcher(), and paths().

◆ waittill_any_ents_two()

function waittill_any_ents_two ( ent1  ,
string1  ,
ent2  ,
string2   
)

Description:
"Function Name: waittill_any_ents_two( ent1, string1, ent2, string2)"
"Summary: Waits for any of the the specified notifies on their associated entities [MAX TWO]." "Module: Utility" "CallOn: Entity"
"Mandatory Argument(s): <ent1> entity to wait for <string1> on"
"Mandatory Argument(s): <string1> notify to wait for on <ent1>"
"Optional Argument(s): <ent2> entity to wait for <string2> on"
"Optional Argument(s): <string2> notify to wait for on <ent2>"
"Example:guy waittill_any_ents_two( guy, "goal", guy, "pain");"
"Single Player / Multi Player: both"

Definition at line 535 of file util_shared.csc.

Referenced by _scene_link(), and watchForDeath().

◆ waittill_any_ex()

function waittill_any_ex (   ...)

Description:
"Function Name: waittill_any_ex( <timeout>, <ent1>, <string1_1>, <string1_2>, <string1_3>... <ent2>, <string2_1>, <string2_2>... ... )"
"Summary: Waits for any of the the specified notifies and returns which one it got. NOTE: you can send any number of ents and arguments that you want. The first <ent1> is optional. In this case, self will be used as the first ent." "Module: Utility" "CallOn: Entity"
"Optional Argument(s): <timeout> timeout value (in seconds)"
"Optional Argument(s): <ent1> name of a notify to wait on"
"Optional Argument(s): <string1_1> name of a notify to wait on (ent1 or self)"
"Optional Argument(s): <string1_2> name of a notify to wait on (ent1 or self)"
"Optional Argument(s): <string1_3> name of a notify to wait on (ent1 or self)"
"Mandatory Argument(s): <ent2> name of a notify to wait on"
"Optional Argument(s): <string2_1> name of a notify to wait on (ent2)"
"Optional Argument(s): <string2_2> name of a notify to wait on (ent2)"
"Optional Argument(s): <string2_3> name of a notify to wait on (ent2)"
"Example:which_notify = self waittill_any( "stop_waiting", guy1, "goal", "pain", "near_goal", "bulletwhizby", guy2, "death" );"
"Single Player / Multi Player: both"

Definition at line 270 of file util_shared.csc.

References _timeout(), and waittill_string().

Referenced by checkGrenadeForDud(), grab_check(), hide_owner(), margwaWait(), player_grenade_multiattack_bookmark_watcher(), snd_underwater(), tear_into_building(), and waittill_pathing_done().

◆ waittill_any_return()

function waittill_any_return ( string1  ,
string2  ,
string3  ,
string4  ,
string5  ,
string6  ,
string7   
)

Description:
"Function Name: waittill_any_return( <string1>, <string2>, <string3>, <string4>, <string5> )"
"Summary: Waits for any of the the specified notifies and return which one it got." "Module: Utility" "CallOn: Entity"
"Mandatory Argument(s): <string1> name of a notify to wait on"
"Optional Argument(s): <string2> name of a notify to wait on"
"Optional Argument(s): <string3> name of a notify to wait on"
"Optional Argument(s): <string4> name of a notify to wait on"
"Optional Argument(s): <string4> name of a notify to wait on"
"Optional Argument(s): <string6> name of a notify to wait on"
"Optional Argument(s): <string7> name of a notify to wait on"
"Example:which_notify = guy waittill_any( "goal", "pain", "near_goal", "bulletwhizby" );"
"Single Player / Multi Player: both"

Definition at line 212 of file util_shared.csc.

References waittill_string().

Referenced by ActivateDart(), ActivateEMP(), ActivateMicrowaveTurret(), ActivateTurret(), armblade_sound_thread(), cancel_button_think(), clearPlayerLockFromQRDroneLaunch(), clearUpLocationSelection(), craftable_use_hold_think(), deleteWeaponObjectsOn(), dog_patrol(), endSelectionThink(), equipmentWatchTeamFX(), footstep_handler(), hackerInit(), killWhileContesting(), KothCaptureLoop(), machine_sounds(), perk_think(), player_monitor_doublejump(), player_monitor_slide(), player_monitor_swimming(), player_monitor_wall_run(), quadtank_movementupdate(), tesla_sound_thread(), thundergun_sound_thread(), track(), trackWeapon(), trackWeaponZM(), treasure_chest_glowfx(), turn_revive_on(), useMissileDrone(), useSupplyDropMarker(), vending_trigger_post_think(), wait_for_throw_status(), waitRemoteControl(), watch_for_gib_notetracks(), watch_offhand_end(), watchDoublejump(), watchForExplosionNotetracks(), watchHackerToolEnd(), watchJump(), watchKillWhileContesting(), watchSlide(), watchSprint(), watchSwimming(), watchWallrun(), and watchWallRunTwoOppositeWallsNoGround().

◆ waittill_any_timeout()

function waittill_any_timeout ( n_timeout  ,
string1  ,
string2  ,
string3  ,
string4  ,
string5   
)

Description:
"Function Name: waittill_any_timeout( <n_timeout>, <str_notify1>, [str_notify2], [str_notify3], [str_notify4], [str_notify5] )"
"Summary: Waits for any of the the specified notifies or times out." "Module: Utility" "CallOn: Entity"
"Mandatory Argument(s): <n_timeout> timeout in seconds"
"Mandatory Argument(s): <str_notify1> name of a notify to wait on"
"Optional Argument(s): <str_notify2> name of a notify to wait on"
"Optional Argument(s): <str_notify3> name of a notify to wait on"
"Optional Argument(s): <str_notify4> name of a notify to wait on"
"Optional Argument(s): <str_notify5> name of a notify to wait on"
"Example:guy waittill_any_timeout( 2, "goal", "pain", "near_goal", "bulletwhizby" );"
"Single Player / Multi Player: both"

Definition at line 423 of file util_shared.csc.

References _timeout(), and waittill_string().

Referenced by _CloneOrbFx(), _play_fx_delete(), _temp_dialog(), activation_flash(), apply_vortex_fx(), attack_javelin(), attack_minigun_sweep(), Attack_Rocket(), attack_spike_minefield(), Attack_Thread_rocket(), checkForHeroSurvival(), deactivateFlashbackWarpAfterTime(), death_suicide_crash(), Delay_Target_ToEnemy_Thread(), escort_drone_movementupdate(), fade_hint_text_after_time(), FireRocketLauncher(), gadget_drone_spawn(), gadget_vision_pulse_ramp_hold_func(), give_hero_weapon(), give_object(), gravity_trap_timeout_watcher(), heli_crash(), hide_hint_text(), hide_hint_text_listener(), iff_override(), init_ride_killstreak_internal(), laststand_disable_player_weapons(), metalstorm_crash_movement(), Movement_Thread_StayInDistance(), Movement_Thread_Wander(), OnDeath(), PerformLeaveHelicopterFromDamage(), player_watch_shellshock_accumulation(), quadrotor_movementupdate(), run_next(), Scan(), sentinel_FireBeamSuccession(), set_movement_and_accel(), show_chest(), show_hint_text(), sndOnWait(), sndStopBurnLoop(), spawnSmokeGrenadeTrigger(), state_emped_update(), state_strafe_update(), switch_from_alt_weapon(), tank_death_think(), trap_audio(), trap_audio_fx(), wait_give_perk(), waittill_pathresult(), waittill_weapon_lock_or_timeout(), watch_smoke_death(), widows_wine_cocoon_zombie(), and widows_wine_slow_zombie().

◆ waittill_dobj()

◆ waittill_multiple()

function waittill_multiple (   ...)

Description:
"Function Name: waittill_multiple( <string1>, <string2>, <string3>, <string4>, <string5> )"
"Summary: Waits for all of the the specified notifies."
"Mandatory Argument(s): The notifies to wait on."
"Example:guy waittill_multiple( "goal", "pain", "near_goal", "bulletwhizby" );"

Definition at line 123 of file util_shared.csc.

References _waitlogic().

Referenced by lerp().

◆ waittill_multiple_ents()

function waittill_multiple_ents (   ...)

Description:
"Function Name: waittill_multiple_ents( ... )"
"Summary: Waits for all of the the specified notifies on their associated entities."
"Mandatory Argument(s): List of ents and the notifies to wait on."
"Example:waittill_multiple_ents( guy, "goal", guy, "pain", guy, "near_goal", player, "weapon_change" );"

Definition at line 146 of file util_shared.csc.

References _waitlogic(), a_ents, and ARRAY_ADD.

◆ waittill_notify_or_timeout()

function waittill_notify_or_timeout ( msg  ,
timer   
)

Description:
"Function Name: waittill_notify_or_timeout( <msg>, <timer> )"
"Summary: Waits until the owner receives the specified notify message or the specified time runs out. Do not thread this!" "CallOn: an entity"
"Example:tank waittill_notify_or_timeout( "turret_on_target", 10 ); "
"Mandatory Argument(s): <msg> : The notify to wait for."
"Mandatory Argument(s): <timer> : The amount of time to wait until overriding the wait statement."

Definition at line 473 of file util_shared.csc.

References timer().

Referenced by _destroy_error_on_screen(), _destroy_warning_on_screen(), do_melee_attack(), do_ranged_attack(), satchelSpawn(), setup_wc_extracam_settings(), state_death_update(), thrasherInvulnerability(), timer(), trap_activate_electric(), trap_activate_fire(), turret_gadget_deploy_fireupdate(), and update_nav_triggers().

◆ waittill_string()

function waittill_string ( msg  ,
ent   
)

◆ while()

while ( !done &&array.  size,
 
)

Definition at line 924 of file util_shared.csc.

References array.

Referenced by watch_for_drop().

◆ within_fov()

function within_fov ( start_origin  ,
start_angles  ,
end_origin  ,
fov   
)

Description:
"Function Name: within_fov( <start_origin> , <start_angles> , <end_origin> , <fov> )"
"Summary: Returns true if < end_origin > is within the players field of view, otherwise returns false." "Module: Vector" "CallOn: "
"Mandatory Argument(s): <start_origin> : starting origin for FOV check( usually the players origin )"
"Mandatory Argument(s): <start_angles> : angles to specify facing direction( usually the players angles )"
"Mandatory Argument(s): <end_origin> : origin to check if it is in the FOV"
"Mandatory Argument(s): <fov> : cosine of the FOV angle to use"
"Example:qBool = within_fov( level.player.origin, level.player.angles, target1.origin, cos( 45 ) );"
"Single Player / Multi Player: multiplayer"

Definition at line 1291 of file util_shared.csc.

Variable Documentation

◆ a

◆ array

function clean_deleted array
Initial value:
{
done = false

Definition at line 922 of file util_shared.csc.

Referenced by waittill_any(), and while().

◆ else

else
Initial value:
{
ArrayRemoveValue( ‪a, self, false )

Definition at line 916 of file util_shared.csc.

‪a
‪function add_remove_list a
Definition: util_shared.csc:906
‪DEFAULT
‪#define DEFAULT(__var, __default)
Definition: shared.gsh:270