GSC reference › Built-in
ArrayGetFarthest()
Built-in (engine)
Server + client
Utility
Returns the entity/vector that is farthest to the <origin> from the <array>.
Signature
ArrayGetFarthest(<origin>, <array>, [dist])
Parameters
| Name | Required? | Details |
|---|---|---|
| origin | Required | The origin to get farthest from |
| array | Required | The array to search in |
| dist | Optional | The maximum distance when finding farthest (has to be positive) |
Returns
Returns the entity/vector that is farthest to the <origin> from the <array>.
Example (from Treyarch's docs)
ent = ArrayGetFarthest( player.origin, a_enemies )
Real uses in BO3's scripts
Called 5 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm_ai_thrasher.gsc, line 668
var_72436e1a = arraygetfarthest(v_pos, a_v_points); - scripts/zm/zm_island.gsc, line 1361
var_18130313 = arraygetfarthest(v_player_pos, var_144498b3); - scripts/zm/zm_stalingrad.gsc, line 1130
s_player_respawn = arraygetfarthest(self.origin, var_40d229f9); - scripts/zm/zm_stalingrad.gsc, line 1153
s_player_respawn = arraygetfarthest(self.origin, var_5381866c); - scripts/cp/cp_doa_bo3_enemy.gsc, line 1538
goal = arraygetfarthest(self.origin, spots);
Related built-ins
- GetDvarInt()Gets the value of a dvar.
- GetDvarString()Gets the value of a dvar.
- GetDvarFloat()Gets the value of a dvar.
- GetArrayKeys()Returns an array consisting of the keys of the input array.
- ArrayGetClosest()Returns the entity/vector that is closest to the <origin> from the <array>.
- GetSubStr()Returns the substring of characters >= <start index> and < <end index>.
- GetServerTime()Returns the time according to the server
- GetItemIndexFromRef()Returns the item index for the specified item reference
- GetSystemTime()Returns the time of the system in a vector where the 0 index is hours (in 24hr time), 1 is minutes, and 2 is seconds
- GetMapCenter()Returns the map center
- GetAttachmentTableIndex()Returns the attachment table index for the attachment name
- GetDvarVector()Gets the value of a dvar.
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).