Spawning Flares
Flares—despite living under Arma 3's configFile >> "CfgAmmo" configuration section—can be spawned in using the SQF createVehicle command:
createVehicle ["F_40mm_White", [1200, 2000, 200], [], 0, "none"];
The above snippet works, but unlike a launched flare, the flare will remain stationary in the sky rather than falling. Flares use a simplified simulation (shotIlluminating) that assumes the flare entity has been fired from a weapon.
The trick for getting a falling flare is to set the velocity slightly upwards, and into the direction of the wind:
private _position = getPos player vectorAdd [0, 0, 220]; private _flare = createVehicle ["F_40mm_White", _position, [], 0, "none"]; _flare setVelocity [wind select 0, wind select 1, 30];
Flare Class Names
The full list of flares available in a particular set of Arma 3 addons can be copied to the clipboard with the following snippet:
private _classes = "getText (_x >> 'simulation') == 'shotIlluminating'" configClasses (configFile >> "CfgAmmo"); private _classesText = _classes apply { configName _x } joinString toString [13, 10]; copyToClipboard _classesText;
For vanilla Arma 3, the list of flare classes is:
- F_20mm_Green
- F_20mm_Green_Infinite
- F_20mm_Red
- F_20mm_Red_Infinite
- F_20mm_White
- F_20mm_White_Infinite
- F_20mm_Yellow
- F_20mm_Yellow_Infinite
- F_40mm_Cir
- F_40mm_Cir_Infinite
- F_40mm_Green
- F_40mm_Green_Infinite
- F_40mm_Red
- F_40mm_Red_Infinite
- F_40mm_White
- F_40mm_White_Infinite
- F_40mm_Yellow
- F_40mm_Yellow_Infinite
- F_Signal_Green
- F_Signal_Red
- FlareBase
- FlareCore
- Flare_82mm_AMOS_White