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

Go to the source code of this file.

Macros

#define HINT_TEXT_DISPLAY_HEIGHT   -160
 
#define HINT_TEXT_DISPLAY_TIME_DEFAULT   4.0
 
#define HINT_TEXT_TURN_OFF_NOTIFY   "notify_turn_off_hint_text"
 
#define N_HINT_TEXT_FADE_TIME   0.75
 

Functions

function _playLocalSound (soundAlias)
 
function add_trigger_to_ent (ent)
 
function clearLowerMessage (fadetime)
 
function DoMaxDamage (origin, attacker, inflictor, headshot, mod)
 
function ent_already_in_trigger (trig)
 
function error (msg)
 
function fade_hint_text_after_time (n_display_time, str_turn_off_notify)
 
function get_player_height ()
 
function getfx (fx)
 
function getObjectiveHintText (team)
 
function getObjectiveScoreText (team)
 
function getObjectiveText (team)
 
function getOtherTeam (team)
 
function getOtherTeamsMask (skip_team)
 
function getPlayerFromClientNum (clientNum)
 
function getTeamMask (team)
 
function ghost_wait_show (wait_time=0.1)
 
function ghost_wait_show_to_others (player, wait_time=0.1, self_endon_string1)
 
function ghost_wait_show_to_player (player, wait_time=0.1, self_endon_string1)
 
function hide_hint_text (b_fade_before_hiding=true)
 
function hide_hint_text_listener (n_time)
 
function init_player_contract_events ()
 
function is_objective_game (game_type)
 
function IsBulletImpactMOD (sMeansOfDeath)
 
function isFlashbanged ()
 
function isKillStreaksEnabled ()
 
function isPressBuild ()
 
function isStrStart (string1, subStr)
 
function player_contract_event (event_name, param1=undefined, param2=undefined, param3=undefined)
 
function plot_points (plotpoints, r, g, b, timer)
 
function printAndSoundOnEveryone (team, enemyteam, printFriendly, printEnemy, soundFriendly, soundEnemy, printarg)
 
function printBoldOnTeam (text, team)
 
function printBoldOnTeamArg (text, team, arg)
 
function printOnPlayers (text, team)
 
function printOnTeam (text, team)
 
function printOnTeamArg (text, team, arg)
 
function register_player_contract_event (event_name, event_func, max_param_count=0)
 
function registerNumLives (minValue, maxValue, teamLivesMinValue, teamLivesMaxValue)
 
function registerRoundLimit (minValue, maxValue)
 
function registerRoundScoreLimit (minValue, maxValue)
 
function registerRoundSwitch (minValue, maxValue)
 
function registerRoundWinLimit (minValue, maxValue)
 
function registerScoreLimit (minValue, maxValue)
 
function registerTimeLimit (minValue, maxValue)
 
function remove_trigger_from_ent (ent)
 
function screen_message_create (string_message_1, string_message_2, string_message_3, n_offset_y, n_time)
 
function screen_message_delete (delay)
 
function self_delete ()
 
function set_dvar_float_if_unset (dvar, value, reset)
 
function set_dvar_if_unset (dvar, value, reset)
 
function set_dvar_int_if_unset (dvar, value, reset)
 
function set_team_radar (team, value)
 
function setLowerMessage (text, time, combineMessageAndTimer)
 
function setLowerMessageValue (text, value, combineMessage)
 
function setObjectiveHintText (team, text)
 
function setObjectiveScoreText (team, text)
 
function setObjectiveText (team, text)
 
function setUsingRemote (remoteName, set_killstreak_delay_killcam=true)
 
function show_hint_text (str_text_to_show, b_should_blink=false, str_turn_off_notify=HINT_TEXT_TURN_OFF_NOTIFY, n_display_time=HINT_TEXT_DISPLAY_TIME_DEFAULT)
 
function trigger_thread (ent, on_enter_payload, on_exit_payload)
 
function trigger_thread_death_monitor (ent, ender)
 
function use_button_pressed ()
 
function wait_endon (waitTime, endOnString, endonString2, endonString3, endonString4)
 
function waitRespawnButton ()
 
function waittill_use_button_pressed ()
 
function warning (msg)
 
function within_fov (start_origin, start_angles, end_origin, fov)
 

Macro Definition Documentation

◆ HINT_TEXT_DISPLAY_HEIGHT

#define HINT_TEXT_DISPLAY_HEIGHT   -160

Definition at line 17 of file _util.gsc.

◆ HINT_TEXT_DISPLAY_TIME_DEFAULT

#define HINT_TEXT_DISPLAY_TIME_DEFAULT   4.0

Definition at line 15 of file _util.gsc.

◆ HINT_TEXT_TURN_OFF_NOTIFY

#define HINT_TEXT_TURN_OFF_NOTIFY   "notify_turn_off_hint_text"

Definition at line 18 of file _util.gsc.

◆ N_HINT_TEXT_FADE_TIME

#define N_HINT_TEXT_FADE_TIME   0.75

Definition at line 16 of file _util.gsc.

Function Documentation

◆ _playLocalSound()

function _playLocalSound ( soundAlias  )

Definition at line 351 of file _util.gsc.

◆ add_trigger_to_ent()

function add_trigger_to_ent ( ent  )

Definition at line 470 of file _util.gsc.

Referenced by trigger_thread().

◆ clearLowerMessage()

function clearLowerMessage ( fadetime  )

◆ DoMaxDamage()

function DoMaxDamage ( origin  ,
attacker  ,
inflictor  ,
headshot  ,
mod   
)

Definition at line 708 of file _util.gsc.

References damage().

◆ ent_already_in_trigger()

function ent_already_in_trigger ( trig  )

Definition at line 494 of file _util.gsc.

Referenced by trigger_thread().

◆ error()

◆ fade_hint_text_after_time()

function fade_hint_text_after_time ( n_display_time  ,
str_turn_off_notify   
)

Definition at line 1106 of file _util.gsc.

References hide_hint_text(), N_HINT_TEXT_FADE_TIME, and waittill_any_timeout().

Referenced by show_hint_text().

◆ get_player_height()

function get_player_height ( )

Definition at line 65 of file _util.gsc.

◆ getfx()

function getfx ( fx  )

Definition at line 414 of file _util.gsc.

◆ getObjectiveHintText()

function getObjectiveHintText ( team  )

Definition at line 610 of file _util.gsc.

Referenced by doInitialSpawnMessaging(), and spawnPlayer().

◆ getObjectiveScoreText()

function getObjectiveScoreText ( team  )

Definition at line 605 of file _util.gsc.

Referenced by updateObjectiveText().

◆ getObjectiveText()

function getObjectiveText ( team  )

Definition at line 600 of file _util.gsc.

Referenced by updateObjectiveText().

◆ getOtherTeam()

◆ getOtherTeamsMask()

◆ getPlayerFromClientNum()

function getPlayerFromClientNum ( clientNum  )

Definition at line 678 of file _util.gsc.

Referenced by on_menu_response().

◆ getTeamMask()

◆ ghost_wait_show()

function ghost_wait_show ( wait_time  = 0.1)

Description:
"Function Name: ghost_wait_show()"
"Summary: ghosts an entity, waits, then shows the entity; mainly used to hide pops when setting up models poses via setanim" "Module: Utility" "CallOn: An entity"
"Optional Argument(s): <wait_time> : how long to wait before showing"
"Example:turret thread ghost_wait_show();"
"Single Player / Multi Player: multiplayer"

Definition at line 916 of file _util.gsc.

Referenced by OnPlaceEMP(), and OnPlaceTurret().

◆ ghost_wait_show_to_others()

function ghost_wait_show_to_others ( player  ,
wait_time  = 0.1,
self_endon_string1   
)

Description:
"Function Name: ghost_wait_show_to_others()"
"Summary: ghosts an entity, waits, then shows the entity to other players; mainly used to hide pops when setting up models poses via setanim" "Module: Utility" "CallOn: An entity"
"Mandatory Argument(s): <player> : the player from whom to hide this entity"
"Optional Argument(s): <wait_time> : how long to wait before showing to others"
"Optional Argument(s): <self_endon_string1> : sets up a self endon with this string"
"Example:turret thread ghost_wait_show_to_others( player );"
"Single Player / Multi Player: multiplayer"

Definition at line 977 of file _util.gsc.

Referenced by ActivateEMP(), ActivateMicrowaveTurret(), ActivateTurret(), and CarryPlaceable().

◆ ghost_wait_show_to_player()

function ghost_wait_show_to_player ( player  ,
wait_time  = 0.1,
self_endon_string1   
)

Description:
"Function Name: ghost_wait_show_to_player()"
"Summary: ghosts an entity, waits, then shows the entity to a player; mainly used to hide pops when setting up models poses via setanim" "Module: Utility" "CallOn: An entity"
"Mandatory Argument(s): <player> : the player to whom to show this entity"
"Optional Argument(s): <wait_time> : how long to wait before showing to the player"
"Optional Argument(s): <self_endon_string1> : sets up a self endon with this string"
"Example:turret thread ghost_wait_show_to_player( player );"
"Single Player / Multi Player: multiplayer"

Definition at line 937 of file _util.gsc.

Referenced by ActivateEMP(), ActivateMicrowaveTurret(), ActivateTurret(), and CarryPlaceable().

◆ hide_hint_text()

function hide_hint_text ( b_fade_before_hiding  = true)

Description:
"Function Name: hide_hint_text"
"Summary: Hides any help text which may be on screen."

Definition at line 1084 of file _util.gsc.

References N_HINT_TEXT_FADE_TIME, play_animation(), and waittill_any_timeout().

Referenced by fade_hint_text_after_time(), hide_hint_text_listener(), show_hint_text(), and stop_tutorial_when_restarting_track().

◆ hide_hint_text_listener()

function hide_hint_text_listener ( n_time  )

Definition at line 1118 of file _util.gsc.

References hide_hint_text(), and waittill_any_timeout().

Referenced by show_hint_text().

◆ init_player_contract_events()

function init_player_contract_events ( )

Definition at line 1141 of file _util.gsc.

Referenced by start_gametype().

◆ is_objective_game()

function is_objective_game ( game_type  )

Definition at line 1205 of file _util.gsc.

Referenced by contract_win().

◆ IsBulletImpactMOD()

function IsBulletImpactMOD ( sMeansOfDeath  )

Definition at line 71 of file _util.gsc.

◆ isFlashbanged()

function isFlashbanged ( )

Definition at line 703 of file _util.gsc.

Referenced by challengeKills(), and on_damage().

◆ isKillStreaksEnabled()

function isKillStreaksEnabled ( )

Definition at line 564 of file _util.gsc.

Referenced by give_for_streak(), and give_internal().

◆ isPressBuild()

function isPressBuild ( )

Definition at line 691 of file _util.gsc.

◆ isStrStart()

function isStrStart ( string1  ,
subStr   
)

Definition at line 559 of file _util.gsc.

◆ player_contract_event()

function player_contract_event ( event_name  ,
param1  = undefined,
param2  = undefined,
param3  = undefined 
)

◆ plot_points()

function plot_points ( plotpoints  ,
,
,
,
timer   
)

Definition at line 410 of file _util.gsc.

◆ printAndSoundOnEveryone()

function printAndSoundOnEveryone ( team  ,
enemyteam  ,
printFriendly  ,
printEnemy  ,
soundFriendly  ,
soundEnemy  ,
printarg   
)

◆ printBoldOnTeam()

function printBoldOnTeam ( text  ,
team   
)

Definition at line 205 of file _util.gsc.

◆ printBoldOnTeamArg()

function printBoldOnTeamArg ( text  ,
team  ,
arg   
)

Definition at line 218 of file _util.gsc.

◆ printOnPlayers()

function printOnPlayers ( text  ,
team   
)

Definition at line 235 of file _util.gsc.

◆ printOnTeam()

function printOnTeam ( text  ,
team   
)

Definition at line 193 of file _util.gsc.

◆ printOnTeamArg()

function printOnTeamArg ( text  ,
team  ,
arg   
)

Definition at line 230 of file _util.gsc.

◆ register_player_contract_event()

function register_player_contract_event ( event_name  ,
event_func  ,
max_param_count  = 0 
)

Definition at line 1147 of file _util.gsc.

Referenced by start_gametype().

◆ registerNumLives()

function registerNumLives ( minValue  ,
maxValue  ,
teamLivesMinValue  ,
teamLivesMaxValue   
)

Definition at line 664 of file _util.gsc.

References clamp(), and DEFAULT.

Referenced by main().

◆ registerRoundLimit()

function registerRoundLimit ( minValue  ,
maxValue   
)

Definition at line 622 of file _util.gsc.

References clamp().

Referenced by Callback_StartGameType(), and main().

◆ registerRoundScoreLimit()

function registerRoundScoreLimit ( minValue  ,
maxValue   
)

Definition at line 647 of file _util.gsc.

References clamp().

Referenced by Callback_StartGameType(), and main().

◆ registerRoundSwitch()

function registerRoundSwitch ( minValue  ,
maxValue   
)

Definition at line 615 of file _util.gsc.

References clamp().

Referenced by main().

◆ registerRoundWinLimit()

function registerRoundWinLimit ( minValue  ,
maxValue   
)

Definition at line 630 of file _util.gsc.

References clamp().

Referenced by Callback_StartGameType(), and main().

◆ registerScoreLimit()

function registerScoreLimit ( minValue  ,
maxValue   
)

Definition at line 638 of file _util.gsc.

References clamp().

Referenced by Callback_StartGameType(), main(), and onStartGameType().

◆ registerTimeLimit()

function registerTimeLimit ( minValue  ,
maxValue   
)

Definition at line 655 of file _util.gsc.

References clamp().

Referenced by Callback_StartGameType(), main(), and onStartGameType().

◆ remove_trigger_from_ent()

function remove_trigger_from_ent ( ent  )

Definition at line 480 of file _util.gsc.

Referenced by trigger_thread(), and trigger_thread_death_monitor().

◆ screen_message_create()

function screen_message_create ( string_message_1  ,
string_message_2  ,
string_message_3  ,
n_offset_y  ,
n_time   
)

Description:
"Function Name: screen_message_create(<string_message>)"
"Summary: Creates a HUD element at the correct position with the string or string reference passed in." "Module: Utility" "CallOn: N/A"
"Mandatory Argument(s): <string_message_1> : A string or string reference to place on the screen."
"Optional Argument(s): <string_message_2> : A second string to display below the first."
"Optional Argument(s): <string_message_3> : A third string to display below the second."
"Optional Argument(s): <n_offset_y>: Optional offset in y direction that should only be used in very specific circumstances."
"Optional Argument(s): <n_time> : Length of time to display the message."
"Example:screen_message_create( &"LEVEL_STRING" );"
"Single Player / Multi Player: singleplayer"

Definition at line 762 of file _util.gsc.

References screen_message_delete().

◆ screen_message_delete()

function screen_message_delete ( delay  )

Description:
"Function Name: screen_message_delete()"
"Summary: Deletes the current message being displayed on the screen made using screen_message_create." "Module: Utility" "CallOn: N/A"
"Example:screen_message_delete();"
"Single Player / Multi Player: singleplayer"

Definition at line 885 of file _util.gsc.

References delay().

Referenced by screen_message_create().

◆ self_delete()

function self_delete ( )

Description:
"Function Name: self_delete()"
"Summary: Just calls the delete() script command on self. Reason for this is so that we can use array::thread_all to delete entities" "Module: Entity" "CallOn: An entity"
"Example:ai[ 0 ] thread self_delete();"
"Single Player / Multi Player: singleplayer"

Definition at line 739 of file _util.gsc.

Referenced by blocker_trigger_think(), delete_in_createfx(), do_zombie_explode(), monkey_cleanup(), octobomb_cleanup(), player_throw_octobomb(), remove_chunk(), and zombie_ragdoll_then_explode().

◆ set_dvar_float_if_unset()

function set_dvar_float_if_unset ( dvar  ,
value  ,
reset   
)

Definition at line 437 of file _util.gsc.

Referenced by init().

◆ set_dvar_if_unset()

function set_dvar_if_unset ( dvar  ,
value  ,
reset   
)

Definition at line 420 of file _util.gsc.

Referenced by init(), and onSpawnPlayer_Unified().

◆ set_dvar_int_if_unset()

function set_dvar_int_if_unset ( dvar  ,
value  ,
reset   
)

Definition at line 453 of file _util.gsc.

Referenced by init(), and QRDrone_leave_on_timeout().

◆ set_team_radar()

function set_team_radar ( team  ,
value   
)

Definition at line 1129 of file _util.gsc.

Referenced by SatelliteTracker(), and UAVTracker().

◆ setLowerMessage()

function setLowerMessage ( text  ,
time  ,
combineMessageAndTimer   
)

Definition at line 86 of file _util.gsc.

Referenced by clearLowerMessage(), default_spawnMessage(), and waitAndSpawnClient().

◆ setLowerMessageValue()

function setLowerMessageValue ( text  ,
value  ,
combineMessage   
)

Definition at line 126 of file _util.gsc.

◆ setObjectiveHintText()

function setObjectiveHintText ( team  ,
text   
)

Definition at line 595 of file _util.gsc.

Referenced by onStartGameType(), and setupTeam().

◆ setObjectiveScoreText()

function setObjectiveScoreText ( team  ,
text   
)

Definition at line 590 of file _util.gsc.

Referenced by onStartGameType(), and setupTeam().

◆ setObjectiveText()

function setObjectiveText ( team  ,
text   
)

Definition at line 585 of file _util.gsc.

Referenced by onStartGameType(), and setupTeam().

◆ setUsingRemote()

function setUsingRemote ( remoteName  ,
set_killstreak_delay_killcam  = true 
)

◆ show_hint_text()

function show_hint_text ( str_text_to_show  ,
b_should_blink  = false,
str_turn_off_notify  = HINT_TEXT_TURN_OFF_NOTIFY,
n_display_time  = HINT_TEXT_DISPLAY_TIME_DEFAULT 
)

Description:
"Function Name: show_hint_text"
"Summary: Displays hint text for an amount of time. Can be turned off by sending a notify, or by calling hide_hint_text()."
"Mandatory Argument(s): <str_text_to_show> : The text to display."
"Optional Argument(s): <b_should_blink> : Should this menu flash on and off?"
"Optional Argument(s): <str_turn_off_notify> : The use this notify to turn off the hint text."
"Optional Argument(s): <n_display_time> : Override how many seconds the text is displayed for."

"Example:show_hint_text( "Your help text here!", "notify_hide_help_text" );"

Definition at line 1042 of file _util.gsc.

References fade_hint_text_after_time(), hide_hint_text(), hide_hint_text_listener(), HINT_TEXT_TURN_OFF_NOTIFY, and play_animation().

Referenced by default_power_full(), show_tutorial_hint(), watchFirstUse(), and wield_gravityspikes().

◆ trigger_thread()

function trigger_thread ( ent  ,
on_enter_payload  ,
on_exit_payload   
)

◆ trigger_thread_death_monitor()

function trigger_thread_death_monitor ( ent  ,
ender   
)

Definition at line 508 of file _util.gsc.

References remove_trigger_from_ent().

Referenced by trigger_thread().

◆ use_button_pressed()

function use_button_pressed ( )

Definition at line 1008 of file _util.gsc.

Referenced by waittill_use_button_pressed().

◆ wait_endon()

function wait_endon ( waitTime  ,
endOnString  ,
endonString2  ,
endonString3  ,
endonString4   
)

◆ waitRespawnButton()

function waitRespawnButton ( )

Definition at line 76 of file _util.gsc.

◆ waittill_use_button_pressed()

function waittill_use_button_pressed ( )

Description:
"Function Name: waittill_use_button_pressed()"
"Summary: Waits until the player is pressing their use button." "Module: Player"
"Example:level.player waittill_use_button_pressed()"
"Single Player / Multi Player: SP"

Definition at line 1024 of file _util.gsc.

References use_button_pressed().

◆ warning()

function warning ( msg  )

Definition at line 38 of file _util.gsc.

Referenced by get_align_ent(), and GetFirstAvailableOffsetIndex().

◆ 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's 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 56 of file _util.gsc.

Referenced by apothiconCanBamfInternal(), apothiconCanJuke(), back_to_near_owner_check(), Callback_PlayerKilled(), is_point_in_view(), RunBamfReAdjustmentAnalysis(), and should_go_to_near_owner().