mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' into medical-treatment-work
This commit is contained in:
commit
7b641508e9
@ -62,11 +62,13 @@ call FUNC(compileStats);
|
||||
|
||||
// compatibility with CBA scripted 2d optics framework
|
||||
[QGVAR(displayOpened), {
|
||||
"cba_2doptics_arsenalOpened" call CBA_fnc_localEvent;
|
||||
"cba_optics_arsenalOpened" call CBA_fnc_localEvent;
|
||||
"cba_disposable_arsenalOpened" call CBA_fnc_localEvent;
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
[QGVAR(displayClosed), {
|
||||
"cba_2doptics_arsenalClosed" call CBA_fnc_localEvent;
|
||||
"cba_optics_arsenalClosed" call CBA_fnc_localEvent;
|
||||
"cba_disposable_arsenalClosed" call CBA_fnc_localEvent;
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
ADDON = true;
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
params ["_unit", "_animation", ["_priority", 0]];
|
||||
TRACE_4("params",_unit,_animation,_priority);
|
||||
TRACE_3("params",_unit,_animation,_priority);
|
||||
|
||||
// switchMove "" no longer works in dev 1.37
|
||||
if (_animation == "") then {
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: dedmen
|
||||
* Adds the local unit event handlers.
|
||||
* Adds the local unit event handlers.
|
||||
* Access with function `ace_common_fnc_getLocalUnits` or array `ace_common_localUnits`
|
||||
*
|
||||
* Arguments:
|
||||
@ -15,6 +15,8 @@
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
// Ignore UAV/Drone AI
|
||||
#define IGNORE_BASE_UAVPILOTS "B_UAV_AI", "O_UAV_AI", "UAV_AI_base_F"
|
||||
|
||||
GVAR(localUnits) = [];
|
||||
|
||||
@ -27,7 +29,7 @@ GVAR(localUnits) = [];
|
||||
if (!alive _unit) exitWith {};
|
||||
GVAR(localUnits) pushBack _unit;
|
||||
};
|
||||
}] call CBA_fnc_addClassEventHandler;
|
||||
}, true, [IGNORE_BASE_UAVPILOTS]] call CBA_fnc_addClassEventHandler;
|
||||
|
||||
["CAManBase", "respawn", {
|
||||
params ["_unit"];
|
||||
@ -37,7 +39,7 @@ GVAR(localUnits) = [];
|
||||
if (!alive _unit) exitWith {};
|
||||
GVAR(localUnits) pushBack _unit;
|
||||
};
|
||||
}] call CBA_fnc_addClassEventHandler;
|
||||
}, true, [IGNORE_BASE_UAVPILOTS]] call CBA_fnc_addClassEventHandler;
|
||||
|
||||
["CAManBase", "local", {
|
||||
params ["_unit", "_local"];
|
||||
@ -49,7 +51,7 @@ GVAR(localUnits) = [];
|
||||
} else {
|
||||
GVAR(localUnits) deleteAt (GVAR(localUnits) find _unit);
|
||||
};
|
||||
}] call CBA_fnc_addClassEventHandler;
|
||||
}, true, [IGNORE_BASE_UAVPILOTS]] call CBA_fnc_addClassEventHandler;
|
||||
|
||||
["CAManBase", "deleted", {
|
||||
params ["_unit"];
|
||||
@ -64,7 +66,7 @@ GVAR(localUnits) = [];
|
||||
};
|
||||
}, [_unit]] call CBA_fnc_execNextFrame;
|
||||
};
|
||||
}] call CBA_fnc_addClassEventHandler;
|
||||
}, true, [IGNORE_BASE_UAVPILOTS]] call CBA_fnc_addClassEventHandler;
|
||||
|
||||
["CAManBase", "killed", {
|
||||
params ["_unit"];
|
||||
@ -73,4 +75,4 @@ GVAR(localUnits) = [];
|
||||
if (local _unit) then {
|
||||
GVAR(localUnits) deleteAt (GVAR(localUnits) find _unit);
|
||||
};
|
||||
}] call CBA_fnc_addClassEventHandler;
|
||||
}, true, [IGNORE_BASE_UAVPILOTS]] call CBA_fnc_addClassEventHandler;
|
||||
|
@ -207,7 +207,7 @@ class CfgVehicles {
|
||||
GVAR(enabled) = 2;
|
||||
GVAR(ropeOrigins)[] = {"ropeOriginRight", "ropeOriginLeft"};
|
||||
GVAR(friesType) = "ACE_friesAnchorBar";
|
||||
GVAR(friesAttachmentPoint)[] = {0.065, 2.2, -0.15};
|
||||
GVAR(friesAttachmentPoint)[] = {0.035, 2.2, -0.15};
|
||||
GVAR(onPrepare) = QFUNC(onPrepareCommon);
|
||||
GVAR(onCut) = QFUNC(onCutCommon);
|
||||
EQUIP_FRIES_ATTRIBUTE;
|
||||
|
@ -4,7 +4,6 @@ PREP(canDeployRopes);
|
||||
PREP(canFastRope);
|
||||
PREP(canPrepareFRIES);
|
||||
PREP(canStowFRIES);
|
||||
PREP(checkVehicleThread);
|
||||
PREP(cutRopes);
|
||||
PREP(deployAI);
|
||||
PREP(deployRopes);
|
||||
@ -18,3 +17,4 @@ PREP(onPrepareCommon);
|
||||
PREP(onRopeBreak);
|
||||
PREP(prepareFRIES);
|
||||
PREP(stowFRIES);
|
||||
PREP(unequipFRIES);
|
||||
|
@ -1,24 +0,0 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Checks if the given helicopter still exits, and if not, destroys the FRIES.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The helicopter <OBJECT>
|
||||
* 1: The helicopter's FRIES <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [_vehicle, _fries] call ace_fastroping_fnc_checkVehicleThread
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
params ["_vehicle", "_fries"];
|
||||
|
||||
if (isNull _vehicle) then {
|
||||
deleteVehicle _fries;
|
||||
} else {
|
||||
[FUNC(checkVehicleThread), _this, 5] call CBA_fnc_waitAndExecute;
|
||||
};
|
@ -12,7 +12,7 @@
|
||||
* Example:
|
||||
* [_vehicle] call ace_fastroping_fnc_equipFRIES
|
||||
*
|
||||
* Public: No
|
||||
* Public: Yes
|
||||
*/
|
||||
params ["_vehicle"];
|
||||
|
||||
@ -24,15 +24,8 @@ if !(isNumber (_config >> QGVAR(enabled))) then {
|
||||
private _fries = (getText (_config >> QGVAR(friesType))) createVehicle [0, 0, 0];
|
||||
_fries attachTo [_vehicle, (getArray (_config >> QGVAR(friesAttachmentPoint)))];
|
||||
_vehicle setVariable [QGVAR(FRIES), _fries, true];
|
||||
_vehicle addEventHandler ["Killed", {
|
||||
params ["_vehicle"];
|
||||
deleteVehicle (_vehicle getVariable [QGVAR(FRIES), objNull]);
|
||||
_vehicle setVariable [QGVAR(FRIES), nil, true];
|
||||
|
||||
if !((_vehicle getVariable [QGVAR(deployedRopes), []] isEqualTo [])) then {
|
||||
[_vehicle] call FUNC(cutRopes);
|
||||
};
|
||||
}];
|
||||
[FUNC(checkVehicleThread), [_vehicle, _fries], 5] call CBA_fnc_waitAndExecute;
|
||||
_vehicle addEventHandler ["Killed", FUNC(unequipFRIES)];
|
||||
_vehicle addEventHandler ["Deleted", FUNC(unequipFRIES)];
|
||||
};
|
||||
};
|
||||
|
24
addons/fastroping/functions/fnc_unequipFRIES.sqf
Normal file
24
addons/fastroping/functions/fnc_unequipFRIES.sqf
Normal file
@ -0,0 +1,24 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: BaerMitUmlaut
|
||||
* Removes FRIES from helicopter.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The helicopter <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [_vehicle] call ace_fastroping_fnc_unequipFRIES
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
params ["_vehicle"];
|
||||
|
||||
deleteVehicle (_vehicle getVariable [QGVAR(FRIES), objNull]);
|
||||
_vehicle setVariable [QGVAR(FRIES), nil, true];
|
||||
|
||||
if !((_vehicle getVariable [QGVAR(deployedRopes), []] isEqualTo [])) then {
|
||||
[_vehicle] call FUNC(cutRopes);
|
||||
};
|
@ -15,13 +15,9 @@ if (!hasInterface) exitWith {};
|
||||
};
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
// Register fire event handler
|
||||
["ace_firedPlayerVehicle", DFUNC(firedEH)] call CBA_fnc_addEventHandler;
|
||||
["ace_firedPlayerVehicleNonLocal", DFUNC(firedEH)] call CBA_fnc_addEventHandler;
|
||||
|
||||
// Register event for global updates
|
||||
[QGVAR(forceUpdate), {[ACE_player] call FUNC(onForceUpdate)}] call CBA_fnc_addEventHandler;
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
call compile preprocessFileLineNumbers QPATHTOF(functions\dev_debugConfigs.sqf);
|
||||
call compile preprocessFileLineNumbers QPATHTOF(dev\test_debugConfigs.sqf);
|
||||
#endif
|
||||
|
@ -21,6 +21,13 @@ params ["_vehicle"];
|
||||
private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _x] call EFUNC(common,getTurretConfigPath);
|
||||
|
||||
if (getNumber (_turretConfig >> QGVAR(Enabled)) == 1) then {
|
||||
if (missionNamespace getVariable [QGVAR(needToAddFiredEH), true]) then {
|
||||
["ace_firedPlayerVehicle", LINKFUNC(firedEH)] call CBA_fnc_addEventHandler;
|
||||
["ace_firedPlayerVehicleNonLocal", LINKFUNC(firedEH)] call CBA_fnc_addEventHandler;
|
||||
GVAR(needToAddFiredEH) = false;
|
||||
TRACE_1("Registered fired event handlers for all vehicles",GVAR(needToAddFiredEH));
|
||||
};
|
||||
|
||||
_vehicle setVariable [format ["%1_%2", QGVAR(Distance), _x], 0, true];
|
||||
_vehicle setVariable [format ["%1_%2", QGVAR(Magazines), _x], [], true];
|
||||
_vehicle setVariable [format ["%1_%2", QGVAR(Elevation), _x], [], true];
|
||||
|
@ -114,6 +114,7 @@ GVAR(vehicleLightColor) = [1,1,1,0];
|
||||
switch (true) do {
|
||||
case (_vehicle isKindOf "Tank");
|
||||
case (_vehicle isKindOf "Wheeled_APC"): { {true} };
|
||||
case (_vehicle isKindOf "ParachuteBase"): { {false} };
|
||||
case (_vehicle isKindOf "Helicopter");
|
||||
case (_vehicle isKindOf "Plane"): { {(driver _vehicle == _unit) || {gunner _vehicle == _unit}} };
|
||||
default { {false} };
|
||||
|
@ -34,8 +34,8 @@ if (_bodyPartIndex < 0) exitWith {ERROR_1("addDamageToUnit - bad selection %1",
|
||||
_bodyPart = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] select _bodyPartIndex;
|
||||
|
||||
if (!isNull _instigator) then {
|
||||
_unit setVariable [QEGVAR(medical_engine,lastShooter), _instigator];
|
||||
_unit setVariable [QEGVAR(medical_engine,lastInstigator), _instigator];
|
||||
_unit setVariable [QEGVAR(medical,lastDamageSource), _instigator];
|
||||
_unit setVariable [QEGVAR(medical,lastInstigator), _instigator];
|
||||
};
|
||||
|
||||
#ifdef DEBUG_TESTRESULTS
|
||||
|
@ -21,7 +21,7 @@
|
||||
WARNING("this function needs to be updated for changes to woundsHandlerSQF");
|
||||
|
||||
params ["_unit", "_bodyPart", "_damage", "_typeOfDamage"];
|
||||
TRACE_5("start",_unit,_bodyPart,_damage,_typeOfDamage);
|
||||
TRACE_4("start",_unit,_bodyPart,_damage,_typeOfDamage);
|
||||
|
||||
if (_typeOfDamage isEqualTo "") then {
|
||||
_typeOfDamage = "unknown";
|
||||
|
@ -27,7 +27,7 @@
|
||||
_unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]
|
||||
];
|
||||
};
|
||||
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
|
||||
}, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler;
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
[QEGVAR(medical,woundReceived), {
|
||||
@ -37,24 +37,6 @@
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
#endif
|
||||
|
||||
// Kill vanilla bleeding feedback effects.
|
||||
#ifdef DISABLE_VANILLA_DAMAGE_EFFECTS
|
||||
[{
|
||||
{isNil _x} count [
|
||||
"BIS_fnc_feedback_damageCC",
|
||||
"BIS_fnc_feedback_damageRadialBlur",
|
||||
"BIS_fnc_feedback_damageBlur"
|
||||
] == 0
|
||||
}, {
|
||||
{
|
||||
ppEffectDestroy _x;
|
||||
} forEach [
|
||||
BIS_fnc_feedback_damageCC,
|
||||
BIS_fnc_feedback_damageRadialBlur,
|
||||
BIS_fnc_feedback_damageBlur
|
||||
];
|
||||
}] call CBA_fnc_waitUntilAndExecute;
|
||||
#endif
|
||||
|
||||
// this handles moving units into vehicles via load functions or zeus
|
||||
// needed, because the vanilla INCAPACITATED state does not handle vehicles
|
||||
|
@ -45,8 +45,8 @@ if (_hitPoint in ["hithead", "hitbody", "hithands", "hitlegs"]) exitWith {_oldDa
|
||||
// This hitpoint is set to trigger last, evaluate all the stored damage values
|
||||
// to determine where wounds are applied
|
||||
if (_hitPoint isEqualTo "ace_hdbracket") exitWith {
|
||||
_unit setVariable [QGVAR(lastShooter), _shooter];
|
||||
_unit setVariable [QGVAR(lastInstigator), _instigator];
|
||||
_unit setVariable [QEGVAR(medical,lastDamageSource), _shooter];
|
||||
_unit setVariable [QEGVAR(medical,lastInstigator), _instigator];
|
||||
|
||||
private _damageStructural = _unit getVariable [HIT_STRUCTURAL, 0];
|
||||
|
||||
|
@ -159,3 +159,6 @@
|
||||
// Cache expiry values, in seconds
|
||||
#define IN_MEDICAL_FACILITY_CACHE_EXPIRY 1
|
||||
#define CAN_TREAT_CONDITION_CACHE_EXPIRY 2
|
||||
|
||||
// Ignore UAV/Drone AI Base Classes
|
||||
#define IGNORE_BASE_UAVPILOTS "B_UAV_AI", "O_UAV_AI", "UAV_AI_base_F"
|
||||
|
@ -70,3 +70,24 @@ GVAR(heartBeatEffectRunning) = false;
|
||||
[_status, 0] call FUNC(effectUnconscious);
|
||||
["unconscious", _status] call EFUNC(common,setDisableUserInputStatus);
|
||||
}] call CBA_fnc_addPlayerEventHandler;
|
||||
|
||||
|
||||
// Kill vanilla bleeding feedback effects.
|
||||
#ifdef DISABLE_VANILLA_DAMAGE_EFFECTS
|
||||
TRACE_1("disabling vanilla bleeding feedback effects",_this);
|
||||
[{
|
||||
{isNil _x} count [
|
||||
"BIS_fnc_feedback_damageCC",
|
||||
"BIS_fnc_feedback_damageRadialBlur",
|
||||
"BIS_fnc_feedback_damageBlur"
|
||||
] == 0
|
||||
}, {
|
||||
{
|
||||
ppEffectDestroy _x;
|
||||
} forEach [
|
||||
BIS_fnc_feedback_damageCC,
|
||||
BIS_fnc_feedback_damageRadialBlur,
|
||||
BIS_fnc_feedback_damageBlur
|
||||
];
|
||||
}] call CBA_fnc_waitUntilAndExecute;
|
||||
#endif
|
||||
|
@ -22,7 +22,7 @@ _unit setVariable [VAR_BLOOD_PRESS, [0, 0], true];
|
||||
// Kill the unit without changing visual apperance
|
||||
[_unit, 1] call EFUNC(medical_engine,setStructuralDamage);
|
||||
|
||||
private _lastShooter = _unit getVariable [QEGVAR(medical_engine,lastShooter), objNull];
|
||||
private _lastInstigator = _unit getVariable [QEGVAR(medical_engine,lastInstigator), objNull];
|
||||
private _lastShooter = _unit getVariable [QEGVAR(medical,lastDamageSource), objNull];
|
||||
private _lastInstigator = _unit getVariable [QEGVAR(medical,lastInstigator), objNull];
|
||||
|
||||
["ace_killed", [_unit, _reason, _lastShooter, _lastInstigator]] call CBA_fnc_globalEvent;
|
||||
|
@ -29,11 +29,16 @@ _nozzle setVelocity [0, 0, 0];
|
||||
|
||||
private _groundPosition = getPosASL _nozzle;
|
||||
private _posA = (getPosASL _nozzle) vectorAdd [0,0,0.05];
|
||||
private _posB = (getPosASL _nozzle) vectorAdd [0,0,-1000];
|
||||
private _posB = (getPosASL _nozzle) vectorAdd [0,0,- GVAR(hoseLength)];
|
||||
private _intersections = lineIntersectsSurfaces [_posA, _posB, _unit, _nozzle, true, 1, "GEOM"];
|
||||
TRACE_1("",_intersections);
|
||||
if (_intersections isEqualTo []) then {
|
||||
_groundPosition set [2, (getTerrainHeightASL _groundPosition) + 0.005];
|
||||
WARNING_1("no ground intersections for nozzle drop @ %1",_groundPosition);
|
||||
if (!isNull _unit) then {
|
||||
_groundPosition = getPosASL _unit; // place at unit's feet
|
||||
} else {
|
||||
_groundPosition set [2, (getTerrainHeightASL _groundPosition) + 0.005];
|
||||
};
|
||||
} else {
|
||||
_groundPosition = ((_intersections select 0) select 0) vectorAdd [0,0,0.005];
|
||||
};
|
||||
|
@ -80,3 +80,23 @@ To create a custom FRIES you will need to look out for a few things:
|
||||
The `onCut` and `onPrepare` functions are responsible for opening/closing the helicopter doors and animating the FRIES (if equipped) when the FRIES gets prepared and the ropes get cut.
|
||||
|
||||
ACE3 provides two functions that are compatible with most helicopters and all ACE3 FRIES. It is recommended to use the naming scheme for doors that is present in the base game so you can use the already existing functions `ace_fastroping_fnc_onCutCommon` and `ace_fastroping_fnc_onPrepareCommon`. You can however define your own functions if you so desire. Note that these functions run in the unscheduled environment, so commands like `sleep` and `waitUntil` will not work unless you use `spawn`. It is recommended to use `ace_common_fnc_waitAndExecute` and `ace_common_fnc_waitUntilAndExecute` instead though.
|
||||
|
||||
## 4. Scripting
|
||||
|
||||
### 4.1. Add FRIES to helicopter
|
||||
|
||||
`ace_fastroping_fnc_equipFRIES`
|
||||
|
||||
| | Arguments | Type | Optional (default value)
|
||||
---| --------- | ---- | ------------------------
|
||||
0 | Helicopter | Object | Required
|
||||
**R** | None | None | Return value
|
||||
|
||||
### 4.2. Remove FRIES from helicopter
|
||||
|
||||
`ace_fastroping_fnc_unequipFRIES`
|
||||
|
||||
| | Arguments | Type | Optional (default value)
|
||||
---| --------- | ---- | ------------------------
|
||||
0 | Helicopter | Object | Required
|
||||
**R** | None | None | Return value
|
||||
|
Loading…
Reference in New Issue
Block a user