mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Refuel - Add setting for hose length (#5224)
This commit is contained in:
parent
4ad73446a6
commit
afe862324e
@ -6,4 +6,10 @@ class ACE_Settings {
|
|||||||
value = 1;
|
value = 1;
|
||||||
typeName = "SCALAR";
|
typeName = "SCALAR";
|
||||||
};
|
};
|
||||||
|
class GVAR(hoseLength) {
|
||||||
|
category = ECSTRING(OptionsMenu,CategoryLogistics);
|
||||||
|
displayName = CSTRING(RefuelSettings_hoseLength_DisplayName);
|
||||||
|
value = 12;
|
||||||
|
typeName = "SCALAR";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
@ -119,6 +119,11 @@ class CfgVehicles {
|
|||||||
typeName = "NUMBER";
|
typeName = "NUMBER";
|
||||||
defaultValue = 10;
|
defaultValue = 10;
|
||||||
};
|
};
|
||||||
|
class hoseLength {
|
||||||
|
displayName = CSTRING(RefuelSettings_hoseLength_DisplayName);
|
||||||
|
typeName = "NUMBER";
|
||||||
|
defaultValue = 12;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,7 +38,8 @@ if (_nozzle getVariable [QGVAR(jerryCan), false]) exitWith {};
|
|||||||
[_pfID] call CBA_fnc_removePerFrameHandler;
|
[_pfID] call CBA_fnc_removePerFrameHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isNull _source || {_unit distance (_source modelToWorld _endPosOffset) > (REFUEL_HOSE_LENGTH - 2)} || {!alive _source}) exitWith {
|
private _hoseLength = _source getVariable [QGVAR(hoseLength), GVAR(hoseLength)];
|
||||||
|
if (isNull _source || {_unit distance (_source modelToWorld _endPosOffset) > (_hoseLength - 2)} || {!alive _source}) exitWith {
|
||||||
if !(isNull _nozzle) then {
|
if !(isNull _nozzle) then {
|
||||||
[_unit, _nozzle] call FUNC(dropNozzle);
|
[_unit, _nozzle] call FUNC(dropNozzle);
|
||||||
REFUEL_UNHOLSTER_WEAPON
|
REFUEL_UNHOLSTER_WEAPON
|
||||||
|
@ -20,5 +20,6 @@ params ["_logic", "", ["_activated", false, [false]]];
|
|||||||
if !(_activated) exitWith {};
|
if !(_activated) exitWith {};
|
||||||
|
|
||||||
[_logic, QGVAR(rate), "rate"] call EFUNC(common,readSettingFromModule);
|
[_logic, QGVAR(rate), "rate"] call EFUNC(common,readSettingFromModule);
|
||||||
|
[_logic, QGVAR(hoseLength), "hoseLength"] call EFUNC(common,readSettingFromModule);
|
||||||
|
|
||||||
diag_log text format ["[ACE]: Refuel Module Initialized with flow rate: %1", GVAR(rate)];
|
INFO_2("Refuel Module Initialized with flow rate: %1 - hoseLength: %2",GVAR(rate), GVAR(hoseLength))
|
||||||
|
@ -44,7 +44,8 @@ if (_maxFuel == 0) then {
|
|||||||
_sink setVariable [QGVAR(nozzle), objNull, true];
|
_sink setVariable [QGVAR(nozzle), objNull, true];
|
||||||
[_pfID] call CBA_fnc_removePerFrameHandler;
|
[_pfID] call CBA_fnc_removePerFrameHandler;
|
||||||
};
|
};
|
||||||
private _tooFar = ((_sink modelToWorld _connectToPoint) distance (_source modelToWorld _connectFromPoint)) > (REFUEL_HOSE_LENGTH - 2);
|
private _hoseLength = _source getVariable [QGVAR(hoseLength), GVAR(hoseLength)];
|
||||||
|
private _tooFar = ((_sink modelToWorld _connectToPoint) distance (_source modelToWorld _connectFromPoint)) > (_hoseLength - 2);
|
||||||
if (_tooFar && {!(_nozzle getVariable [QGVAR(jerryCan), false])}) exitWith {
|
if (_tooFar && {!(_nozzle getVariable [QGVAR(jerryCan), false])}) exitWith {
|
||||||
[LSTRING(Hint_TooFar), 2, _unit] call EFUNC(common,displayTextStructured);
|
[LSTRING(Hint_TooFar), 2, _unit] call EFUNC(common,displayTextStructured);
|
||||||
|
|
||||||
|
@ -67,7 +67,8 @@ if (isNull _nozzle) then { // func is called on fuel truck
|
|||||||
_newNozzle setVariable [QGVAR(helper), _helper, true];
|
_newNozzle setVariable [QGVAR(helper), _helper, true];
|
||||||
_ropeTarget = _helper;
|
_ropeTarget = _helper;
|
||||||
};
|
};
|
||||||
private _rope = ropeCreate [_ropeTarget, _endPosOffset, _newNozzle, [0, -0.20, 0.12], REFUEL_HOSE_LENGTH];
|
private _hoseLength = _target getVariable [QGVAR(hoseLength), GVAR(hoseLength)];
|
||||||
|
private _rope = ropeCreate [_ropeTarget, _endPosOffset, _newNozzle, [0, -0.20, 0.12], _hoseLength];
|
||||||
_newNozzle setVariable [QGVAR(rope), _rope, true];
|
_newNozzle setVariable [QGVAR(rope), _rope, true];
|
||||||
_newNozzle setVariable [QGVAR(attachPos), _endPosOffset, true];
|
_newNozzle setVariable [QGVAR(attachPos), _endPosOffset, true];
|
||||||
_newNozzle setVariable [QGVAR(source), _target, true];
|
_newNozzle setVariable [QGVAR(source), _target, true];
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
#define REFUEL_INFINITE_FUEL -10
|
#define REFUEL_INFINITE_FUEL -10
|
||||||
#define REFUEL_ACTION_DISTANCE 7
|
#define REFUEL_ACTION_DISTANCE 7
|
||||||
#define REFUEL_HOSE_LENGTH 12
|
|
||||||
#define REFUEL_PROGRESS_DURATION 2
|
#define REFUEL_PROGRESS_DURATION 2
|
||||||
|
|
||||||
#define REFUEL_HOLSTER_WEAPON \
|
#define REFUEL_HOLSTER_WEAPON \
|
||||||
|
@ -404,5 +404,10 @@
|
|||||||
<Japanese>%1 リッターがある</Japanese>
|
<Japanese>%1 リッターがある</Japanese>
|
||||||
<Korean>%1 리터가 재급유되었습니다.</Korean>
|
<Korean>%1 리터가 재급유되었습니다.</Korean>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Refuel_RefuelSettings_hoseLength_DisplayName">
|
||||||
|
<English>Refuel hose length</English>
|
||||||
|
<German>Betankung Schlauchlänge</German>
|
||||||
|
<Spanish>Reabastecer longitud de manguera</Spanish>
|
||||||
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -65,6 +65,12 @@ Please check the framework description for more details.
|
|||||||
### Something broke, I can't use the fuel truck / nozzle any longer. What to do?
|
### Something broke, I can't use the fuel truck / nozzle any longer. What to do?
|
||||||
You can reset the fuel truck and its nozzle by calling `ace_refuel_fnc_reset` with its first parameter being the fuel truck object.
|
You can reset the fuel truck and its nozzle by calling `ace_refuel_fnc_reset` with its first parameter being the fuel truck object.
|
||||||
|
|
||||||
|
### How do I increase the length of the hose?
|
||||||
|
There is a global setting that will effect all vehicles and static pumps. To only effect a specific vehicle put the following in it's init box:
|
||||||
|
```cpp
|
||||||
|
this setVariable ["ace_refuel_hoseLength", 30];
|
||||||
|
```
|
||||||
|
|
||||||
## 4. Dependencies
|
## 4. Dependencies
|
||||||
|
|
||||||
{% include dependencies_list.md component="refuel" %}
|
{% include dependencies_list.md component="refuel" %}
|
||||||
|
Loading…
Reference in New Issue
Block a user