Explosives Functions

ace_explosives_fnc_canDetonate

Description

Whether the unit is able to detonate explosives

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT  

Return Value

Description Datatype(s)
Able to detonate BOOL

Example

if ([player] call ACE_Explosives_fnc_canDetonate) then { hint "Can Detonate"; };

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  

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_startDefuse

Description

Starts defusing an explosive

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT  
1 Target explosive OBJECT  

Return Value

None

Example

[player, ACE_Interaction_Target] call ACE_Explosives_fnc_StartDefuse;

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_connectExplosive

Description

Add preplaced explosives to a unit’s detonator.

Parameters

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

Return Value

None

Example

[player, claymore1, "ACE_Clacker"] call ace_explosives_fnc_connectExplosive

Authors

  • VKing

ace_explosives_fnc_placeExplosive

Description

Places an explosive at the requested position.

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT  
1 Position to place explosive POSITION  
2 Rotation NUMBER  
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

_explosive = [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_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  

Return Value

None

Example

[{false}] call ace_explosives_fnc_addDetonateHandler;

Authors

  • PabstMirror

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)
Configs of all detonators ARRAY

Example

_hasPlacedExplosives = [player] call ACE_Explosives_fnc_hasPlacedExplosives;

Authors

  • Garth ‘L-H’ de Wet

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_defuseExplosive

Description

Causes the unit to defuse the passed explosive.

Parameters

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

Return Value

None

Example

[player, ACE_Interaction_Target] call ACE_Explosives_fnc_defuseExplosive;

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_isAllowedDefuse

Description

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

Parameters

Index Description Datatype(s) Default Value
0 Mine OBJECT  

Return Value

Description Datatype(s)
Allowed BOOLEAN

Example

[_mine] call ace_explosives_fnc_isAllowedDefuse

Authors

  • Walthzer

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  
1 Allow defusal BOOL  

Return Value

Description Datatype(s)
Succes BOOLEAN

Example

[_mine, false] call ace_explosives_fnc_allowDefuse

Authors

  • Walthzer

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 (or ObjNull) OBJECT

Example

["2113"] call ace_explosives_fnc_getSpeedDialExplosive;

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  
1 Fuze delay (for each explosive; 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_dialPhone

Description

Dials the number passed and detonates the explosive.

Parameters

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

Return Value

None

Example

[ace_player,"2131"] call ACE_explosives_fnc_dialPhone;

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

ace_explosives_fnc_detonateExplosive

Description

Causes the unit to detonate the passed explosive.

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT  
1 Max range (-1 to ignore) NUMBER  
2 Explosive ARRAY  
0 Explosive OBJECT  
1 Fuse time NUMBER  
3 Trigger Item Classname STRING  

Return Value

None

Example

[player, 100, [Explosive, 1], "ACE_Clacker"] call ACE_Explosives_fnc_detonateExplosive; // has to be within range
[player, -1, [Explosive, 1], "ACE_Cellphone"] call ACE_Explosives_fnc_detonateExplosive; // range ignored.

Authors

  • Garth ‘L-H’ de Wet

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  
1 Trigger classname - filter (optional) 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_canDefuse

Description

Whether a unit can perform the defuse action

Parameters

Index Description Datatype(s) Default Value
0 Unit OBJECT  
1 Target (ACE_DefuseObject) OBJECT  

Return Value

Description Datatype(s)
Able to defuse BOOL

Example

if ([player] call ACE_Explosives_fnc_canDefuse) then {hint "Can Defuse";};

Authors

  • Garth ‘L-H’ de Wet

ace_explosives_fnc_setupExplosive

Description

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

Parameters

Index Description Datatype(s) Default Value
0 Vehicle OBJECT  
1 Player Unit OBJECT  
2 Classname of explosive to place. (CfgMagazine class) STRING  

Return Value

None

Example

[player, "SatchelCharge_Remote_Mag"] call ACE_Explosives_fnc_SetupExplosive;

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_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  
1 Explosive OBJECT  
2 Magazine classname STRING  
3 Extra variables ARRAY  

Return Value

None

Example

[player, _explosive, "SatchelCharge_Remote_Mag", [ConfigFile >> "ACE_Triggers" >> "Command"]] call ACE_Explosives_fnc_addClacker;

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  
1 Time till detonate NUMBER  
2 Trigger classname STRING “#timer”
3 Unit OBJECT  

Return Value

None

Example

[_explosive, 10] call ace_explosives_fnc_startTimer

Authors

  • Garth ‘L-H’ de Wet