Merge pull request #822 from acemod/frag-lowercase

Convert frag config entry names to lowercase
This commit is contained in:
Felix Wiegand 2015-04-25 20:46:59 +02:00
commit 057c060212
3 changed files with 55 additions and 55 deletions

View File

@ -6,15 +6,15 @@ class CfgAmmo {
//class ace_arty_105mm_m1_m782_time; //class ace_arty_105mm_m1_m782_time;
//class ace_arty_105mm_m1_m782_prox: ace_arty_105mm_m1_m782_time {}; //class ace_arty_105mm_m1_m782_prox: ace_arty_105mm_m1_m782_time {};
//class ace_arty_105mm_m1_m782_delay: ace_arty_105mm_m1_m782_prox { //class ace_arty_105mm_m1_m782_delay: ace_arty_105mm_m1_m782_prox {
// ACE_FRAG_SKIP = 1; // GVAR(skip) = 1;
//}; //};
class Bo_GBU12_LGB; class Bo_GBU12_LGB;
class Nou_GBU12 : Bo_GBU12_LGB { class Nou_GBU12 : Bo_GBU12_LGB {
ACE_FRAG_CLASSES[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"};
ACE_FRAG_METAL = 140000; GVAR(metal) = 140000;
ACE_FRAG_CHARGE = 87000; GVAR(charge) = 87000;
ACE_FRAG_GURNEY_C = 2320; GVAR(gurney_c) = 2320;
ACE_FRAG_GURNEY_K = 1/2; GVAR(gurney_k) = 1/2;
sideAirFriction = 0.04; sideAirFriction = 0.04;
airFriction = 0.04; airFriction = 0.04;
laserLock = 0; laserLock = 0;
@ -23,90 +23,90 @@ class CfgAmmo {
class GrenadeBase; class GrenadeBase;
class Grenade; class Grenade;
class GrenadeHand: Grenade { class GrenadeHand: Grenade {
ACE_FRAG_SKIP = 0; GVAR(skip) = 0;
ACE_FRAG_FORCE = 1; GVAR(force) = 1;
// This is a good high-drag frag type for grenades. // This is a good high-drag frag type for grenades.
ACE_FRAG_CLASSES[] = {"ACE_frag_tiny_HD"}; GVAR(classes)[] = {"ACE_frag_tiny_HD"};
/* /*
These values are based on the M67 Grenade, should be tweaked for These values are based on the M67 Grenade, should be tweaked for
individual grenades. individual grenades.
*/ */
ACE_FRAG_METAL = 210; // metal in grams GVAR(metal) = 210; // metal in grams
ACE_FRAG_CHARGE = 185; // explosive in grams GVAR(charge) = 185; // explosive in grams
ACE_FRAG_GURNEY_C = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations GVAR(gurney_c) = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations
ACE_FRAG_GURNEY_K = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations GVAR(gurney_k) = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations
}; };
class GrenadeHand_stone: GrenadeHand { class GrenadeHand_stone: GrenadeHand {
ACE_FRAG_SKIP = 1; GVAR(skip) = 1;
}; };
class SmokeShell: GrenadeHand { class SmokeShell: GrenadeHand {
ACE_FRAG_SKIP = 1; GVAR(skip) = 1;
}; };
class RocketBase; class RocketBase;
//class R_Hydra_HE: RocketBase { //class R_Hydra_HE: RocketBase {
// ACE_FRAG_SKIP = 1; // GVAR(skip) = 1;
//}; //};
//class R_57mm_HE: RocketBase { //class R_57mm_HE: RocketBase {
// ACE_FRAG_SKIP = 1; // GVAR(skip) = 1;
//}; //};
class R_80mm_HE: RocketBase { class R_80mm_HE: RocketBase {
ACE_FRAG_SKIP = 1; GVAR(skip) = 1;
}; };
//class R_S8T_AT: RocketBase { //class R_S8T_AT: RocketBase {
// ACE_FRAG_SKIP = 1; // GVAR(skip) = 1;
//}; //};
class BombCore; class BombCore;
class Bo_Mk82: BombCore { class Bo_Mk82: BombCore {
ACE_FRAG_CLASSES[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"};
ACE_FRAG_METAL = 140000; GVAR(metal) = 140000;
ACE_FRAG_CHARGE = 87000; GVAR(charge) = 87000;
ACE_FRAG_GURNEY_C = 2320; GVAR(gurney_c) = 2320;
ACE_FRAG_GURNEY_K = 1/2; GVAR(gurney_k) = 1/2;
}; };
class G_40mm_HE: GrenadeBase { class G_40mm_HE: GrenadeBase {
ACE_FRAG_SKIP = 0; GVAR(skip) = 0;
ACE_FRAG_FORCE = 1; GVAR(force) = 1;
}; };
class ACE_G_40mm_HEDP: G_40mm_HE { class ACE_G_40mm_HEDP: G_40mm_HE {
ACE_FRAG_CLASSES[] = {"ACE_frag_tiny_HD"}; GVAR(classes)[] = {"ACE_frag_tiny_HD"};
ACE_FRAG_METAL = 200; GVAR(metal) = 200;
ACE_FRAG_CHARGE = 45; GVAR(charge) = 45;
ACE_FRAG_GURNEY_C = 2830; GVAR(gurney_c) = 2830;
ACE_FRAG_GURNEY_K = 3/5; GVAR(gurney_k) = 3/5;
}; };
class ACE_G_40mm_HE: ACE_G_40mm_HEDP { class ACE_G_40mm_HE: ACE_G_40mm_HEDP {
ACE_FRAG_CLASSES[] = {"ACE_frag_tiny_HD"}; GVAR(classes)[] = {"ACE_frag_tiny_HD"};
ACE_FRAG_METAL = 200; GVAR(metal) = 200;
ACE_FRAG_CHARGE = 32; GVAR(charge) = 32;
ACE_FRAG_GURNEY_C = 2700; GVAR(gurney_c) = 2700;
ACE_FRAG_GURNEY_K = 3/5; GVAR(gurney_k) = 3/5;
}; };
class ACE_G_40mm_Practice: ACE_G_40mm_HE { class ACE_G_40mm_Practice: ACE_G_40mm_HE {
ACE_FRAG_SKIP = 1; GVAR(skip) = 1;
}; };
class ACE_G40mm_HE_VOG25P: G_40mm_HE { class ACE_G40mm_HE_VOG25P: G_40mm_HE {
ACE_FRAG_SKIP = 0; GVAR(skip) = 0;
ACE_FRAG_FORCE = 1; GVAR(force) = 1;
}; };
//class R_SMAW_HEDP; //class R_SMAW_HEDP;
//class R_MEEWS_HEDP : R_SMAW_HEDP { //class R_MEEWS_HEDP : R_SMAW_HEDP {
// ACE_FRAG_FORCE = 1; // GVAR(force) = 1;
// ACE_FRAG_MULTIPLIER = 1.2; // GVAR(multiplier) = 1.2;
//}; //};
//class MissileBase; //class MissileBase;
//class M_Hellfire_AT: MissileBase { //class M_Hellfire_AT: MissileBase {
// ACE_FRAG_FORCE = 1; // GVAR(force) = 1;
// ACE_FRAG_MULTIPLIER = 1.75; // GVAR(multiplier) = 1.75;
//}; //};
/* /*

View File

@ -15,11 +15,11 @@ if (!alive _round) then {
[_this select 1] call cba_fnc_removePerFrameHandler; [_this select 1] call cba_fnc_removePerFrameHandler;
if(_time != time && {_round in GVAR(trackedObjects)} && {!(_round in GVAR(blackList))}) then { if(_time != time && {_round in GVAR(trackedObjects)} && {!(_round in GVAR(blackList))}) then {
GVAR(trackedObjects) = GVAR(trackedObjects) - [_round]; GVAR(trackedObjects) = GVAR(trackedObjects) - [_round];
_skip = getNumber (configFile >> "CfgAmmo" >> _type >> "ACE_FRAG_SKIP"); _skip = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip));
if(_skip == 0) then { if(_skip == 0) then {
_explosive = getNumber (configFile >> "CfgAmmo" >> _type >> "explosive"); _explosive = getNumber (configFile >> "CfgAmmo" >> _type >> "explosive");
_indirectRange = getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"); _indirectRange = getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange");
_force = getNumber (configFile >> "CfgAmmo" >> _type >> "ACE_FRAG_FORCE"); _force = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force));
_fragPower = getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt(_indirectRange)); _fragPower = getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt(_indirectRange));
if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then { if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then {
[QGVAR(frag_eh), _params] call ace_common_fnc_serverEvent; [QGVAR(frag_eh), _params] call ace_common_fnc_serverEvent;

View File

@ -15,15 +15,15 @@ The system for the end-developer is easy to use, and only requires minimal resea
Below is an example set of explosives configuration properties for sys_frag (in this case an M67 hand grenade): Below is an example set of explosives configuration properties for sys_frag (in this case an M67 hand grenade):
```c++ ```c++
ACE_FRAG_METAL = 210; // metal in grams ace_frag_metal = 210; // metal in grams
ACE_FRAG_CHARGE = 185; // explosive in grams ace_frag_charge = 185; // explosive in grams
ACE_FRAG_GURNEY_C = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations ace_frag_gurney_c = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations
ACE_FRAG_GURNEY_K = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations ace_frag_gurney_k = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations
``` ```
`ACE_FRAG_METAL` is the amount of metal being fragmented (generally taken as the entire weight of the warhead, though in some cases you might want to only include the fragmentation jacket or body. `ACE_FRAG_CHARGE` is the amount of explosive filler in the warhead. `ACE_FRAG_METAL` and `ACE_FRAG_CHARGE` are dimensionless values, as long as they are both in the same unit (for example kg/kg g/g lbs/lbs). `ace_frag_metal` is the amount of metal being fragmented (generally taken as the entire weight of the warhead, though in some cases you might want to only include the fragmentation jacket or body. `ace_frag_charge` is the amount of explosive filler in the warhead. `ace_frag_metal` and `ace_frag_charge` are dimensionless values, as long as they are both in the same unit (for example kg/kg g/g lbs/lbs).
`ACE_FRAG_GURNEY_C` is the Gurney constant for explosive force. You can find a list of common explosive types below. If you can not find it here, or want more accurate numbers, just google the type of explosive and Gurney constant and you can find substantial information. This is *NOT* the detonation velocity of the explosive, do not confuse them! `ace_frag_gurney_c` is the Gurney constant for explosive force. You can find a list of common explosive types below. If you can not find it here, or want more accurate numbers, just google the type of explosive and Gurney constant and you can find substantial information. This is *NOT* the detonation velocity of the explosive, do not confuse them!
| Type | Speed | | Type | Speed |
|------------------|----------| |------------------|----------|
@ -42,7 +42,7 @@ ACE_FRAG_GURNEY_K = 3/5; // Gurney shape factor, in this case a sphere. See: ht
|Tritonal | 2320 m/s | |Tritonal | 2320 m/s |
`ACE_FRAG_GURNEY_K` is the shape factor for the explosive configuration. You should choose it based on the general configuration of explosives/metal in the warhead. Most grenades for example are a sphere. Artillery and aircraft bombs are a cylinder. Mines generally a flat plate. Below is a list of the three common shapes and their factors. `ace_frag_gurney_k` is the shape factor for the explosive configuration. You should choose it based on the general configuration of explosives/metal in the warhead. Most grenades for example are a sphere. Artillery and aircraft bombs are a cylinder. Mines generally a flat plate. Below is a list of the three common shapes and their factors.
``` ```
Sphere = 3/5 Sphere = 3/5
@ -52,7 +52,7 @@ Plate = 3/5
There are other configurations but these are the most common. If you are interested in others check out the wikipedia link given above. Most of these will not correctly function in sys_frag though due to additional variables for the equation. There are other configurations but these are the most common. If you are interested in others check out the wikipedia link given above. Most of these will not correctly function in sys_frag though due to additional variables for the equation.
In addition to these variables there are different types of fragmentation fragments to choose from, and they can be defined in the config value `ACE_FRAG_CLASSES[]`. Below are a list of the types. In addition to these variables there are different types of fragmentation fragments to choose from, and they can be defined in the config value `ace_frag_classes[]`. Below are a list of the types.
``` ```
ACE_frag_tiny ACE_frag_tiny
@ -71,6 +71,6 @@ The tinier the piece of fragmentation the shorter the distance of travel. The `_
The final information needed is a couple of entries for forcing or ignoring fragmentation for this ammo. The final information needed is a couple of entries for forcing or ignoring fragmentation for this ammo.
If you set `ACE_FRAG_SKIP` to 1 then you will skip fragmentation for ammo of this type. This is useful for things that might cause high network load, such as FFAR rockets, or possibly even 40mm grenades from AGLs. Experimentation under network conditions is required. If you set `ace_frag_skip` to 1 then you will skip fragmentation for ammo of this type. This is useful for things that might cause high network load, such as FFAR rockets, or possibly even 40mm grenades from AGLs. Experimentation under network conditions is required.
If you set `ACE_FRAG_FORCE` to 1 it will force the fragmentation system to use frag on this ammo, ignoring sys_frags internal qualifications based on hit values. If you set `ace_frag_force` to 1 it will force the fragmentation system to use frag on this ammo, ignoring sys_frags internal qualifications based on hit values.