triggerAmmo: Difference between revisions

From Bohemia Interactive Community
m (Text replacement - "\| *(arg|eff|mp|serverExec|gr[0-9]) *= *(.*) * *\|([^=0-9]{12})" to "|$1=$2 |descr=$3")
mNo edit summary
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma3
|game1= arma3
|version1= 1.92


|1.92
|arg= local


|gr1= Object Manipulation
|gr1= Object Manipulation


|descr= Triggers a munition such as shells, bullets, missiles, rockets and bombs (''shotSubmunition/shotShell/shotBullet/shotMissile/shotRocket'') as if it did hit. If ammo uses submunition, then creation of submunition will be triggered.
|descr= Triggers a munition such as shells, bullets, missiles, rockets, mines and bombs (''shotSubmunition/shotShell/shotBullet/shotMissile/shotRocket'') as if it did hit.
If ammo uses submunition, then creation of submunition will be triggered. Since Arma 3 v 2.22 it is possible to manipulate mine timer, cook grenades and alter missile trigger distance.


|s1= [[triggerAmmo]] munition
|s1= [[triggerAmmo]] munition


|p1= munition: [[Object]]
|p1= munition: [[Object]]
Line 15: Line 17:
|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= <code>[[triggerAmmo]] bomb1</code>
|s2= [[triggerAmmo]] [munition, timeLeft, distanceLeft]
|s2since= arma3 2.22
|p21= munition: [[Object]] - ammo. If 'timeLeft' and 'distanceLeft' are not provided, the action is identical to the main syntax.
|p22= timeLeft: [[Number]] - (Optional) 'timeToExplosion' (see [[getShotInfo]]). Can only be set to <= relevant config value. Default: -1 - ignore.
|p23= distanceLeft: [[Number]] - (Optional) 'fuseDistanceLeft' (see [[getShotInfo]]). Can only be set to <= relevant config value. Default: -1 - ignore.


|seealso= [[getShotParents]] [[Arma 3: Event Handlers#Fired|"Fired" Event Handler]]
|r2= [[Nothing]]
 
|x1= <sqf>triggerAmmo bomb1;</sqf>
|x2= <sqf>player addEventHandler ["FiredMan", {triggerAmmo [_this select 6, 1]}]; // explodes handgrenade or sets smoke on smokegrenade 1 sec after the throw.</sqf>
 
|seealso= [[getShotParents]] [[Arma 3: Event Handlers#Fired|"Fired" Event Handler]]
}}
}}

Latest revision as of 13:53, 1 January 2026

Hover & click on the images for description

Description

Description:
Triggers a munition such as shells, bullets, missiles, rockets, mines and bombs (shotSubmunition/shotShell/shotBullet/shotMissile/shotRocket) as if it did hit. If ammo uses submunition, then creation of submunition will be triggered. Since Arma 3 v 2.22 it is possible to manipulate mine timer, cook grenades and alter missile trigger distance.
Groups:
Object Manipulation

Syntax

Syntax:
triggerAmmo munition
Parameters:
munition: Object
Return Value:
Nothing

Alternative Syntax

Syntax:
triggerAmmo [munition, timeLeft, distanceLeft]
Parameters:
munition: Object - ammo. If 'timeLeft' and 'distanceLeft' are not provided, the action is identical to the main syntax.
timeLeft: Number - (Optional) 'timeToExplosion' (see getShotInfo). Can only be set to <= relevant config value. Default: -1 - ignore.
distanceLeft: Number - (Optional) 'fuseDistanceLeft' (see getShotInfo). Can only be set to <= relevant config value. Default: -1 - ignore.
Return Value:
Nothing

Examples

Example 1:
triggerAmmo bomb1;
Example 2:
player addEventHandler ["FiredMan", {triggerAmmo [_this select 6, 1]}]; // explodes handgrenade or sets smoke on smokegrenade 1 sec after the throw.

Additional Information

See also:
getShotParents "Fired" Event Handler

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note