Removed GVAR(enable), added GVAR(enableFire) back

This commit is contained in:
johnb432 2024-02-14 10:03:03 +01:00
parent a2909a97d4
commit cc06b37f47
13 changed files with 64 additions and 76 deletions

View File

@ -1,7 +1,4 @@
class ACE_Settings {
class GVAR(enable) {
movedToSqf = 1;
};
class GVAR(enableAmmobox) {
movedToSQF = 1;
};

View File

@ -3,15 +3,15 @@ class Cfg3DEN {
class AttributeCategories {
class ace_attributes {
class Attributes {
class GVAR(enable) {
property = QGVAR(enable);
class GVAR(enable) { // setting was previously GVAR(enable), so maintain for backwards compatiblity with missions
property = QGVAR(enable); // same as above
control = "Checkbox";
displayName = CSTRING(enable_name);
tooltip = CSTRING(enable_tooltip);
displayName = CSTRING(enableFire_name);
tooltip = CSTRING(enableFire_tooltip);
expression = QUOTE(if (!_value) then {_this setVariable [ARR_3('%s',_value,true)]});
typeName = "BOOL";
condition = "objectVehicle";
defaultValue = QUOTE(GETMVAR(QGVAR(enable),true));
defaultValue = QUOTE(GETMVAR(QGVAR(enableFire),true));
};
class GVAR(enableAmmoCookoff) {
property = QGVAR(enableAmmoCookoff);

View File

@ -27,7 +27,7 @@
*/
if (!isServer) exitWith {};
if (!GVAR(enable) || {GVAR(cookoffDuration) == 0}) exitWith {};
if (!GVAR(enableFire) || {GVAR(cookoffDuration) == 0}) exitWith {};
params [
"_vehicle",
@ -53,7 +53,7 @@ if (_vehicle isKindOf "CAManBase" || {_vehicle isKindOf "StaticWeapon"}) exitWit
if (underwater _vehicle || {private _posASL = getPosWorld _vehicle; surfaceIsWater _posASL && {(_posASL select 2) < 0}}) exitWith {};
// Check if cook-off is disabled on vehicle specifically
if !(_vehicle getVariable [QGVAR(enable), true]) exitWith {};
if !(_vehicle getVariable [QGVAR(enable), true]) exitWith {}; // QGVAR(enable) is API
TRACE_2("cooking off",_vehicle,_intensity);
TRACE_9("",_source,_instigator,_delayBetweenSmokeAndFire,_ammoDetonationChance,_detonateAfterCookoff,_fireSource,_canRing,_canJet,_maxIntensity);
@ -104,7 +104,8 @@ if (_delayBetweenSmokeAndFire) then {
if (
isNull _vehicle ||
!GVAR(enable) ||
!GVAR(enableFire) ||
{!(_vehicle getVariable [QGVAR(enable), true])} || // QGVAR(enable) is API
{_intensity <= 1} ||
{GVAR(cookoffDuration) == 0} ||
{underwater _vehicle} ||

View File

@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: KoffeinFlummi, commy2, kymckay, johnb43
* Start a cook-off in the given ammo box.
* Start an ammo cook-off in the given ammo box.
*
* Arguments:
* 0: Ammo box <OBJECT>

View File

@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: tcvm
* Spawn cook-off effects.
* Spawn cook-off fire effects.
*
* Arguments:
* 0: Vehicle <OBJECT>

View File

@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: johnb43
* Starts ammunition detonating from an object.
* Starts detonating ammunition from an object (e.g. vehicle or crate).
*
* Arguments:
* 0: Object <OBJECT>

View File

@ -37,6 +37,7 @@ if (
{!([GVAR(enableAmmoCookoff), GVAR(enableAmmobox)] select (_object isKindOf "ReammoBox_F"))} ||
{!(_object getVariable [QGVAR(enableAmmoCookoff), true])}
) exitWith {
// Box cook-off fire ends after the ammo has detonated (vehicle cook-off fire does not depend on the ammo detonation)
if (_object isKindOf "ReammoBox_F") then {
[QGVAR(cleanupEffects), _object] call CBA_fnc_globalEvent;

View File

@ -1,6 +1,6 @@
#include "..\script_component.hpp"
/*
* Author: KoffeinFlummi, commy2
* Author: KoffeinFlummi, commy2, johnb43
* Start fire in engine block of a car.
*
* Arguments:
@ -22,7 +22,7 @@ params ["_vehicle"];
// If already smoking, stop
if (_vehicle getVariable [QGVAR(isEngineSmoking), false]) exitWith {};
_vehicle setVariable [QGVAR(isEngineSmoking), true];
_vehicle setVariable [QGVAR(isEngineSmoking), true, true];
// Spawn engine fire effects on all connected machines
private _jipID = [QGVAR(engineFireLocal), [_vehicle, CBA_missionTime + random [ENGINE_FIRE_TIME / 2, ENGINE_FIRE_TIME, ENGINE_FIRE_TIME / 2 * 3]]] call CBA_fnc_globalEventJIP;

View File

@ -1,6 +1,6 @@
#include "..\script_component.hpp"
/*
* Author: KoffeinFlummi, commy2
* Author: KoffeinFlummi, commy2, johnb43
* Start fire in engine block of a car.
*
* Arguments:
@ -64,9 +64,10 @@ if (hasInterface) then {
deleteVehicle _smoke;
if (isNull _vehicle || !isServer) exitWith {};
if (!isServer || {isNull _vehicle}) exitWith {};
_vehicle setVariable [QGVAR(isEngineSmoking), nil];
// Reset variable, so engine can smoke again in the future
_vehicle setVariable [QGVAR(isEngineSmoking), nil, true];
private _jipID = _vehicle getVariable QGVAR(engineFireJipID);

View File

@ -1,6 +1,6 @@
#include "..\script_component.hpp"
/*
* Author: KoffeinFlummi, commy2
* Author: KoffeinFlummi, commy2, johnb43
* Handles all incoming damage for boxes.
*
* Arguments:

View File

@ -1,11 +1,11 @@
[
QGVAR(enable),
QGVAR(enableFire),
"CHECKBOX",
[LSTRING(enable_name), LSTRING(enable_tooltip)],
[LSTRING(enableFire_name), LSTRING(enableFire_tooltip)],
LSTRING(category_displayName),
true,
1,
{[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)}
{[QGVAR(enableFire), _this] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_fnc_addSetting;
[

View File

@ -16,65 +16,23 @@
<Portuguese>ACE Cook off</Portuguese>
<Czech>ACE Vznícení munice</Czech>
</Key>
<Key ID="STR_ACE_CookOff_enable_name">
<English>Enable vehicle cook-off effects</English>
<Key ID="STR_ACE_CookOff_enableFire_name">
<English>Enable vehicle cook-off fire</English>
</Key>
<Key ID="STR_ACE_CookOff_enable_tooltip">
<English>Enables vehicle cook-off effects (fire and fire sound, but doesn't include ammunition detonations).</English>
</Key>
<Key ID="STR_ACE_CookOff_enableBoxCookoff_name">
<English>Enable ammo box cook-off</English>
<Spanish>Habilitar detonación inducida por calor en las cajas de munición</Spanish>
<Japanese>弾薬箱の誘爆を有効化</Japanese>
<German>Durchzündung für Munitionskisten ermöglichen</German>
<Korean>탄약 상자 쿡오프 현상 활성화</Korean>
<Polish>Aktywuj samozapłon skrzyń z amunicją</Polish>
<French>Auto-inflammation des caisses de munitions</French>
<Italian>Abilita esplosione casse munizioni</Italian>
<Chinese>開啟彈藥箱殉爆效果</Chinese>
<Chinesesimp>开启弹药箱殉爆效果</Chinesesimp>
<Russian>Разрешить детонацию ящиков с боеприпасами</Russian>
<Portuguese>Permitir cozinhar caixas de munição</Portuguese>
<Czech>Povolit vynícení munice v krabicích</Czech>
</Key>
<Key ID="STR_ACE_CookOff_enableBoxCookoff_tooltip">
<English>Enables cooking off of ammo boxes.</English>
<Spanish>Habilita la detonación inducida por calor en las cajas de munición</Spanish>
<Japanese>弾薬箱が誘爆するようになります。</Japanese>
<German>Ermöglicht Durchzündung von Munitionskisten.</German>
<Korean>탄약 상자에 쿡오프 현상을 적용합니다.</Korean>
<Polish>Aktywuje samozapłon skrzyń z amunicją</Polish>
<French>Permet l'auto-inflammation des caisses de munitions.</French>
<Italian>Abilita l'esplosione di casse di munizioni distrutte.</Italian>
<Chinese>開啟彈藥箱殉爆效果</Chinese>
<Chinesesimp>开启弹药箱殉爆效果</Chinesesimp>
<Russian>Активирует детонацию ящиков с боеприпасами</Russian>
<Portuguese>Permitir que caixas de munição cozinhem.</Portuguese>
<Czech>Zapíná vznícení munice v krabicích.</Czech>
</Key>
<Key ID="STR_ACE_CookOff_enableAmmoCookoff_name">
<English>Enable vehicle ammo cook-off</English>
</Key>
<Key ID="STR_ACE_CookOff_enableAmmoCookoff_tooltip">
<English>Enables cooking off of vehicle ammunition. Fires ammunition projectiles while vehicle has ammunition remaining.</English>
<Key ID="STR_ACE_CookOff_enableFire_tooltip">
<English>Enables vehicle cook-off fire effects.\nThis does NOT include ammunition detonations.</English>
</Key>
<Key ID="STR_ACE_CookOff_cookoffDuration_name">
<English>Vehicle cook-off duration multiplier</English>
<English>Vehicle cook-off fire duration multiplier</English>
</Key>
<Key ID="STR_ACE_CookOff_cookoffDuration_tooltip">
<English>Multiplier for how long vehicle cook-off lasts.\nSetting to 0 will disable cookoff.</English>
</Key>
<Key ID="STR_ACE_CookOff_ammoCookoffDuration_name">
<English>Ammo cook-off duration multiplier</English>
</Key>
<Key ID="STR_ACE_CookOff_ammoCookoffDuration_tooltip">
<English>Multiplier for how long ammunition cook-off lasts, for both vehicles and ammo boxes.\nSetting to 0 will disable ammo cookoff.</English>
<English>Multiplier for how long vehicle cook-off fire lasts.\nSetting to 0 will disable vehicle cook-off fire.</English>
</Key>
<Key ID="STR_ACE_CookOff_probabilityCoef_name">
<English>Vehicle cook-off probability multiplier</English>
<English>Vehicle cook-off fire probability multiplier</English>
</Key>
<Key ID="STR_ACE_CookOff_probabilityCoef_tooltip">
<English>Multiplier for vehicle cook-off probability. Higher value results in higher cook-off probability.\nSetting to 0 will disable cookoff.</English>
<English>Multiplier for vehicle cook-off fire probability. Higher value results in higher cook-off probability.\nSetting to 0 will disable vehicle cook-off fire.</English>
</Key>
<Key ID="STR_ACE_CookOff_destroyVehicleAfterCookoff_name">
<English>Destroy vehicles after cook-off</English>
@ -99,6 +57,36 @@
<French>Contrôle si les véhicules seront toujours détruits après l'auto-inflammation.</French>
<Portuguese>Define se os veículos serão sempre destruídos após cozinhamento.</Portuguese>
</Key>
<Key ID="STR_ACE_CookOff_enableAmmoCookoff_name">
<English>Enable vehicle ammo cook-off</English>
</Key>
<Key ID="STR_ACE_CookOff_enableAmmoCookoff_tooltip">
<English>Enables cooking off of vehicle ammunition. Fires ammunition projectiles while vehicle has ammunition remaining.\nThis does NOT include fire effects.</English>
</Key>
<Key ID="STR_ACE_CookOff_enableBoxCookoff_name">
<English>Enable ammo box cook-off</English>
<Spanish>Habilitar detonación inducida por calor en las cajas de munición</Spanish>
<Japanese>弾薬箱の誘爆を有効化</Japanese>
<German>Durchzündung für Munitionskisten ermöglichen</German>
<Korean>탄약 상자 쿡오프 현상 활성화</Korean>
<Polish>Aktywuj samozapłon skrzyń z amunicją</Polish>
<French>Auto-inflammation des caisses de munitions</French>
<Italian>Abilita esplosione casse munizioni</Italian>
<Chinese>開啟彈藥箱殉爆效果</Chinese>
<Chinesesimp>开启弹药箱殉爆效果</Chinesesimp>
<Russian>Разрешить детонацию ящиков с боеприпасами</Russian>
<Portuguese>Permitir cozinhar caixas de munição</Portuguese>
<Czech>Povolit vynícení munice v krabicích</Czech>
</Key>
<Key ID="STR_ACE_CookOff_enableBoxCookoff_tooltip">
<English>Enables cooking off of ammo boxes.\nThis does NOT include fire effects.</English>
</Key>
<Key ID="STR_ACE_CookOff_ammoCookoffDuration_name">
<English>Ammo cook-off duration multiplier</English>
</Key>
<Key ID="STR_ACE_CookOff_ammoCookoffDuration_tooltip">
<English>Multiplier for how long ammunition cook-off lasts, for both vehicles and ammo boxes.\nSetting to 0 will disable ammo cook-off for both vehicles and ammo boxes.</English>
</Key>
<Key ID="STR_ACE_CookOff_removeAmmoDuringCookoff_name">
<English>Enable ammo removal during cook-off</English>
<Japanese>誘爆中の弾薬除去を有効/無効にする</Japanese>

View File

@ -12,9 +12,9 @@ version:
patch: 0
---
## 1. Disabling cook-off for individual vehicles
## 1. Disabling cook-off fire for individual vehicles
Cook-off can be disabled for a specific vehicle. "Cook-off" refers to the fire effects (visual & sounds) that happen when a vehicle is cooking off:
Cook-off fire can be disabled for a specific vehicle (does not affect ammo cook-off):
```
_vehicle setVariable ["ace_cookoff_enable", false, true];
@ -24,7 +24,7 @@ Mission settings will always apply however, so you can't enable cook-off on a ve
## 2. Disabling ammunition cook-off for individual vehicles and boxes
Ammunition cook-off can be disabled for a specific vehicle or box. "Ammunition cook-off" refers to the ammunition exploding in a burning vehicle:
Ammunition cook-off can be disabled for a specific vehicle or box (does not affect cook-off fire):
```
_vehicleOrBox setVariable ["ace_cookoff_enableAmmoCookoff", false, true];