Page tree
Skip to end of metadata
Go to start of metadata


Introduced in

Version:3.5

Description

Description:

Sets the fuse behavior for a specific weapon (when a projectile detonates by itself, relative to its launch).

The fuse can be time- or distance-based, and only has an effect, if the respective weapon / turret and ammunition have the appropriate fuse mode  parameter set (either "distance", "timed", or both).

Syntax

Syntax:[unit, weapon, muzzle] setAmmoMode [magazine, mode, setting]
Parameters:
  • unit: Object - Unit, whose weapon is set.
  • weapon: String - Class name of the weapon to set.
  • muzzle: String - Class name of the muzzle to set (optional, default: all muzzles) (V3.6+).
  • magazine: String - Class name of the magazine to set (only affects the current magazine - or the next one, if the current one is empty).
  • mode: String - Fuse mode. Can be:
    • "initSpeed": Set the speed of the next round (applies to only one round) (V3.8.2+).
    • "distance": Detonate after traversed distance, defined in setting .
    • "timed": Detonate after time elapsed, defined in setting .
    • "default": Use weapon defaults.
  • setting: Number - Fuse property. Either meters or seconds, depending on the selected mode.
Return Value:Nothing

Alternative Syntax

Syntax:[vehicle, turret, weapon, muzzle] setAmmoMode [magazine, mode, setting]
Parameters:
  • vehicle: Object - Vehicle, whose turret is set.
  • turret: Array - Path of the turret to set.
  • muzzle: String - Class name of the muzzle to set (optional, default: all muzzles) (V3.6+).
  • weapon: String - Class name of the weapon to set.
  • magazine: String - Class name of the magazine to set (only affects the current magazine - or the next one, if the current is empty).
  • mode: String - Fuse mode. Can be:
    • "initSpeed": Set the speed of the next round (applies to only one round) (V3.8.2+).
    • "distance": Detonate after traversed distance, defined in setting.
    • "timed": Detonate after time elapsed, defined in setting.
    • "default": Use weapon defaults.
  • setting: Number - Fuse property. Either meters or seconds, depending on the selected mode.
Return Value:Nothing

Alternative Syntax

Syntax:

[projectile] setAmmoMode [mode, setting]

Parameters:

  • projectile: Object - Projectile in flight to set the mode for.
  • mode: String - Fuse mode. Can be:
    • "distance": Detonate after traversed distance, defined in setting.
    • "timed": Detonate after time elapsed, defined in setting.
    • "default": Use weapon defaults.
  • setting: Number - Fuse property. Either meters or seconds, depending on the selected mode.

Return Value:

Nothing

Examples

Examples:

Launcher rocket detonates after 700 meters:
[player, "vbs2_CarlGustavM3"] setAmmoMode ["vbs2_mag_CarlGustavM3_HEPF", "distance", 700]

Rocket from turret [0] detonates after 3.4 seconds:
[vehicle player, [0], "vbs_boforsl70_cv90"] setAmmoMode ["vbs2_ammo_B_40mm_HEPF", "timed", 3.4]

Return to default behavior:
[player, "vbs2_CarlGustavM3"] setAmmoMode ["vbs2_mag_CarlGustavM3_HEPF", "default"]

Change muzzle speed of mortar round:
[V01, [0], "vbs2_mortar_m252_81mm"] setAmmoMode ["vbs_mag_1rnd_Sh_81_HE_m821", "initSpeed", 141]

Proximity fuse activated after 0.3 seconds of flight:
_proximityFuseEH = tank addEventHandler ["fired", {delayCall [0.3, {_this setAmmoMode ["proximity", 10]}, [_this select 6], false]}];

Additional Information

See also: getAmmoMode
Multiplayer:
Problems:

Notes





Since 3.8.0 there is another syntax option which works on objects ex:


myAmmo = "vbs2_ammo_sh_80m_HE" createVehicle getPosASL2 target; [myAmmo] setAmmoMode ["proximity", 10];