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

Go to the source code of this file.

Macros

#define MAX_OCCUPY_NO_TARGET_TIME   3600
 
#define NEARBY_DISTANCE_SQ   SQR( 300 )
 
#define NEARBY_DISTANCE_Z   60
 
#define NEARBY_ENEMY_TIME   1000
 
#define TURRET_LOSE_SIGHT_TIME   3000
 
#define TURRET_TRACE_OFFSET   50
 

Functions

function __init__ ()
 
function _burst_fire (n_max_time, n_index)
 
function _check_for_paused (n_index)
 
function _debug_turret_think (n_index)
 
function _did_turret_lose_target (n_time_now)
 
function _drop_turret (n_index, bExitIfAutomatedOnly)
 
function _get_any_priority_targets (n_index)
 
function _get_best_target_bullet (a_potential_targets, n_index)
 
function _get_best_target_from_potential (a_potential_targets, n_index)
 
function _get_best_target_gas (a_potential_targets, n_index)
 
function _get_best_target_grenade (a_potential_targets, n_index)
 
function _get_best_target_projectile (a_potential_targets, n_index)
 
function _get_burst_fire_time (n_index)
 
function _get_burst_wait_time (n_index)
 
function _get_default_target_offset (e_target, n_index)
 
function _get_gunner_tag_for_turret_index (n_index)
 
function _get_potential_targets (n_index)
 
function _get_turret_data (n_index)
 
function _get_turret_index_for_tag (str_tag)
 
function _has_nearby_player_enemy (index, turret)
 
function _has_target_flags (n_flags, n_index)
 
function _index (n_index)
 
function _init_turret (n_index=0)
 
function _init_vehicle_turret (n_index)
 
function _is_target_within_range (e_target, s_turret)
 
function _listen_for_damage_on_actor (ai_user, n_index)
 
function _set_turret_needs_user (n_index, b_needs_user)
 
function _shoot_turret_at_target (e_target, n_time, v_offset, n_index, b_just_once)
 
function _turret_new_user_think (n_index)
 
function _turret_think (n_index, v_offset)
 
function _turret_user_think (n_index)
 
function _update_turret_arcs (n_index)
 
function _user_check (n_index)
 
function _wait_for_current_user_to_finish (n_index)
 
function _waittill_turret_on_target (e_target, n_index)
 
function _waittill_user_change (n_index)
 
function add_priority_target (ent_or_ent_array, n_index)
 
function can_hit_target (e_target, n_index)
 
function clear_ignore_ent_array (n_index)
 
function clear_target (n_index)
 
function clear_target_ent_array (n_index)
 
function disable (n_index)
 
function disable_ai_getoff (n_index, b_disable=true)
 
function does_have_target (n_index)
 
function does_have_user (n_index)
 
function does_need_user (n_index)
 
function emp_watcher (n_index)
 
function enable (n_index, b_user_required, v_offset)
 
function enable_auto_use (b_enable=true)
 
function enable_emp (b_enable, n_index)
 
function enable_laser (b_enable, n_index)
 
function fire (n_index)
 
function fire_for_time (n_time, n_index=0)
 
function get_parent (n_index)
 
function get_target (n_index)
 
function get_team (n_index)
 
function get_user (n_index)
 
function get_weapon (n_index=0)
 
function has_turret (n_index)
 
function is_current_user (ai_user, n_index)
 
function is_target (e_target, n_index)
 
function is_target_in_view (v_target, n_index)
 
function is_turret_enabled (n_index)
 
function laser_death_watcher ()
 
function pause (time, n_index)
 
function set_best_target_func (func_get_best_target, n_index)
 
function set_best_target_func_from_weapon_type (n_index)
 
function set_burst_parameters (n_fire_min, n_fire_max, n_wait_min, n_wait_max, n_index)
 
function set_ignore_ent_array (a_ents, n_index)
 
function set_ignore_line_of_sight (b_ignore, n_index)
 
function set_max_target_distance (n_distance, n_index)
 
function set_min_target_distance (n_distance, n_index)
 
function set_min_target_distance_squared (n_distance_squared, n_index)
 
function set_occupy_no_target_time (time, n_index)
 
function set_on_target_angle (n_angle, n_index)
 
function set_target (e_target, v_offset, n_index)
 
function set_target_ent_array (a_ents, n_index)
 
function set_target_flags (n_flags, n_index)
 
function set_target_leading (n_index, n_target_leading_factor=0.1)
 
function set_team (str_team, n_index)
 
function set_torso_targetting (n_index, n_torso_targetting_offset=(-12))
 
function shoot_at_target (e_target, n_time, v_offset, n_index, b_just_once)
 
function shoot_at_target_once (e_target, v_offset, n_index)
 
function stop (n_index, b_clear_target=false)
 
function toggle_lensflare (bool)
 
function trace_test (e_target, v_offset=(0, 0, 0), n_index)
 
function track_lens_flare ()
 
function unpause (n_index)
 
function watch_for_flash ()
 
function watch_for_flash_and_stun (n_index)
 

Macro Definition Documentation

◆ MAX_OCCUPY_NO_TARGET_TIME

#define MAX_OCCUPY_NO_TARGET_TIME   3600

Definition at line 211 of file turret_shared.gsc.

◆ NEARBY_DISTANCE_SQ

#define NEARBY_DISTANCE_SQ   SQR( 300 )

Definition at line 1360 of file turret_shared.gsc.

◆ NEARBY_DISTANCE_Z

#define NEARBY_DISTANCE_Z   60

Definition at line 1361 of file turret_shared.gsc.

◆ NEARBY_ENEMY_TIME

#define NEARBY_ENEMY_TIME   1000

Definition at line 1362 of file turret_shared.gsc.

◆ TURRET_LOSE_SIGHT_TIME

#define TURRET_LOSE_SIGHT_TIME   3000

Definition at line 1231 of file turret_shared.gsc.

◆ TURRET_TRACE_OFFSET

#define TURRET_TRACE_OFFSET   50

Description:
"Function Name: can_turret_shoot_target( e_target, n_index )"
"Summary: Basically is there anythinhg blocking the turrets shot (geo etc..)"


"Mandatory Argument(s): <e_target> Target the Turret wats to fire at"
"Optional Argument(s): [v_offset] Optional offset"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:vh_heli can_turret_shoot_target( e_guy, 1 );"

Definition at line 2533 of file turret_shared.gsc.

Function Documentation

◆ __init__()

function __init__ ( )

Definition at line 213 of file turret_shared.gsc.

References register(), and VERSION_SHIP.

◆ _burst_fire()

function _burst_fire ( n_max_time  ,
n_index   
)

◆ _check_for_paused()

function _check_for_paused ( n_index  )

Definition at line 1498 of file turret_shared.gsc.

References _get_turret_data(), and WAIT_SERVER_FRAME.

Referenced by _turret_think().

◆ _debug_turret_think()

function _debug_turret_think ( n_index  )

◆ _did_turret_lose_target()

function _did_turret_lose_target ( n_time_now  )

Definition at line 1406 of file turret_shared.gsc.

References IS_TRUE, and TURRET_LOSE_SIGHT_TIME.

Referenced by _turret_think().

◆ _drop_turret()

function _drop_turret ( n_index  ,
bExitIfAutomatedOnly   
)

Definition at line 1524 of file turret_shared.gsc.

References get_out(), get_user(), and IS_TRUE.

Referenced by _turret_think(), and disable().

◆ _get_any_priority_targets()

function _get_any_priority_targets ( n_index  )

Definition at line 2297 of file turret_shared.gsc.

References _get_turret_data(), e_target, and is_dead_sentient().

Referenced by _get_potential_targets().

◆ _get_best_target_bullet()

function _get_best_target_bullet ( a_potential_targets  ,
n_index   
)

◆ _get_best_target_from_potential()

function _get_best_target_from_potential ( a_potential_targets  ,
n_index   
)

Definition at line 2365 of file turret_shared.gsc.

References _get_turret_data().

Referenced by _turret_think().

◆ _get_best_target_gas()

function _get_best_target_gas ( a_potential_targets  ,
n_index   
)

Definition at line 2396 of file turret_shared.gsc.

References _get_best_target_bullet().

Referenced by set_best_target_func_from_weapon_type().

◆ _get_best_target_grenade()

function _get_best_target_grenade ( a_potential_targets  ,
n_index   
)

Definition at line 2402 of file turret_shared.gsc.

References _get_best_target_bullet().

Referenced by set_best_target_func_from_weapon_type().

◆ _get_best_target_projectile()

function _get_best_target_projectile ( a_potential_targets  ,
n_index   
)

Definition at line 2408 of file turret_shared.gsc.

References _get_best_target_bullet().

Referenced by set_best_target_func_from_weapon_type().

◆ _get_burst_fire_time()

function _get_burst_fire_time ( n_index  )

Definition at line 2021 of file turret_shared.gsc.

References _get_turret_data().

Referenced by _burst_fire().

◆ _get_burst_wait_time()

function _get_burst_wait_time ( n_index  )

Definition at line 2052 of file turret_shared.gsc.

References _get_turret_data().

Referenced by _burst_fire().

◆ _get_default_target_offset()

function _get_default_target_offset ( e_target  ,
n_index   
)

◆ _get_gunner_tag_for_turret_index()

function _get_gunner_tag_for_turret_index ( n_index  )

Definition at line 2677 of file turret_shared.gsc.

Referenced by _init_vehicle_turret().

◆ _get_potential_targets()

◆ _get_turret_data()

◆ _get_turret_index_for_tag()

function _get_turret_index_for_tag ( str_tag  )

Definition at line 2689 of file turret_shared.gsc.

◆ _has_nearby_player_enemy()

function _has_nearby_player_enemy ( index  ,
turret   
)

Definition at line 1363 of file turret_shared.gsc.

References get_user(), NEARBY_DISTANCE_SQ, NEARBY_DISTANCE_Z, and NEARBY_ENEMY_TIME.

Referenced by _turret_think().

◆ _has_target_flags()

function _has_target_flags ( n_flags  ,
n_index   
)

Definition at line 825 of file turret_shared.gsc.

References _get_turret_data().

Referenced by _get_potential_targets().

◆ _index()

◆ _init_turret()

◆ _init_vehicle_turret()

function _init_vehicle_turret ( n_index  )

◆ _is_target_within_range()

function _is_target_within_range ( e_target  ,
s_turret   
)

Definition at line 2278 of file turret_shared.gsc.

References e_target, and VAL.

Referenced by _get_potential_targets().

◆ _listen_for_damage_on_actor()

function _listen_for_damage_on_actor ( ai_user  ,
n_index   
)

Definition at line 1454 of file turret_shared.gsc.

References _get_turret_data(), and _index().

Referenced by _turret_user_think().

◆ _set_turret_needs_user()

function _set_turret_needs_user ( n_index  ,
b_needs_user   
)

Definition at line 452 of file turret_shared.gsc.

References _get_turret_data(), and watch_for_flash_and_stun().

Referenced by _init_vehicle_turret(), and enable().

◆ _shoot_turret_at_target()

function _shoot_turret_at_target ( e_target  ,
n_time  ,
v_offset  ,
n_index  ,
b_just_once   
)

◆ _turret_new_user_think()

function _turret_new_user_think ( n_index  )

◆ _turret_think()

◆ _turret_user_think()

function _turret_user_think ( n_index  )

◆ _update_turret_arcs()

function _update_turret_arcs ( n_index  )

Definition at line 1826 of file turret_shared.gsc.

References _get_turret_data().

Referenced by _init_turret(), and is_target_in_view().

◆ _user_check()

function _user_check ( n_index  )

◆ _wait_for_current_user_to_finish()

function _wait_for_current_user_to_finish ( n_index  )

Definition at line 570 of file turret_shared.gsc.

References get_user().

◆ _waittill_turret_on_target()

function _waittill_turret_on_target ( e_target  ,
n_index   
)

Definition at line 1064 of file turret_shared.gsc.

References can_hit_target(), e_target, and VAL.

Referenced by _shoot_turret_at_target().

◆ _waittill_user_change()

function _waittill_user_change ( n_index  )

Definition at line 1478 of file turret_shared.gsc.

References _index(), and waittill_either().

Referenced by _turret_user_think().

◆ add_priority_target()

function add_priority_target ( ent_or_ent_array  ,
n_index   
)

Description:
"Function Name: add_priority_target( ent_or_ent_array, n_index )"
"Summary: Adds a single ent or array of ents to be a priority target of a turret"


"Mandatory Argument(s): <ent_or_ent_array> The ent or array of entity targets the turret should attack"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:claw_turret add_priority_target( a_balcony_guys )"

Definition at line 496 of file turret_shared.gsc.

References _get_turret_data().

◆ can_hit_target()

function can_hit_target ( e_target  ,
n_index   
)

Description:
"Function Name: can_hit_target( e_target, n_index )"
"Summary: Check bothif the target is within the turrets constaraints and theres is nothing blocking a LOS"


"Mandatory Argument(s): <e_target> Target the Turret wants to fire at"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:e_turret can_hit_target( e_guy, 1 );"

Definition at line 2425 of file turret_shared.gsc.

References _get_default_target_offset(), _get_turret_data(), e_target, is_target(), is_target_in_view(), IS_TRUE, trace_test(), and VAL.

Referenced by _get_best_target_bullet(), _waittill_turret_on_target(), and side_turret_get_best_target().

◆ clear_ignore_ent_array()

function clear_ignore_ent_array ( n_index  )

Description:
"Function Name: clear_ignore_ent_array( n_index )"
"Summary: Clears the turrets target array"


"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:clear_ignore_ent_array();"

Definition at line 564 of file turret_shared.gsc.

References _get_turret_data().

◆ clear_target()

function clear_target ( n_index  )

Description:
"Function Name: clear_target( n_index )"
"Summary: Clears turret target data for this turret"


"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:e_turret clear_target( n_index );"

Definition at line 791 of file turret_shared.gsc.

References _get_turret_data(), and clear().

Referenced by _turret_think(), disable(), get_target(), stop(), and TurretScanning().

◆ clear_target_ent_array()

function clear_target_ent_array ( n_index  )

Description:
"Function Name: clear_target_ent_array( n_index )"
"Summary: Clears the turrets target array"


"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:clear_target_ent_array();"

Definition at line 530 of file turret_shared.gsc.

References _get_turret_data().

◆ disable()

function disable ( n_index  )

Description:
"Function Name: disable( n_index )"
"Summary: Disables the given turret, But it keeps its targetted information"


"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:e_turret turret::disable();"

Definition at line 1167 of file turret_shared.gsc.

References _drop_turret(), _get_turret_data(), _index(), clear_target(), and is_turret_enabled().

◆ disable_ai_getoff()

function disable_ai_getoff ( n_index  ,
b_disable  = true 
)

Description:
"Function Name: disable_ai_getoff( n_index, b_disable = true )"
"Summary: Disable AIrom getting off the turret of lost sight of the player"

"CallOn: turret"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"
"Optional Argument(s): [b_disable] Set to 'true' to turn on (default), 'false' to turn off"


"Example:e_turret turret::disable_ai_getoff( 1, true )"

Definition at line 1153 of file turret_shared.gsc.

References _get_turret_data().

◆ does_have_target()

function does_have_target ( n_index  )

Definition at line 1618 of file turret_shared.gsc.

References _get_turret_data().

Referenced by _turret_new_user_think(), turret_laser_watch(), and TurretScanning().

◆ does_have_user()

function does_have_user ( n_index  )

Description:
"Function Name: does_have_user( n_index )"
"Summary: Checks to see if a turret has a user"


"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:if ( turret turret::does_have_user( n_index ) );"

Definition at line 432 of file turret_shared.gsc.

References get_user().

Referenced by _debug_turret_think(), and _user_check().

◆ does_need_user()

function does_need_user ( n_index  )

Description:
"Function Name: does_need_user( [n_index] )"
"Summary: Checks to see if a turret needs a user" "Module: Turret"
"Optional Argument(s): [n_index]: Index of the turret for a vehicle turret"
"Example:if ( does_need_user( n_index ) );"
"Single Player / Multi Player: singleplayer"

Definition at line 418 of file turret_shared.gsc.

References _get_turret_data(), and IS_TRUE.

Referenced by _debug_turret_think(), and _user_check().

◆ emp_watcher()

function emp_watcher ( n_index  )

Definition at line 318 of file turret_shared.gsc.

References _get_turret_data(), damage(), emped(), and stop().

Referenced by enable_emp().

◆ enable()

function enable ( n_index  ,
b_user_required  ,
v_offset   
)

Description:
"Function Name: enable( n_index, b_user_required, v_offset )"
"Summary: Enables the given turret"


"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"
"Optional Argument(s): [b_user_required] Determines if the turret require a user to fire"
"Optional Argument(s): [v_offset] Offset from the turret target"


"Example:e_turret turret::enable( 1 ); // enable gunner1"

Definition at line 1108 of file turret_shared.gsc.

References _get_turret_data(), _index(), _set_turret_needs_user(), _turret_think(), and is_turret_enabled().

◆ enable_auto_use()

function enable_auto_use ( b_enable  = true)

Description:
"Function Name: enable_auto_use( b_enable = true )"
"Summary: Enables a vehicle to automatically get AI turret users"

"CallOn: vehicle/turret"
"Optional Argument(s): [b_enable] Set to 'false' to turn off, 'true' to turn on (default)."


"Example:vh_truck turret::enable_auto_use( true )"

Definition at line 1137 of file turret_shared.gsc.

◆ enable_emp()

function enable_emp ( b_enable  ,
n_index   
)

Definition at line 356 of file turret_shared.gsc.

References _get_turret_data(), and emp_watcher().

◆ enable_laser()

function enable_laser ( b_enable  ,
n_index   
)

Definition at line 260 of file turret_shared.gsc.

References _get_turret_data(), and laser_death_watcher().

Referenced by turret_laser_watch().

◆ fire()

function fire ( n_index  )

Description:
"Function Name: fire( n_index )"
"Summary: Fires a turret"


"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:e_turret fire();"

Definition at line 889 of file turret_shared.gsc.

References _get_turret_data(), get_user(), and IS_TRUE.

Referenced by _burst_fire(), and _shoot_turret_at_target().

◆ fire_for_time()

function fire_for_time ( n_time  ,
n_index  = 0 
)

Description:
"Function Name: fire_for_time( n_time , n_index )"
"Summary: Fires a turret for a time, blocks for n_time"


"Mandatory Argument(s): <n_time> The time to fire the turret for"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:e_turret fire_for_time( 3 );"

Definition at line 953 of file turret_shared.gsc.

References _burst_fire(), _index(), and get_weapon().

Referenced by _shoot_turret_at_target(), attack_minigun_sweep(), Attack_Thread_Gun(), Attack_Thread_machinegun(), Attack_Thread_MainTurret(), set_movement_and_accel(), state_stationary_update(), and turretFireUpdate().

◆ get_parent()

function get_parent ( n_index  )

Description:
"Function Name: get_parent( n_index )"
"Summary: Gets a turret's parent"


"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:turret get_parent( n_index );"

Definition at line 244 of file turret_shared.gsc.

References _get_turret_data().

◆ get_target()

function get_target ( n_index  )

Description:
"Function Name: get_target( n_index )"
"Summary: Returns turret target data for this turret"


"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:has_target = isdefined( get_target( n_index ) );"

Definition at line 760 of file turret_shared.gsc.

References _get_turret_data(), clear_target(), e_target, and IS_TRUE.

Referenced by _debug_turret_think(), _get_best_target_quadtank_side_turret(), FindNewPosition(), is_target(), and side_turret_get_best_target().

◆ get_team()

function get_team ( n_index  )

◆ get_user()

function get_user ( n_index  )

Description:
"Function Name: get_user( n_index )"
"Summary: Gets the user of this turret"


"Optional Argument(s): [n_index]: Index of the turret for a vehicle turret"


"Example:ai_user = turret::get_user( n_index );"

Definition at line 447 of file turret_shared.gsc.

Referenced by _drop_turret(), _has_nearby_player_enemy(), _wait_for_current_user_to_finish(), does_have_user(), fire(), and is_current_user().

◆ get_weapon()

function get_weapon ( n_index  = 0)

Description:
"Function Name: get_weapon( n_index )"
"Summary: Gets a turret's weapon"


"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:turret get_weapon();"

Definition at line 229 of file turret_shared.gsc.

Referenced by _burst_fire(), _init_turret(), _turret_think(), and fire_for_time().

◆ has_turret()

function has_turret ( n_index  )

Definition at line 1756 of file turret_shared.gsc.

Referenced by FindNewPosition().

◆ is_current_user()

function is_current_user ( ai_user  ,
n_index   
)

Description:
"Function Name: is_current_user( ai_user, n_index )"
"Summary: Checks to see if an AI is the current user"


"Mandatory Argument(s): <ai_user> The user of this turret"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:if ( is_current_user( ai_user, n_index ) );"

Definition at line 590 of file turret_shared.gsc.

References get_user().

◆ is_target()

function is_target ( e_target  ,
n_index   
)

Definition at line 769 of file turret_shared.gsc.

References e_target, and get_target().

Referenced by _get_best_target_quadtank_side_turret(), and can_hit_target().

◆ is_target_in_view()

function is_target_in_view ( v_target  ,
n_index   
)

Description:
"Function Name: is_target_in_view( v_target, n_index )"
"Summary: Gets whether a turret's target is in view"


"Mandatory Argument(s): <e_target> Target the Turret wants to fire at"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:e_turret is_target_in_view( v_position, 1 );"

Definition at line 2469 of file turret_shared.gsc.

References _get_turret_data(), and _update_turret_arcs().

Referenced by can_hit_target().

◆ is_turret_enabled()

function is_turret_enabled ( n_index  )

Description:
"Function Name: is_turret_enabled( n_index )"
"Summary: Checks to see if a turret is enabled"


"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:if ( is_turret_enabled( n_index ) );"

Definition at line 404 of file turret_shared.gsc.

References _get_turret_data().

Referenced by disable(), and enable().

◆ laser_death_watcher()

function laser_death_watcher ( )

Definition at line 249 of file turret_shared.gsc.

Referenced by enable_laser().

◆ pause()

function pause ( time  ,
n_index   
)

Description:
"Function Name: pause( time, n_index )"
"Summary: Disables the given turret, But it keeps its targetted information"


"Mandatory Argument(s): <time> Time to pause turret for, 0 for infinite"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:e_turret turret::pause( 0 );"

Definition at line 1193 of file turret_shared.gsc.

References _get_turret_data(), and stop().

Referenced by last_stand_thread().

◆ set_best_target_func()

function set_best_target_func ( func_get_best_target  ,
n_index   
)

Description:
"Function Name: set_best_target_func( function, n_index )"
"Summary: Custom override function, scripter can use to custermise their choice from potential targets"


"Mandatory Argument(s): <function> Override target selection function"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:set_best_target_func(&_get_best_target_bullet, n_index );"

Definition at line 1871 of file turret_shared.gsc.

References _get_turret_data().

Referenced by hunter_initialize(), quadtank_initialize(), and set_best_target_func_from_weapon_type().

◆ set_best_target_func_from_weapon_type()

function set_best_target_func_from_weapon_type ( n_index  )

◆ set_burst_parameters()

function set_burst_parameters ( n_fire_min  ,
n_fire_max  ,
n_wait_min  ,
n_wait_max  ,
n_index   
)

Description:
"Function Name: set_burst_parameters( n_fire_min, n_fire_max, n_wait_min, n_wait_max, n_index )"
"Summary: Sets the burst parameters for a turret"


"Mandatory Argument(s): <n_fire_min> The minimum time to fire the turret for"
"Mandatory Argument(s): <n_fire_max> The maximum time to fire the turret for"
"Mandatory Argument(s): <n_wait_min> The minimum time to wait between firing"
"Mandatory Argument(s): <n_wait_max> The maximum time to wait between firing"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:turret set_burst_parameters( 1, 2, 3, 4 ); // slow burst firing"

Definition at line 609 of file turret_shared.gsc.

References _get_turret_data().

Referenced by hunter_initialize(), and quadtank_update_difficulty().

◆ set_ignore_ent_array()

function set_ignore_ent_array ( a_ents  ,
n_index   
)

Description:
"Function Name: set_ignore_ent_array( a_ents, n_index )"
"Summary: Sends a list of targets for the turret to ignore."


"Mandatory Argument(s): <a_ents> The Array of Targets you want the turret to IGNORE"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:set_ignore_ent_array( a_ents );"

Definition at line 548 of file turret_shared.gsc.

References _get_turret_data(), and a_ents.

◆ set_ignore_line_of_sight()

function set_ignore_line_of_sight ( b_ignore  ,
n_index   
)

Description:
"Function Name: set_ignore_line_of_sight( b_ignore, n_index )"
"Summary: Set whether a turret will ignore line of sight or not"


"Mandatory Argument(s): <b_ignore> bool to ignore line of sight or not"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:e_turret set_ignore_line_of_sight( true, 0 );"

Definition at line 2613 of file turret_shared.gsc.

References _get_turret_data().

◆ set_max_target_distance()

function set_max_target_distance ( n_distance  ,
n_index   
)

Description:
"Function Name: set_max_target_distance( n_distance )"
"Summary: Sets the maximum distance a target can be, ( NOTE: 0 or undefined == unlimited distance)"


"Mandatory Argument(s): <n_distance> The maximum distance a target can be, ( NOTE: 0 or undefined == unlimited distance )"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:e_vehicle set_max_target_distance( 2048, 1 );"

Definition at line 842 of file turret_shared.gsc.

References _get_turret_data().

Referenced by InitTurret(), and InitTurretVehicle().

◆ set_min_target_distance()

function set_min_target_distance ( n_distance  ,
n_index   
)

Description:
"Function Name: set_min_target_distance( n_distance )"
"Summary: Sets the minimum distance a target can be"


"Mandatory Argument(s): <n_distance> The minimum distance a target can be, below which is not considered a target ( NOTE: undefined == zero distance )"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:e_vehicle set_min_target_distance( 18, 1 );"

Definition at line 858 of file turret_shared.gsc.

References _get_turret_data().

◆ set_min_target_distance_squared()

function set_min_target_distance_squared ( n_distance_squared  ,
n_index   
)

Description:
"Function Name: set_min_target_distance_squared( n_distance )"
"Summary: Sets the minimum distance squared a target can be"


"Mandatory Argument(s): <n_distance> The minimum distance squared a target can be, below which is not considered a target ( NOTE: undefined == zero distance )"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:e_vehicle set_min_target_distance_squared( DistanceSquared( e_vehicle GetTagOrigin( "tag_flash" ), e_vehicle GetTagOrigin( "tag_barrel" ) ), 0 );"

Definition at line 874 of file turret_shared.gsc.

References _get_turret_data().

Referenced by InitTurret().

◆ set_occupy_no_target_time()

function set_occupy_no_target_time ( time  ,
n_index   
)

Description:
"Function Name: set_occupy_no_target_time( time, n_index )"
"Summary: How long an AI will stay inside a turret if there is no target, default = 2.0"


"Mandatory Argument(s): <time> time to occupy turret without a target"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:e_turret turret::set_occupy_no_target_time( 4 );"

Definition at line 2630 of file turret_shared.gsc.

References _get_turret_data().

◆ set_on_target_angle()

function set_on_target_angle ( n_angle  ,
n_index   
)

Description:
"Function Name: set_on_target_angle( n_angle, n_index )"
"Summary: Sets the angle at which the turret will be on target"


"Mandatory Argument(s): <n_angle> angle at which the turret will be on target"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:turret set_on_target_angle( 1, 5 ); // on target at 5 degrees from target position"

Definition at line 643 of file turret_shared.gsc.

References _get_turret_data().

Referenced by _init_turret(), InitTurret(), and InitTurretVehicle().

◆ set_target()

function set_target ( e_target  ,
v_offset  ,
n_index   
)

Description:
"Function Name: set_target( e_target, v_offset, n_index )"
"Summary: Sets the target of this turret"


"Mandatory Argument(s): <e_target> The target of this turret"
"Optional Argument(s): [v_offset] Offset from the turret target"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:e_turret set_target( e_target, v_offset, n_index );"

Definition at line 680 of file turret_shared.gsc.

References _get_default_target_offset(), _get_turret_data(), and e_target.

Referenced by _shoot_turret_at_target().

◆ set_target_ent_array()

function set_target_ent_array ( a_ents  ,
n_index   
)

Description:
"Function Name: set_target_ent_array( a_entities, n_index )"
"Summary: Sends a list of targets for the turret. NOTE - Sends notify when targets are all dead"


"Mandatory Argument(s): <a_targets> The Array of Targets you want the turret to destroy"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:set_target_ent_array( a_ents );"

Definition at line 480 of file turret_shared.gsc.

References _get_turret_data(), and a_ents.

◆ set_target_flags()

function set_target_flags ( n_flags  ,
n_index   
)

Description:
"Function Name: set_target_flags( n_flags, n_index )"
"Summary: Sets the flags for the types of targets the turret should pick"


"Mandatory Argument(s): <n_flags> The types of targets - currently supports TURRET_TARGET_AI, TURRET_TARGET_PLAYERS, TURRET_TARGET_DRONES, TURRET_TARGET_VEHICLES"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:e_bunker_turret set_target_flags( TURRET_TARGET_AI | TURRET_TARGET_PLAYERS, n_index );"

Definition at line 819 of file turret_shared.gsc.

References _get_turret_data().

Referenced by hunter_initialize().

◆ set_target_leading()

function set_target_leading ( n_index  ,
n_target_leading_factor  = 0.1 
)

Definition at line 626 of file turret_shared.gsc.

References _get_turret_data().

Referenced by OnPlaceTurret().

◆ set_team()

function set_team ( str_team  ,
n_index   
)

Definition at line 371 of file turret_shared.gsc.

References _get_turret_data().

Referenced by OnPlaceTurret().

◆ set_torso_targetting()

function set_torso_targetting ( n_index  ,
n_torso_targetting_offset  = ( -12 ) 
)

Definition at line 619 of file turret_shared.gsc.

References _get_turret_data().

Referenced by OnPlaceTurret().

◆ shoot_at_target()

function shoot_at_target ( e_target  ,
n_time  ,
v_offset  ,
n_index  ,
b_just_once   
)

Description:
"Function Name: shoot_at_target( e_target, n_time, v_offset, n_index )"
"Summary: Fires turret at given target"


"Mandatory Argument(s): <e_target> The target of this turret"
"Mandatory Argument(s): <n_time> The time to fire the turret for"
"Optional Argument(s): [v_offset] Offset from the turret target"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"
"Optional Argument(s): [b_just_once] Ignore the time parameter and just fire once"


"Example:self thread shoot_at_target( e_best_target, -1, undefined, n_index );"

Definition at line 1010 of file turret_shared.gsc.

References _get_turret_data(), _shoot_turret_at_target(), clear(), e_target, and set().

Referenced by shoot_at_target_once().

◆ shoot_at_target_once()

function shoot_at_target_once ( e_target  ,
v_offset  ,
n_index   
)

Description:
"Function Name: shoot_at_target_once( e_target, v_offset, n_index )"
"Summary: Fires turret at given target once"


"Mandatory Argument(s): <e_target> The target of this turret"
"Optional Argument(s): [v_offset] Offset from the turret target"
"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"


"Example:self thread shoot_at_target_once( e_best_target, undefined, n_index );"

Definition at line 1092 of file turret_shared.gsc.

References e_target, and shoot_at_target().

◆ stop()

function stop ( n_index  ,
b_clear_target  = false 
)

Description:
"Function Name: stop( n_index, b_clear_target )"
"Summary: Stops a turret"


"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"
"Optional Argument(s): [b_clear_target] Clears the turret target. default true."


"Example:e_turret stop();"

Definition at line 926 of file turret_shared.gsc.

References _get_turret_data(), _index(), clear(), and clear_target().

Referenced by _turret_think(), _turret_user_think(), emp_watcher(), pause(), and watch_for_flash_and_stun().

◆ toggle_lensflare()

function toggle_lensflare ( bool  )

Definition at line 2637 of file turret_shared.gsc.

References set().

Referenced by state_death_update(), and track_lens_flare().

◆ trace_test()

function trace_test ( e_target  ,
v_offset  = (0,0,0),
n_index   
)

◆ track_lens_flare()

function track_lens_flare ( )

◆ unpause()

function unpause ( n_index  )

Description:
"Function Name: unpause( n_index )"
"Summary: Disables the given turret, But it keeps its targetted information"


"Optional Argument(s): [n_index] Index of the turret for a vehicle turret"
"Example:e_turret turret::unpause();"

Definition at line 1225 of file turret_shared.gsc.

References _get_turret_data().

◆ watch_for_flash()

function watch_for_flash ( )

Definition at line 276 of file turret_shared.gsc.

Referenced by watch_for_flash_and_stun().

◆ watch_for_flash_and_stun()

function watch_for_flash_and_stun ( n_index  )

Definition at line 288 of file turret_shared.gsc.

References damage(), stop(), and watch_for_flash().

Referenced by _set_turret_needs_user().