GSC reference › Built-in
ArrayCombine()
Built-in (engine)
Server + client
Utility
Combine two arrays into and returns one new array
Signature
ArrayCombine(<array1>, <array2>, <allowdupes>, <preserve_keys>)
Parameters
| Name | Required? | Details |
|---|---|---|
| array1 | Required | array to operate on |
| array2 | Required | array to operate on |
| allowdupes | Required | if true then allow duplicate entries, otherwise prune them out when combining |
| preserve_keys | Required | if true then preserve the keys (only for string keys) otherwise renumber when combining |
Real uses in BO3's scripts
Called 257 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm.gsc, line 4108
level.zombie_spawners = arraycombine(level.zombie_spawners, a_spawners, 0, 0); - scripts/zm/_zm_ai_dogs.gsc, line 144
level.dog_spawners = arraycombine(level.dog_spawners, later_dogs, 1, 0); - scripts/zm/_zm_ai_napalm.gsc, line 611
zombies = arraycombine(zombies_axis, dogs, 0, 0); - scripts/zm/_zm_ai_raps.gsc, line 101
level.raps_spawners = arraycombine(level.raps_spawners, later_raps, 1, 0); - scripts/zm/_zm_ai_spiders.gsc, line 315
level.var_c7f0b45b = arraycombine(level.var_c38a4fee, var_c84b3c65, 1, 0);
Related built-ins
- CombineAngles()Returns angles b reoriented by angles a.
- array()Create an array
- Assert()Assert that the given statement is correct.
- GetDvarInt()Gets the value of a dvar.
- IsArray()Checks whether this entity/variable is an array
- GetDvarString()Gets the value of a dvar.
- ArrayRemoveValue()Remove a value from an array (may affect multiple indexes)
- GetDvarFloat()Gets the value of a dvar.
- IsSubStr()Returns true/false if <substring> is a substring of <string>.
- GetArrayKeys()Returns an array consisting of the keys of the input array.
- IsInArray()Searches an array to determine if a given value is present in that array
- StrTok()Tokenizes <string> by the delimiters <delim>.
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).