ACE3/docs/wiki/framework/grenades-framework.md
Oliver Blanthorn c012941af0 Add support for N-bangs (#6848)
* Add support for multi-bang flashbangs

It also adds some randomness to 1-bangs as a side effect,
but I don't think that's a big deal.

Also adds flashbang documentation to wiki.

* Increase rate at which flashbang attenuates

Apologies for the magic numbers. I just tested a few out
until I was happy with the result. The radius could probably
afford to be reduced a little further.

* use max deviation in config, fix wiki file name
2019-05-11 23:43:32 -05:00

3.0 KiB

layout title description group parent order mod version
wiki Grenades Framework Explains how to set-up flashbangs, particularly multi-bangs. framework wiki 7 ace
major minor patch
3 13 0

1. Overview

ACE provides a simple interface for creating flashbang grenades and specifying their properties. It is important that one sets timeToLive to be greater than the total possible time until the last explosion, i.e, ace_grenades_flashbangBangs * ace_grenades_flashbangInterval + ace_grenades_flashbangIntervalMaxDeviation. Any explosions that occur after the timeToLive has expired will occur at (0,0).

2. Config Values

There are several config entries specific to ACE flashbangs. All successive values can be left undefined and they will be given the defaults shown in the first example below, with the exception of ace_grenades_flashbang, which is equal to 0 if left undefined.

class CfgAmmo {
    class MyDefaultFlashbang {
        ace_grenades_flashbang = 1;                         // A flashbang
        ace_grenades_flashbangBangs = 1;                    // with one bang
        ace_grenades_flashbangInterval = 0.5;               // 0.5 seconds between each subsequent bang
        ace_grenades_flashbangIntervalMaxDeviation = 0.1;   // Deviation of up to ± 0.1 seconds on each fuse
    };
    class ACE_G_M84 {
        explosionTime = 2.3;            // Seconds until the initial explosion
        timeToLive = 6;                 // Seconds until the projectile is removed
        ace_grenades_flashbang = 1;     // A normal flashbang
    };
    class ACE_G_CTS9 {
        explosionTime = 1.5;
        timeToLive = 10;
        ace_grenades_flashbang = 1;
        ace_grenades_flashbangBangs = 9;                                        // 9 bangs
        ace_grenades_flashbangInterval = 0.5;                                   // 0.5 seconds between each subsequent bang
        ace_grenades_flashbangIntervalMaxDeviation = "0.1 * sqrt (12*4) / 2";   // Standard deviation of 0.1 seconds on each fuse
    };
    class 16aa_Ammo_6Bang {                                 // British Armed Forces L107A1
        explosionTime = 1;
        timeToLive = 5;
        ace_grenades_flashbang = 1;
        ace_grenades_flashbangBangs = 6;                    // 6 bangs
        ace_grenades_flashbangInterval = 0.25;              // 0.25 seconds between each subsequent bang
        ace_grenades_flashbangIntervalMaxDeviation = 0.05;  // Deviation of up to ± 0.05 seconds on each fuse
    };
};

2.1 ace_grenades_flashbang

If set to zero or left undefined, the grenade is not treated as a flashbang. If it is set to 1, the grenade will be treated as a flashbang with the associated effects.

2.2 ace_grenades_flashbangBangs

The flashbang will explode as many times as is specified. The default is 1.

2.3 ace_grenades_flashbangInterval

The average amount of time in seconds, after explosionTime has passed, between each subsequent bang.

2.4 ace_grenades_flashbangIntervalMaxDeviation

The amount of randomness in the fuse time.