GSC reference › Built-in
ArrayRemoveIndex()
Built-in (engine)
Server + client
Utility
Remove a value from an array at a given index
Signature
ArrayRemoveIndex(<array>, <index>, [preserve_keys])
Parameters
| Name | Required? | Details |
|---|---|---|
| array | Required | array to operate on |
| index | Required | index of value to remove |
| preserve_keys | Optional | defaults to false, if true then it preserves the keys - otherwise creates integer keys |
Real uses in BO3's scripts
Called 99 times in the decompiled scripts. A few, zombies first:
- scripts/zm/_zm_ai_wasp.gsc, line 308
arrayremoveindex(a_spawn_origins, i); - scripts/zm/_zm_ai_wasp_no_idgun.gsc, line 307
arrayremoveindex(a_spawn_origins, i); - scripts/zm/_zm_altbody_beast.csc, line 693
arrayremoveindex(array, key, 0); - scripts/zm/_zm_behavior.gsc, line 774
arrayremoveindex(level.move_away_points.data, i, 0); - scripts/zm/_zm_utility.gsc, line 1531
arrayremoveindex(zombie_poi.attractor_array, i);
Related built-ins
- ArrayRemoveValue()Remove a value from an array (may affect multiple indexes)
- GetItemIndexFromRef()Returns the item index for the specified item reference
- GetAttachmentTableIndex()Returns the attachment table index for the attachment name
- SetUkkoScriptIndex()Set ukko index from script.
- Target_Remove()Removes a target
- FindStaticModelIndexArray()Returns an array indices of a static model whose name matches the passed in string
- GetBaseWeaponItemIndex()Returns the base weapon item index from the statstable
- GetAttachmentCosmeticVariantIndexes()Get the AttachmentCosmeticVariantIndexes data to be passed in to GetWeapon
- GetLoadoutGunSmithVariantIndex()Get the GunSmith Variant index of the primary weapon, pass 1 as an option to get the secondary
- WeaponLockRemoveSlot()Removes the given slot values and compresses the remaining slots (i.e.
- GetEquippedHeroIndex()Returns the index of the equipped hero for the client
- FindVolumeDecalIndexArray()Returns an array indices of a volume decal whose targetname matches the passed in string
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).