GSC reference › Built-in
GetEntArrayFromArray()
Built-in (engine)
Server
Searches given array entities by key and name and a return an array of the matched entities
Signature
GetEntArrayFromArray(<array>, <name>, <key>)
Parameters
| Name | Required? | Details |
|---|---|---|
| array | Required | array of entities |
| name | Required | name to search for |
| key | Required | key that name goes with |
Returns
entity
Example (from Treyarch's docs)
spawners = GetEntArrayFromArray( array, "doorguy1", "targetname" )
Real uses in BO3's scripts
Called 16 times in the decompiled scripts. A few, zombies first:
- scripts/zm/zm_genesis_portals.gsc, line 310
var_ebfa395 = getentarrayfromarray(a_t_portal_top, "teleport_trigger", "targetname"); - scripts/zm/zm_genesis_portals.gsc, line 311
var_a70f04bd = getentarrayfromarray(a_t_portal_top, "teleport_clip", "targetname"); - scripts/zm/zm_island_portals.gsc, line 232
var_ebfa395 = getentarrayfromarray(a_t_portal_top, "teleport_trigger", "targetname"); - scripts/zm/zm_zod_portals.gsc, line 220
var_ebfa395 = getentarrayfromarray(a_t_portal_top, "teleport_trigger", "targetname"); - scripts/cp/_training_sim.gsc, line 1269
a_spawners = getentarrayfromarray(a_spawners, self.var_bd5ad7fc, "prefabname");
Related built-ins
- GetEntArray()Looks up entities by key and name and a return an array of the matched entities
- GetDamageableEntArray()Returns the entities that can be damaged.
- getdynentarray()Get a dynent array with the specified targetname
- GetTargetLockEntityArray()Get locked target
- GetEntArrayByType()Gets an array of entities that have the given the type of the entity ( for example, ET_MISSILE )
- array()Create an array
- IsArray()Checks whether this entity/variable is an array
- ArrayRemoveValue()Remove a value from an array (may affect multiple indexes)
- GetAITeamArray()Returns an array of the human AI and vehicle AI
- GetArrayKeys()Returns an array consisting of the keys of the input array.
- ArrayCombine()Combine two arrays into and returns one new array
- IsInArray()Searches an array to determine if a given value is present in that array
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).