Explosives Functions

ace_explosives_fnc_addClacker

Description

Adds an explosive as a clacker item to the passed unit if the unit has the required item.

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT objNull
1 Explosive OBJECT objNull
2 Magazine classname STRING ””
3 Extra variables ARRAY []

Return Value

None

Example

[player, cursorObject, "SatchelCharge_Remote_Mag", [configFile >> "ACE_Triggers" >> "Command"]] call ace_explosives_fnc_addClacker

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_addDetonateHandler

Description

Add a explosive detonation handler. Should be called on all machines. Code needs to return BOOL: true (allowed) / false (blocked) See https://ace3.acemod.org/wiki/framework/explosives-framework.html for an example.

Parameters

Index Description Datatype(s) Default Value
0 Code CODE {true}

Return Value

None

Example

[{false}] call ace_explosives_fnc_addDetonateHandler

Authors

  • PabstMirror

ace_explosives_fnc_addToSpeedDial

Description

Sets the speed dial for the UI.

Parameters

Index Description Datatype(s) Default Value
0 Name of speed dial STRING ””
1 Code to add to speed dial STRING ””

Return Value

None

Example

["My Speed Dial", "2131"] call ace_explosives_fnc_addToSpeedDial

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_allowDefuse

Description

Sets if a dynamic defuse action is allowed to be added to a mine.

Parameters

Index Description Datatype(s) Default Value
0 Mine OBJECT objNull
1 Allow defusal BOOL true

Return Value

Description Datatype(s)
Success BOOL

Example

[cursorObject, false] call ace_explosives_fnc_allowDefuse

Authors

  • Walthzer

ace_explosives_fnc_canDefuse

Description

Whether a unit can perform the defuse action.

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT objNull
1 Interaction object or target explosive OBJECT objNull

Return Value

Description Datatype(s)
Able to defuse BOOL

Example

[player, cursorObject] call ace_explosives_fnc_canDefuse

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_canDetonate

Description

Whether the unit is able to detonate explosives.

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT objNull

Return Value

Description Datatype(s)
Able to detonate BOOL

Example

player call ace_explosives_fnc_canDetonate

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_connectExplosive

Description

Adds preplaced explosives to a unit’s detonator.

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT objNull
1 Explosive object OBJECT objNull
2 Detonator type STRING ””

Return Value

None

Example

[player, cursorObject, "ACE_Clacker"] call ace_explosives_fnc_connectExplosive

Authors

  • VKing

ace_explosives_fnc_defuseExplosive

Description

Causes the unit to defuse the passed explosive.

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT objNull
1 Explosive OBJECT objNull

Return Value

None

Example

[player, cursorObject] call ace_explosives_fnc_defuseExplosive

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_detonateExplosive

Description

Causes the unit to detonate the passed explosive.

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT objNull
1 Max range (-1 to ignore) NUMBER 0
2 Item ARRAY []
0 Explosive OBJECT objNull
1 Fuse time NUMBER 0
3 Trigger item classname STRING “#unknown”

Return Value

Description Datatype(s)
If explosive was successfully detonated BOOL

Example

[player, 100, [cursorObject, 1], "ACE_Clacker"] call ace_explosives_fnc_detonateExplosive; // has to be within range
[player, -1, [cursorObject, 1], "ACE_Cellphone"] call ace_explosives_fnc_detonateExplosive; // range ignored

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_dialPhone

Description

Dials the number passed and detonates the explosive.

Parameters

Index Description Datatype(s) Default Value
0 Unit to do dialing OBJECT objNull
1 Code to dial STRING ””

Return Value

None

Example

[player, "2131"] call ace_explosives_fnc_dialPhone

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_getDetonators

Description

Returns all detonators the given unit has.

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT objNull

Return Value

Description Datatype(s)
Config names of detonators ARRAY

Example

player call ace_explosives_fnc_getDetonators

Authors

  • Garth ‘L-H’ de Wet
  • mharis001

ace_explosives_fnc_getPlacedExplosives

Description

Gets all placed explosives by unit, optionally filtered by specific trigger type.

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT objNull
1 Trigger classname to filter by STRING ””

Return Value

Description Datatype(s)
Explosives ARRAY

Example

_allExplosives = player call ace_explosives_fnc_getPlacedExplosives
_deadmanExplosives = [player, "DeadManSwitch"] call ace_explosives_fnc_getPlacedExplosives

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_getSpeedDialExplosive

Description

Gets the explosive from the speed dial entry.

Parameters

Index Description Datatype(s) Default Value
0 Speed dial entry STRING  

Return Value

Description Datatype(s)
Associated explosive ARRAY

Example

"2113" call ace_explosives_fnc_getSpeedDialExplosive

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_hasExplosives

Description

Checks if given unit has any placeable explosives on them.

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT  

Return Value

Description Datatype(s)
Has explosives BOOL

Example

player call ace_explosives_fnc_hasExplosives

Authors

  • Garth ‘L-H’ de Wet
  • mharis001

ace_explosives_fnc_hasPlacedExplosives

Description

Whether the passed unit has placed any explosives or has a clacker that was used when explosives were placed.

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT  

Return Value

Description Datatype(s)
If unit has explosives BOOL

Example

player call ace_explosives_fnc_hasPlacedExplosives

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_isAllowedDefuse

Description

Check if a mine is allowed to receive a dynamic defuse action.

Parameters

Index Description Datatype(s) Default Value
0 Mine OBJECT  

Return Value

Description Datatype(s)
Allowed to defuse BOOL

Example

cursorObject call ace_explosives_fnc_isAllowedDefuse

Authors

  • Walthzer

ace_explosives_fnc_placeExplosive

Description

Places an explosive at the requested position.

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT objNull
1 Position ATL to place explosive ARRAY [0, 0, 0]
2 Rotation NUMBER 0
3 Magazine class STRING ””
4 Config of trigger STRING ””
5 Variables required for the trigger type ARRAY []
6 Explosive placeholder OBJECT objNull

Return Value

Description Datatype(s)
Placed explosive OBJECT

Example

[player, player modelToWorldVisual [0, 0.5, 0.1], 134, "SatchelCharge_Remote_Mag", "Command", []] call ace_explosives_fnc_placeExplosive

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_removeFromSpeedDial

Description

Removes the specified speed dial from unit’s speed dial.

Parameters

Index Description Datatype(s) Default Value
0 Speed dial name STRING  

Return Value

None

Example

"IED 1" call ace_explosives_fnc_removeFromSpeedDial

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_scriptedExplosive

Description

Detonate explosives via script, for use in triggers or mission scripts to detonate editor-placed explosives.

Parameters

Index Description Datatype(s) Default Value
0 Explosives objects to detonate OBJECT or ARRAY of OBJECTs []
1 Fuse delay (for all explosives; use negative number for random time up to value) NUMBER 0
2 Trigger Item Classname STRING “#scripted”

Return Value

None

Example

[[charge1, charge2, charge3], -1] call ace_explosives_fnc_scriptedExplosive
[[claymore1, claymore2]] call ace_explosives_fnc_scriptedExplosive

Authors

  • VKing

ace_explosives_fnc_setupExplosive

Description

Starts the setup process for the passed explosive. Player only.

Parameters

Index Description Datatype(s) Default Value
0 Target (not used) OBJECT  
1 Unit OBJECT objNull
2 Magazine classname of explosive to place STRING ””

Return Value

None

Example

[objNull, player, "SatchelCharge_Remote_Mag"] call ace_explosives_fnc_setupExplosive

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_startDefuse

Description

Starts defusing an explosive.

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT objNull
1 Interaction object or target explosive OBJECT objNull

Return Value

None

Example

[player, cursorObject] call ace_explosives_fnc_startDefuse

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_startTimer

Description

Starts a timer for an explosive.

Parameters

Index Description Datatype(s) Default Value
0 Explosive OBJECT objNull
1 Time until detonation NUMBER 0
2 Trigger classname STRING “#timer”
3 Unit OBJECT objNull

Return Value

None

Example

[cursorObject, 10] call ace_explosives_fnc_startTimer

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_triggerType

Description

Gets the types of triggers associated with the explosive.

Parameters

Index Description Datatype(s) Default Value
0 Explosive magazine STRING  

Return Value

Description Datatype(s)
Supported triggers as ACE_Triggers config entries ARRAY

Example

"SatchelCharge_Remote_Mag" call ace_explosives_fnc_triggerType

Authors

  • Garth ‘L-H’ de Wet