Merge branch 'master' into medical-adjustments

Conflicts:
	addons/medical/functions/fnc_actionCheckBloodPressure.sqf
	addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf
	addons/medical/functions/fnc_actionCheckPulse.sqf
	addons/medical/functions/fnc_actionCheckPulseLocal.sqf
This commit is contained in:
Glowbal 2015-08-29 23:49:58 +02:00
commit 4bde554854
147 changed files with 3626 additions and 1041 deletions

View File

@ -1,4 +1,4 @@
# ACE 3 CONTRIBUTOR LIST
# ACE3 CONTRIBUTOR LIST
# If you contributed, but are not listed here, contact me:
# koffeinflummi@gmail.com
#

View File

@ -3,75 +3,75 @@
</p>
<p align="center">
<a href="https://github.com/acemod/ACE3/releases">
<img src="https://img.shields.io/badge/Version-3.2.1-blue.svg" alt="ACE3 version">
<img src="https://img.shields.io/badge/Version-3.2.1-blue.svg" alt="ACE3 Version">
</a>
<a href="https://github.com/acemod/ACE3/releases/download/v3.2.1/ace3_3.2.1.zip">
<img src="http://img.shields.io/badge/Download-56.5_MB-green.svg" alt="ACE3 download">
<img src="http://img.shields.io/badge/Download-56.5_MB-green.svg" alt="ACE3 Download">
</a>
<a href="https://github.com/acemod/ACE3/issues">
<img src="http://img.shields.io/github/issues-raw/acemod/ACE3.svg?label=Issues" alt="ACE3 issues">
<img src="http://img.shields.io/github/issues-raw/acemod/ACE3.svg?label=Issues" alt="ACE3 Issues">
</a>
<a href="http://forums.bistudio.com/showthread.php?191716-ACE3-A-collaborative-merger-between-AGM-CSE-and-ACE&p=2935435&viewfull=1#post2935435">
<img src="https://img.shields.io/badge/BIF-Thread-lightgrey.svg" alt="BIF thread">
<a href="https://forums.bistudio.com/topic/181341-ace3-a-collaborative-merger-between-agm-cse-and-ace/?p=2859670">
<img src="https://img.shields.io/badge/BIF-Thread-lightgrey.svg" alt="BIF Thread">
</a>
<a href="https://github.com/acemod/ACE3/blob/master/LICENSE">
<img src="http://img.shields.io/badge/License-GPLv2-red.svg" alt="ACE3 license">
<img src="http://img.shields.io/badge/License-GPLv2-red.svg" alt="ACE3 License">
</a>
</p>
<p align="center"><sup><strong>Requires the latest version of <a href="http://www.armaholic.com/page.php?id=18767">CBA A3</a>. Visit us on <a href="https://www.facebook.com/ACE3Mod">Facebook</a> | <a href="https://www.youtube.com/c/ACE3Mod">YouTube</a> | <a href="https://twitter.com/ACE3Mod">Twitter</a> | <a href="http://www.reddit.com/r/arma/search?q=ACE&restrict_sr=on&sort=new&t=all">Reddit</a></strong></sup></p>
<p align="center"><sup><strong>Requires the latest version of <a href="https://github.com/CBATeam/CBA_A3/releases">CBA A3</a>. Visit us on <a href="https://www.facebook.com/ACE3Mod">Facebook</a> | <a href="https://www.youtube.com/c/ACE3Mod">YouTube</a> | <a href="https://twitter.com/ACE3Mod">Twitter</a> | <a href="http://www.reddit.com/r/arma/search?q=ACE&restrict_sr=on&sort=new&t=all">Reddit</a></strong></sup></p>
**ACE3** is a joint effort by the teams behind **ACE2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3.
The project is entirely **open-source** and all contributions are welcome. Feel free to maintain your own custom version, so long as the changes you make are open to the public in accordance with the GNU General Public License ([GPLv2](https://github.com/acemod/ACE3/blob/master/LICENSE)).
The mod is **built modularly**, so almost any included PBO can be easily removed from the configuration. This way, a team can maintain its own tailored version of ACE by simply excluding any components they don't need, or those possibly in conflict with other add-ons. Modules themselves, e.g. the medical system, also include various customization options, allowing mission designers to tweak the overall experience.
The mod is **built modularly**, so almost any included PBO can be easily removed from the configuration. This way, a team can maintain its own tailored version of ACE3 by simply excluding any components they don't need, or those possibly in conflict with other mods. Modules themselves, e.g. the medical system, also include various customization options, allowing mission designers to tweak the overall experience.
### Core features
* Brand new 3D interaction/action system
* Performance and reliability framework
* Focus on modularity and customization
* New flexible client and server settings & configuration
* Improved medical system with various levels (basic/advanced) focus on gameplay/realism
* Proper & consistent network-synced weather
* Wind and weather-based ballistics
* Captivity system
* Explosives system, including different trigger types
* Map screen improvements marker placement and map tools
* Advanced missile guidance and laser designation
- Brand new 3D interaction/action system
- Performance and reliability framework
- Focus on modularity and customization
- New flexible client and server settings & configuration
- Improved medical system with various levels (basic/advanced) focus on gameplay/realism
- Proper & consistent network-synced weather
- Wind and weather-based ballistics
- Captivity system
- Explosives system, including different trigger types
- Map screen improvements marker placement and map tools
- Advanced missile guidance and laser designation
#### Additional features
* Carrying and dragging
* Realistic names for vehicles and weapons
* A fire control system (FCS) for armored vehicles and helicopters
* Realistic ballistics/FCS calculated in C/C++ extensions
* Backblast area and overpressure simulation
* Disposable launchers
* Realistic G-forces
* Vehicle locking
* Realistic night and thermal vision modes
* Magazine repacking
* Realistic weapon overheating mechanic
* Combat deafness (temporary loss of hearing) simulation
* Improved ragdoll physics
* Improved interactions for AARs and ammo bearers
* Adjustable sniper scopes
* No idle animation with lowered weapon
* No talking player avatar
* Jumping over obstacles, climbing over walls and cutting down fences
* Vector, MicroDAGR and Kestrel devices<br>
- Carrying and dragging
- Realistic names for vehicles and weapons
- A fire control system (FCS) for armored vehicles and helicopters
- Realistic ballistics/FCS calculated in C/C++ extensions
- Backblast area and overpressure simulation
- Disposable launchers
- Realistic G-forces
- Vehicle locking
- Realistic night and thermal vision modes
- Magazine repacking
- Realistic weapon overheating mechanic
- Combat deafness (temporary loss of hearing) simulation
- Improved ragdoll physics
- Improved interactions for AARs and ammo bearers
- Adjustable sniper scopes
- No idle animation with lowered weapon
- No talking player avatar
- Jumping over obstacles, climbing over walls and cutting down fences
- Vector, MicroDAGR and Kestrel devices<br>
***and much more...***
### Guides & how-tos
If you installed ACE3 but have trouble understanding how it all works, or where to start, read this first:
* [Getting started](http://ace3mod.com/wiki/user/getting-started.html)
- [Getting started](http://ace3mod.com/wiki/user/getting-started.html)
#### Contributing
You can help out with the ongoing development by looking for potential bugs in our code base, or by contributing new features. To contribute something to ACE, simply fork this repository and submit your pull requests for review by other collaborators. Remember to add yourself to the author array of any PBO you will be editing and the [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) file; including a valid email address.
You can help out with the ongoing development by looking for potential bugs in our code base, or by contributing new features. To contribute something to ACE3, simply fork this repository and submit your pull requests for review by other collaborators. Remember to add yourself to the author array of any PBO you will be editing and the [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) file; including a valid email address.
Please, use our [Issue Tracker](https://github.com/acemod/ACE3/issues) to report a bug, propose a feature, or suggest changes to the existing ones. See also:
* [How to report an issue](http://ace3mod.com/wiki/user/how-to-report-an-issue.html)
* [How to make a feature request](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html)
- [How to report an issue](http://ace3mod.com/wiki/user/how-to-report-an-issue.html)
- [How to make a feature request](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html)
#### Testing & building
To help us test the latest development changes, download our master branch ([directly](https://github.com/acemod/ACE3/archive/master.zip), or [with git](https://help.github.com/articles/fetching-a-remote/)), then assemble a test build:
* [Setting up the development environment](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) step-by-step instructions on how to properly setup and build a version of ACE for testing purposes.
- [Setting up the development environment](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) step-by-step instructions on how to properly setup and build a version of ACE3 for testing purposes.

View File

@ -18,6 +18,11 @@ class CfgMovesBasic {
default = "ACE_AmovPercMstpSsurWnonDnon";
PutDown = "";
};
class ACE_CivilHandCuffedFFVActions: ACE_CivilStandHandcuffedActions {
stop = "ACE_HandcuffedFFV";
StopRelaxed = "ACE_HandcuffedFFV";
default = "ACE_HandcuffedFFV";
};
};
};
@ -55,6 +60,14 @@ class CfgMovesMaleSdr: CfgMovesBasic {
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1};
};
//Handcuffed-FFV:
class ACE_HandcuffedFFV: ACE_AmovPercMstpScapWnonDnon {
file = "\A3\cargoposes_F_heli\anim\passenger_flatground_3idleunarmed.rtm";
actions = "ACE_CivilHandCuffedFFVActions";
ConnectTo[] = {};
};
//Surrender Anims:
class ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon: CutSceneAnimationBase {
actions = "ACE_CivilStandSurrenderActions";

View File

@ -12,17 +12,17 @@ class CfgVehicles {
exceptions[] = {};
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
};
class ACE_RemoveHandcuffs {
displayName = CSTRING(ReleaseCaptive);
selection = "righthand";
distance = 2;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs));
exceptions[] = {};
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
};
class ACE_MainActions {
class ACE_RemoveHandcuffs {
displayName = CSTRING(ReleaseCaptive);
selection = "righthand";
distance = 2;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs));
exceptions[] = {};
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
};
class ACE_EscortCaptive {
displayName = CSTRING(EscortCaptive);
distance = 4;
@ -97,7 +97,7 @@ class CfgVehicles {
};
};
#define MACRO_LOADUNLOADCAPTIVE \
#define MACRO_LOADCAPTIVE \
class ACE_Actions { \
class ACE_MainActions { \
class GVAR(LoadCaptive) { \
@ -113,27 +113,27 @@ class CfgVehicles {
class LandVehicle;
class Car: LandVehicle {
MACRO_LOADUNLOADCAPTIVE
MACRO_LOADCAPTIVE
};
class Tank: LandVehicle {
MACRO_LOADUNLOADCAPTIVE
MACRO_LOADCAPTIVE
};
class Air;
class Helicopter: Air {
MACRO_LOADUNLOADCAPTIVE
MACRO_LOADCAPTIVE
};
class Plane: Air {
MACRO_LOADUNLOADCAPTIVE
MACRO_LOADCAPTIVE
};
class Ship;
class Ship_F: Ship {
MACRO_LOADUNLOADCAPTIVE
MACRO_LOADCAPTIVE
};
class StaticWeapon: LandVehicle {
MACRO_LOADUNLOADCAPTIVE
MACRO_LOADCAPTIVE
};
class Box_NATO_Support_F;

View File

@ -6,12 +6,11 @@
if (isServer) then {
addMissionEventHandler ["HandleDisconnect", {
PARAMS_1(_disconnectedPlayer);
params ["_disconnectedPlayer"];
private "_escortedUnit";
_escortedUnit = _disconnectedPlayer getVariable [QGVAR(escortedUnit), objNull];
if ((!isNull _escortedUnit) && {(attachedTo _escortedUnit) == _disconnectedPlayer}) then {
detach _escortedUnit;
//systemChat "debug: DC detach";
};
if (_disconnectedPlayer getVariable [QGVAR(isEscorting), false]) then {
_disconnectedPlayer setVariable [QGVAR(isEscorting), false, true];

View File

@ -16,6 +16,7 @@ PREP(doFriskPerson);
PREP(doLoadCaptive);
PREP(doRemoveHandcuffs);
PREP(doUnloadCaptive);
PREP(findEmptyNonFFVCargoSeat);
PREP(handleGetIn);
PREP(handleGetOut);
PREP(handleKilled);

View File

@ -11,28 +11,36 @@
* The return value <BOOL>
*
* Example:
* [player, bob] call ACE_captives_fnc_canLoadCaptive
* [player, bob, car] call ACE_captives_fnc_canLoadCaptive
*
* Public: No
*/
#include "script_component.hpp"
private ["_objects"];
params ["_unit", "_target","_vehicle"];
if (isNull _target) then {
_objects = attachedObjects _unit;
_objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter);
if ((count _objects) > 0) then {_target = _objects select 0;};
if ((isNull _target) && {_unit getVariable [QGVAR(isEscorting), false]}) then {
//Looking at a vehicle while escorting, get target from attached objects:
{
if (_x getVariable [QGVAR(isHandcuffed), false]) exitWith {
_target = _x;
};
} forEach (attachedObjects _unit);
};
if ((isNull _target) || {(vehicle _target) != _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {false};
if (isNull _vehicle) then {
_objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10];
if ((count _objects) > 0) then {_vehicle = _objects select 0;};
//Looking at a captive unit, search for nearby vehicles with valid seats:
{
if ((_x emptyPositions "cargo") > 0) exitWith {
_vehicle = _x;
};
} forEach (nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]);
} else {
//We have a vehicle picked, make sure it has empty seats:
if ((_vehicle emptyPositions "cargo") == 0) then {
_vehicle = objNull;
};
};
(!isNull _target)
&& {!isNull _vehicle}
&& {_unit getVariable [QGVAR(isEscorting), false]}
&& {_target getVariable [QGVAR(isHandcuffed), false]}
&& {_vehicle emptyPositions "cargo" > 0}
(!isNull _vehicle)

View File

@ -20,4 +20,5 @@ params ["_unit", "_target"];
//Unit is handcuffed and not currently being escorted
_target getVariable [QGVAR(isHandcuffed), false] &&
{isNull (attachedTo _target)}
{isNull (attachedTo _target)} &&
{(vehicle _target) == _target}

View File

@ -35,7 +35,9 @@ if (_state) then {
nil, 20, false, true, "", QUOTE(!isNull (GETVAR(_target,QGVAR(escortedUnit),objNull)))];
[{
EXPLODE_3_PVT((_this select 0),_unit,_target,_actionID);
params ["_args", "_pfID"];
_args params ["_unit", "_target", "_actionID"];
if (_unit getVariable [QGVAR(isEscorting), false]) then {
if (!alive _target || {!alive _unit} || {!canStand _target} || {!canStand _unit} || {_target getVariable ["ACE_isUnconscious", false]} || {_unit getVariable ["ACE_isUnconscious", false]} || {!isNull (attachedTo _unit)}) then {
_unit setVariable [QGVAR(isEscorting), false, true];

View File

@ -18,7 +18,6 @@
private ["_weapon", "_listedItemClasses", "_actions", "_allGear"];
PARAMS_2(_player,_unit);
params ["_player", "_unit"];
_weapon = currentWeapon _player;

View File

@ -1,6 +1,6 @@
/*
* Author: commy2
* Unit loads the target object into a vehicle.
* Unit loads the target object into a vehicle. (logic same as canLoadCaptive)
*
* Arguments:
* 0: Unit that wants to load a captive <OBJECT>
@ -17,24 +17,34 @@
*/
#include "script_component.hpp"
private "_objects";
params ["_unit", "_target","_vehicle"];
if (isNull _target) then {
_objects = attachedObjects _unit;
_objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter);
if ((count _objects) > 0) then {_target = _objects select 0;};
if ((isNull _target) && {_unit getVariable [QGVAR(isEscorting), false]}) then {
//Looking at a vehicle while escorting, get target from attached objects:
{
if (_x getVariable [QGVAR(isHandcuffed), false]) exitWith {
_target = _x;
};
} forEach (attachedObjects _unit);
};
if (isNull _target) exitWith {};
if ((isNull _target) || {(vehicle _target) != _target} || {!(_target getVariable [QGVAR(isHandcuffed), false])}) exitWith {ERROR("");};
if (isNull _vehicle) then {
_objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10];
if ((count _objects) > 0) then {_vehicle = _objects select 0;};
//Looking at a captive unit, search for nearby vehicles with valid seats:
{
// if (([_x] call FUNC(findEmptyNonFFVCargoSeat)) != -1) exitWith {
if ((_x emptyPositions "cargo") > 0) exitWith {
_vehicle = _x;
};
} forEach (nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]);
} else {
// if (([_vehicle] call FUNC(findEmptyNonFFVCargoSeat)) == -1) then {
if ((_vehicle emptyPositions "cargo") == 0) then {
_vehicle = objNull;
};
};
if (isNull _vehicle) exitWith {};
if ((!isNil "_target") && {!isNil "_vehicle"}) then {
_unit setVariable [QGVAR(isEscorting), false, true];
["MoveInCaptive", [_target], [_target, _vehicle]] call EFUNC(common,targetEvent);
};
if (isNull _vehicle) exitWith {ERROR("");};
_unit setVariable [QGVAR(isEscorting), false, true];
["MoveInCaptive", [_target], [_target, _vehicle]] call EFUNC(common,targetEvent);

View File

@ -0,0 +1,67 @@
/*
* Author: PabstMirror
* Finds a free cargo seat, searching non FFV first
*
* Arguments:
* 0: The Vehicle <OBJECT>
*
* Return Value:
* ARRAY [seat index <NUMBER>, is FFV <BOOL>]
*
* Example:
* [car1] call ACE_captives_fnc_findEmptyNonFFVCargoSeat
*
* Public: No
*/
#include "script_component.hpp"
params ["_vehicle"];
TRACE_1("params", _vehicle);
_vehicleConfig = configFile >> "CfgVehicles" >> (typeOf _vehicle);
_proxyOrder = getArray (_vehicleConfig >> "getInProxyOrder");
_transportSoldier = getNumber (_vehicleConfig >> "transportSoldier");
_realCargoCount = if (isArray (_vehicleConfig >> "getInProxyOrder")) then {count _proxyOrder} else {_transportSoldier};
//Find FFV turrets:
_ffvCargoIndexes = [];
{
_turretConfig = [_vehicleConfig, _x] call EFUNC(common,getTurretConfigPath);
_isCargoProxy = ((getText (_turretConfig >> "proxyType")) == "CPCargo") && {isNumber (_turretConfig >> "proxyIndex")};
if (_isCargoProxy) then {
_proxyCargoIndex = getNumber (_turretConfig >> "proxyIndex");
_cargoIndex = _proxyOrder find _proxyCargoIndex;
_ffvCargoIndexes pushBack _cargoIndex;
};
} forEach (allTurrets [_vehicle, true]);
//Find Empty Seats:
_occupiedSeats = [];
{
_x params ["", "", "_xIndex"];
if (_xIndex > -1) then {_occupiedSeats pushBack _xIndex;};
} forEach (fullCrew _vehicle);
TRACE_3("Searching for empty seat",_realCargoCount,_ffvCargoIndexes,_occupiedSeats);
_emptyCargoSeatReturn = [-1, false];
//First seach for non-ffv seats:
for "_index" from 0 to (_realCargoCount - 1) do {
if ((!(_index in _ffvCargoIndexes)) && {!(_index in _occupiedSeats)}) exitWith {
_emptyCargoSeatReturn = [_index, false];
};
};
//Only use FFV if none found:
if (_emptyCargoSeatReturn isEqualTo [-1, false]) then {
for "_index" from 0 to (_realCargoCount - 1) do {
if (!(_index in _occupiedSeats)) exitWith {
_emptyCargoSeatReturn = [_index, true];
};
};
};
_emptyCargoSeatReturn

View File

@ -4,8 +4,8 @@
*
* Arguments:
* 0: _vehicle <OBJECT>
* 2: dunno <OBJECT>
* 1: _unit <OBJECT>
* 1: dunno <OBJECT>
* 2: _unit <OBJECT>
*
* Return Value:
* The return value <BOOL>
@ -17,7 +17,8 @@
*/
#include "script_component.hpp"
params ["_vehicle", "_dontcare","_unit"];
params ["_vehicle", "","_unit"];
TRACE_2("params",_vehicle,_unit);
if (local _unit) then {
if (_unit getVariable [QGVAR(isEscorting), false]) then {
@ -27,4 +28,18 @@ if (local _unit) then {
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
[_unit, false] call FUNC(setSurrender);
};
if (_unit getVariable [QGVAR(isHandcuffed), false]) then {
//Need to force animation for FFV turrets
_turretPath = [];
{
_x params ["_xUnit", "", "", "_xTurretPath"];
if (_unit == _xUnit) exitWith {_turretPath = _xTurretPath};
} forEach (fullCrew (vehicle _unit));
if (!(_turretPath isEqualTo [])) then {
TRACE_1("Setting FFV Handcuffed Animation",_turretPath);
[_unit, "ACE_HandcuffedFFV", 2] call EFUNC(common,doAnimation);
[_unit, "ACE_HandcuffedFFV", 1] call EFUNC(common,doAnimation);
};
};
};

View File

@ -4,8 +4,8 @@
*
* Arguments:
* 0: _vehicle <OBJECT>
* 2: dunno <OBJECT>
* 1: _unit <OBJECT>
* 1: dunno <OBJECT>
* 2: _unit <OBJECT>
*
* Return Value:
* The return value <BOOL>
@ -17,17 +17,21 @@
*/
#include "script_component.hpp"
params ["_vehicle", "_dontcare","_unit"];
params ["_vehicle", "", "_unit"];
TRACE_2("params",_vehicle,_unit);
if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then {
private ["_cargoIndex"];
_cargoIndex = _unit getVariable [QGVAR(CargoIndex), -1];
//If captive was not "unloaded", then move them back into the vehicle.
if (_cargoIndex != -1) exitWith {
if (_cargoIndex != -1) then {
//If captive was not "unloaded", then move them back into the vehicle.
TRACE_1("forcing back into vehicle",_cargoIndex);
_unit moveInCargo [_vehicle, _cargoIndex];
} else {
//Getting out of vehicle:
[_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
};
[_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation);
};

View File

@ -18,7 +18,7 @@
params ["_unit"];
// prevent players from throwing grenades (added to all units)
[_unit, "Throw", {((_this select 1) getVariable [QGVAR(isHandcuffed), false]) || {(_this select 1) getVariable [QGVAR(isSurrendering), false]}}, {}] call EFUNC(common,addActionEventhandler);
// [_unit, "Throw", {systemChat "a"; ((_this select 1) getVariable [QGVAR(isHandcuffed), false]) || {(_this select 1) getVariable [QGVAR(isSurrendering), false]}; true}, {systemChat "b";}] call EFUNC(common,addActionEventhandler);
if (local _unit) then {
// reset status on mission start

View File

@ -26,11 +26,11 @@ if (!_activated) exitWith {};
if (local _logic) then {
//Modules run before postInit can instal the event handler, so we need to wait a little bit
[{
PARAMS_1(_units);
params ["_units"];
{
["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent);
} forEach _units;
}, [_units], 0.05, 0.05]call EFUNC(common,waitAndExecute);
}, [_units], 0.05]call EFUNC(common,waitAndExecute);
deleteVehicle _logic;
};

View File

@ -17,6 +17,7 @@
#include "script_component.hpp"
params ["_unit","_state"];
TRACE_2("params",_unit,_state);
if (!local _unit) exitwith {
ERROR("running setHandcuffed on remote unit");
@ -43,24 +44,47 @@ if (_state) then {
// fix anim on mission start (should work on dedicated servers)
[{
params ["_unit"];
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
if (!(_unit getVariable [QGVAR(isHandcuffed), false])) exitWith {};
if ((vehicle _unit) == _unit) then {
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
} else {
[_unit, "ACE_HandcuffedFFV", 2] call EFUNC(common,doAnimation);
[_unit, "ACE_HandcuffedFFV", 1] call EFUNC(common,doAnimation);
};
//Adds an animation changed eh
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
private "_animChangedEHID";
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
PARAMS_2(_unit,_newAnimation);
//Adds an animation changed eh
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
private "_animChangedEHID";
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
params ["_unit", "_newAnimation"];
TRACE_2("AnimChanged",_unit,_newAnimation);
if (_unit == (vehicle _unit)) then {
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
TRACE_1("Handcuff animation interrupted",_newAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
};
}];
_unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID];
} else {
};
}, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute);
_turretPath = [];
{
_x params ["_xUnit", "", "", "_xTurretPath"];
if (_unit == _xUnit) exitWith {_turretPath = _xTurretPath};
} forEach (fullCrew (vehicle _unit));
TRACE_1("turret Path",_turretPath);
if (_turretPath isEqualTo []) exitWith {};
TRACE_1("Handcuff (FFV) animation interrupted",_newAnimation);
[_unit, "ACE_HandcuffedFFV", 2] call EFUNC(common,doAnimation);
[_unit, "ACE_HandcuffedFFV", 1] call EFUNC(common,doAnimation);
};
}];
TRACE_2("Adding animChangedEH",_unit,_animChangedEHID);
_unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID];
}, [_unit], 0.01] call EFUNC(common,waitAndExecute);
} else {
_unit setVariable [QGVAR(isHandcuffed), false, true];
[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus);
@ -68,6 +92,7 @@ if (_state) then {
//remove AnimChanged EH
private "_animChangedEHID";
_animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
TRACE_1("removing animChanged EH",_animChangedEHID);
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
_unit setVariable [QGVAR(handcuffAnimEHID), -1];

View File

@ -17,6 +17,7 @@
#include "script_component.hpp"
params ["_unit","_state"];
TRACE_2("params",_unit,_state);
if (!local _unit) exitwith {
ERROR("running surrender on remote unit");
@ -43,13 +44,13 @@ if (_state) then {
// fix anim on mission start (should work on dedicated servers)
[{
PARAMS_1(_unit);
params ["_unit"];
if (_unit getVariable [QGVAR(isSurrendering), false] && {(vehicle _unit) == _unit}) then {
//Adds an animation changed eh
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
private "_animChangedEHID";
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
PARAMS_2(_unit,_newAnimation);
params ["_unit", "_newAnimation"];
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then {
TRACE_1("Surrender animation interrupted",_newAnimation);
[_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation);
@ -57,7 +58,7 @@ if (_state) then {
}];
_unit setVariable [QGVAR(surrenderAnimEHID), _animChangedEHID];
};
}, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute);
}, [_unit], 0.01] call EFUNC(common,waitAndExecute);
} else {
_unit setVariable [QGVAR(isSurrendering), false, true];
[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
@ -85,8 +86,8 @@ if (_state) then {
//spin up a PFEH, to watching animationState for the next 20 seconds to make sure we don't enter "hands up"
//Handles long animation chains
[{
PARAMS_2(_args,_pfID);
EXPLODE_2_PVT(_args,_unit,_maxTime);
params ["_args", "_pfID"];
_args params ["_unit", "_maxTime"];
//If waited long enough or they re-surrendered or they are unconscious, exit loop
if ((ACE_time > _maxTime) || {_unit getVariable [QGVAR(isSurrendering), false]} || {_unit getVariable ["ACE_isUnconscious", false]}) exitWith {
[_pfID] call CBA_fnc_removePerFrameHandler;

View File

@ -16,11 +16,17 @@
*/
#include "script_component.hpp"
params ["_target","_vehicle"];
TRACE_2("params",_target,_vehicle);
private ["_cargoIndex"];
params ["_target","_vehicle"];
_getSeat = [_vehicle] call FUNC(findEmptyNonFFVCargoSeat);
TRACE_1("free cargo seat",_getSeat);
_cargoIndex = _getSeat select 0;
if (_cargoIndex == -1) exitWith {ERROR("cargo index -1");};
_target moveInCargo [_vehicle, _cargoIndex];
_target assignAsCargoIndex [_vehicle, _cargoIndex];
_target moveInCargo _vehicle;
_target assignAsCargo _vehicle;
_cargoIndex = _vehicle getCargoIndex _target;
_target setVariable [QGVAR(CargoIndex), _cargoIndex, true];

View File

@ -16,8 +16,11 @@
#include "script_component.hpp"
params ["_unit"];
TRACE_1("params",_unit);
_unit setVariable [QGVAR(CargoIndex), -1, true];
moveOut _unit;
[_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
unassignVehicle _unit;

View File

@ -1,6 +1,8 @@
#define COMPONENT captives
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
#ifdef DEBUG_ENABLED_CAPTIVES
#define DEBUG_MODE_FULL
#endif

View File

@ -18,6 +18,8 @@
params ["_player", "_object"];
if (!([_player, _object, []] call EFUNC(common,canInteractWith))) exitWith {false};
private ["_nearestVehicle"];
_nearestVehicle = [_player] call FUNC(findNearestVehicle);

View File

@ -39,7 +39,10 @@ SETMVAR(GVAR(initializedClasses),_initializedClasses);
if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitWith {};
private ["_text", "_condition", "_statement", "_icon", "_action"];
_condition = {GVAR(enable)};
_condition = {
params ["_target", "_player"];
GVAR(enable) && {[_player, _target, []] call EFUNC(common,canInteractWith)}
};
_text = localize LSTRING(openMenu);
_statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);};
_icon = "";

View File

@ -327,7 +327,7 @@ GVAR(OldIsCamera) = false;
// Lastly, do JIP events
// JIP Detection and event trigger. Run this at the very end, just in case anything uses it
if(isMultiplayer && { ACE_time > 0 || isNull player } ) then {
if (didJip) then {
// We are jipping! Get ready and wait, and throw the event
[{
if(!(isNull player)) then {

View File

@ -74,6 +74,7 @@ class CfgVehicles {
scope = 2;
displayName = $STR_ACE_CONCERTINA_WIRE;
model = PATHTOF(data\ACE_ConcertinaWire.p3d);
EGVAR(logistics_wirecutter,isFence) = 1;
class ACE_Actions {
class ACE_MainActions {
selection = "";

View File

@ -19,4 +19,10 @@ class ACE_Settings {
isClientSettable = 1;
displayName = CSTRING(DisableEarRinging);
};
class GVAR(enabledForZeusUnits) {
value = 1;
typeName = "BOOL";
displayName = CSTRING(enabledForZeusUnits_DisplayName);
description = CSTRING(enabledForZeusUnits_Description);
};
};

View File

@ -130,6 +130,12 @@ class CfgVehicles {
};
};
};
class enabledForZeusUnits {
displayName = CSTRING(enabledForZeusUnits_DisplayName);
description = CSTRING(enabledForZeusUnits_Description);
typeName = "BOOL";
defaultValue = 1;
};
};
class ModuleDescription {
description = CSTRING(Module_Description);

View File

@ -47,5 +47,16 @@ class CfgWeapons {
GVAR(lowerVolume) = 0.60;
};
class H_Cap_marshal: H_Cap_headphones {};
};
class H_HelmetB_light: H_HelmetB {
GVAR(protection) = 0.8;
GVAR(lowerVolume) = 0.20;
};
class H_HelmetB_plain_mcamo;
class H_HelmetSpecB: H_HelmetB_plain_mcamo {
GVAR(protection) = 0.8;
GVAR(lowerVolume) = 0.20;
};
};

View File

@ -21,6 +21,7 @@ PARAMS_2(_unit,_strength);
if (_unit != ACE_player) exitWith {};
if (_strength < 0.05) exitWith {};
if (!isNull curatorCamera) exitWith {};
if ((!GVAR(enabledForZeusUnits)) && {player != ACE_player}) exitWith {};
if (_unit getVariable ["ACE_hasEarPlugsin", false]) then {
_strength = _strength / 4;

View File

@ -21,4 +21,6 @@ if ((_logic getVariable "DisableEarRinging") != -1) then {
[_logic, QGVAR(DisableEarRinging), "DisableEarRinging"] call EFUNC(common,readSettingFromModule);
};
[_logic, QGVAR(enabledForZeusUnits), "enabledForZeusUnits"] call EFUNC(common,readSettingFromModule);
diag_log text "[ACE]: Hearing Module Initialized.";

View File

@ -118,7 +118,7 @@
<Portuguese>Audição</Portuguese>
</Key>
<Key ID="STR_ACE_Hearing_CombatDeafness_DisplayName">
<English>Enable combat deafness?</English>
<English>Combat Deafness</English>
<Polish>Wł. głuchotę bojową</Polish>
<Spanish>¿Habilitar sordera de combate?</Spanish>
<German>Aktiviere Taubheit im Gefecht?</German>
@ -140,5 +140,11 @@
<Czech>Ztráta sluchu je možná ve chvíly, kdy se v bezprostřední blízkosti střílí z velkorážní zbraně nebo při bombardování a osoba je bez ochrany sluchu (např. špunty). Tento modul umožňuje tuto věc povolit nebo zakázat.</Czech>
<Portuguese>Este módulo ativa / desativa surdez em combate. Quando ativado, os jogadores podem ficar surdos quando uma arma é disparada ao seu redor ou uma explosão ocorre sem proteção auditiva.</Portuguese>
</Key>
<Key ID="STR_ACE_Hearing_enabledForZeusUnits_DisplayName">
<English>Effect Zeus RC</English>
</Key>
<Key ID="STR_ACE_Hearing_enabledForZeusUnits_Description">
<English>Allow zeus remote controlled units to be able to take hearing damage.</English>
</Key>
</Package>
</Project>

View File

@ -7,13 +7,13 @@
* 0: HuntIR <OBJECT>
*
* Return Value:
* Nothing
* None
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_huntIR);
params ["_huntIR"];
GVAR(huntIR) = _huntIR;
GVAR(pos) = getPosVisual GVAR(huntIR);
@ -73,7 +73,8 @@ GVAR(no_cams) sort true;
if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))} && {_x getHitPointDamage "HitCamera" < 0.25}) then {
GVAR(no_cams) pushBack _x;
};
} forEach GVAR(nearHuntIRs);
true
} count GVAR(nearHuntIRs);
{
if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))} || {_x getHitPointDamage "HitCamera" >= 0.25}) then {
GVAR(no_cams) deleteAt _forEachIndex;
@ -82,19 +83,19 @@ GVAR(no_cams) sort true;
};
};
} forEach GVAR(no_cams);
GVAR(cur_cam) = 0 max GVAR(cur_cam) min ((count GVAR(no_cams)) - 1);
if (count GVAR(no_cams) > 0) then {
GVAR(huntIR) = GVAR(no_cams) select GVAR(cur_cam);
};
GVAR(pos) = getPosVisual GVAR(huntIR);
if ((!dialog) || (count GVAR(no_cams) == 0) || ((GVAR(pos) select 2) <= 20)) exitWith {
[_this select 1] call cba_fnc_removePerFrameHandler;
GVAR(stop) = true;
GVAR(pphandle) ppEffectEnable true;
ppEffectDestroy GVAR(pphandle);
@ -108,7 +109,7 @@ GVAR(no_cams) sort true;
deleteVehicle GVAR(logic);
if (player != ACE_player) then {
player remoteControl ACE_player;
};
};
};
switch (GVAR(ZOOM)) do {
@ -131,7 +132,7 @@ GVAR(no_cams) sort true;
};
private ["_cam_coord_y", "_cam_coord_x", "_cam_time", "_cam_pos"];
GVAR(logic) setPosATL (GVAR(pos) vectorAdd [0, 0, -5]);
GVAR(logic) setDir GVAR(ROTATE);
GVAR(logic) setVectorUp [0.0001, 0.0001, 1];

View File

@ -13,19 +13,19 @@
* 6: projectile - Object of the projectile that was shot <OBJECT>
*
* Return Value:
* Nothing
* None
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_7(_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"];
if (_ammo != "F_HuntIR") exitWith {};
[{
PARAMS_1(_projectile);
params ["_projectile"];
//If null (deleted or hit water) exit:
if (isNull _projectile) exitWith {};
//If it's not spinning (hit ground), bail:
@ -33,15 +33,16 @@ if (_ammo != "F_HuntIR") exitWith {};
"ACE_HuntIR_Propell" createVehicle (getPosATL _projectile);
[{
PARAMS_1(_position);
private ["_huntir"];
params ["_position"];
_huntir = createVehicle ["ACE_HuntIR", _position, [], 0, "FLY"];
_huntir setPosATL _position;
_huntir setVariable [QGVAR(startTime), ACE_time, true];
[{
EXPLODE_1_PVT(_this select 0,_huntir);
params ["_args", "_idPFH"];
_args params ["_huntir"];
if (isNull _huntir) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
private ["_parachuteDamage", "_velocity"];
_parachuteDamage = _huntir getHitPointDamage "HitParachute";

View File

@ -4,10 +4,10 @@
* HuntIR monitor system
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Nothing
* None
*
* Public: No
*/
@ -35,21 +35,21 @@ createDialog "ace_huntir_cam_dialog_off";
GVAR(connectionDelay) = 5;
GVAR(state) = "searching";
GVAR(message) = [];
GVAR(messageSearching) = toArray "Searching.....";
GVAR(messageSearching) = toArray "Searching.....";
GVAR(messageConnecting) = toArray "Connecting.....";
[{
//Close monitor if we no longer have item:
if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNameSpace getVariable ["ace_huntir_monitor", displayNull])}) then {
closeDialog 0;
};
private ["_elapsedTime", "_nearestHuntIRs"];
_elapsedTime = ACE_time - GVAR(startTime);
_nearestHuntIRs = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE];
if ((!dialog) || GVAR(done)) exitWith {
[_this select 1] call cba_fnc_removePerFrameHandler;
if (dialog && GVAR(state) == "connected") then {
[_nearestHuntIRs select 0] call FUNC(cam);
} else {

View File

@ -4,10 +4,10 @@
* HuntIR monitor compass
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Nothing
* None
*
* Public: No
*/
@ -32,7 +32,7 @@ disableSerialization;
private ["_fnc_correctIt"];
_fnc_correctIt = {
PARAMS_2(_pos,_dir);
params ["_pos", "_dir"];
if (_dir >= 270 || {_dir <= 90}) then {
_pos set [1, (_pos select 1) + __OFFSET_Y]
};
@ -51,16 +51,17 @@ _fnc_correctIt = {
HUNTIR_CAM_ROSE_LAYER_ID cutRsc ["ace_huntir_cam_rose", "PLAIN"];
[{
EXPLODE_1_PVT(_this select 0,_fnc_correctIt);
params ["_args", "_idPFH"];
_args params ["_fnc_correctIt"];
if (GVAR(stop)) exitWith {
HUNTIR_CAM_ROSE_LAYER_ID cutText ["", "PLAIN"];
[_this select 1] call CBA_fnc_removePerFrameHandler;
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
private ["_dir", "_x1", "_y1", "_pos"];
_dir = getDir GVAR(cam); // direction player;
_x1 = __CENTER_X - (__RADIUS * sin(_dir));
_y1 = __CENTER_Y - (__RADIUS * cos(_dir));
_pos = [[_x1, _y1], _dir] call _fnc_correctIt;
@ -84,5 +85,5 @@ HUNTIR_CAM_ROSE_LAYER_ID cutRsc ["ace_huntir_cam_rose", "PLAIN"];
_pos = [[_x1, _y1], _dir] call _fnc_correctIt;
__CHAR_E ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT];
__CHAR_E ctrlCommit 0;
}, 0.01, [_fnc_correctIt]] call CBA_fnc_addPerFrameHandler;

View File

@ -501,8 +501,8 @@ class CfgVehicles {
class ACE_Push {
displayName = CSTRING(Push);
distance = 6;
condition = QUOTE(getMass _target < 1000 && {alive _target});
statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call DFUNC(push););
condition = QUOTE(((getMass _target) <= 2600) && {alive _target} && {(vectorMagnitude (velocity _target)) < 3});
statement = QUOTE(_this call FUNC(push));
showDisabled = 0;
priority = -1;
};

View File

@ -10,6 +10,13 @@ ACE_Modifier = 0;
_group selectLeader _leader;
}] call EFUNC(common,addEventHandler);
//Pushing boats from FUNC(push)
[QGVAR(pushBoat), {
params ["_boat", "_newVelocity"];
_boat setVelocity _newVelocity;
}] call EFUNC(common,addEventHandler);
if (!hasInterface) exitWith {};
GVAR(isOpeningDoor) = false;

View File

@ -4,23 +4,23 @@
*
* Arguments:
* 0: Boat <OBJECT>
* 1: Velocity <ARRAY>
* 1: Player <OBJECT>
*
* Return Value:
* None
*
* Example:
* [target, [vector]] call ace_interaction_fnc_push
* [Boats, Jose] call ace_interaction_fnc_push
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_boat,_velocity);
params ["_boat", "_player"];
if !(local _boat) exitWith {
[_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc);
};
private ["_newVelocity"];
_boat setVelocity _velocity;
_newVelocity = [2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5];
[QGVAR(pushBoat), [_boat], [_boat, _newVelocity]] call EFUNC(common,targetEvent);

View File

@ -0,0 +1,8 @@
class asdg_SlotInfo;
class asdg_FrontSideRail: asdg_SlotInfo {
class compatibleItems {
ACE_acc_pointer_red = 1;
ACE_acc_pointer_green = 1;
ACE_acc_pointer_green_IR = 1;
};
};

View File

@ -16,3 +16,4 @@ class CfgPatches {
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "CfgJointRails.hpp"

View File

@ -5,4 +5,22 @@ class CfgVehicles {
MACRO_ADDITEM(ACE_wirecutter,4);
};
};
class Wall_F;
class NonStrategic;
class Land_Net_Fence_4m_F: Wall_F { GVAR(isFence) = 1; };
class Land_Net_Fence_8m_F: Wall_F { GVAR(isFence) = 1; };
class Land_Net_FenceD_8m_F: Wall_F { GVAR(isFence) = 1; };
class Land_New_WiredFence_5m_F: Wall_F { GVAR(isFence) = 1; };
class Land_New_WiredFence_10m_Dam_F: Wall_F { GVAR(isFence) = 1; };
class Land_New_WiredFence_10m_F: Wall_F { GVAR(isFence) = 1; };
class Land_Pipe_fence_4m_F: Wall_F { GVAR(isFence) = 1; };
class Land_Pipe_fence_4mNoLC_F: Wall_F { GVAR(isFence) = 1; };
class Land_SportGround_fence_F: Wall_F { GVAR(isFence) = 1; };
class Land_Wired_Fence_4m_F: Wall_F { GVAR(isFence) = 1; };
class Land_Wired_Fence_4mD_F: Wall_F { GVAR(isFence) = 1; };
class Land_Wired_Fence_8m_F: Wall_F { GVAR(isFence) = 1; };
class Land_Wired_Fence_8mD_F: Wall_F { GVAR(isFence) = 1; };
class Land_Razorwire_F: NonStrategic { GVAR(isFence) = 1; };
};

View File

@ -10,7 +10,7 @@ class CfgWeapons {
picture = QUOTE(PATHTOF(ui\item_wirecutter_ca.paa));
scope = 2;
class ItemInfo: InventoryItem_Base_F {
mass = 100;
mass = 65;
};
};
};

View File

@ -3,9 +3,6 @@
ADDON = false;
PREP(cutDownFence);
PREP(cutDownFenceAbort);
PREP(cutDownFenceCallback);
PREP(getNearestFence);
PREP(interactEH);
PREP(isFence);

View File

@ -16,21 +16,35 @@
*/
#include "script_component.hpp"
#define SOUND_CLIP_TIME_SPACEING 1.5
private ["_timeToCut", "_progressCheck"];
params ["_unit", "_fenceObject"];
TRACE_2("params",_unit,_fenceObject);
private ["_timeToCut", "_progressCheck", "_onCompletion", "_onFail"];
PARAMS_2(_unit,_fenceObject);
if (_unit != ACE_player) exitWith {};
_timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {7.5} else {11};
[ACE_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation);
_onCompletion = {
TRACE_1("_onCompletion",_this);
(_this select 0) params ["_fenceObject", "", "_unit"];
_fenceObject setdamage 1;
[_unit, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);
};
_onFail = {
TRACE_1("_onFail", _this);
(_this select 0) params ["", "", "_unit"];
[_unit, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);
};
_progressCheck = {
PARAMS_2(_args,_passedTime);
EXPLODE_2_PVT(_args,_fenceObject,_lastSoundEffectTime);
params ["_args", "_passedTime"];
_args params ["_fenceObject", "_lastSoundEffectTime"];
if (_passedTime > (_lastSoundEffectTime + SOUND_CLIP_TIME_SPACEING)) then {
// playSound "ACE_wirecutter_sound";
playSound3D [QUOTE(PATHTO_R(sound\wirecut.ogg)), objNull, false, (getPosASL ACE_player), 3, 1, 10];
_args set [1, _passedTime];
};
@ -38,4 +52,4 @@ _progressCheck = {
((!isNull _fenceObject) && {(damage _fenceObject) < 1} && {("ACE_wirecutter" in (items ACE_player))})
};
[_timeToCut, [_fenceObject,0], {(_this select 0) call FUNC(cutDownFenceCallback)}, {(_this select 0) call FUNC(cutDownFenceAbort)}, localize LSTRING(CuttingFence), _progressCheck] call EFUNC(common,progressBar);
[_timeToCut, [_fenceObject,0,_unit], _onCompletion, _onFail, localize LSTRING(CuttingFence), _progressCheck] call EFUNC(common,progressBar);

View File

@ -1,18 +0,0 @@
/*
* Author: commy2
* Stops cutting down fence (reset animation)
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* [] call ace_logistics_wirecutter_fnc_cutDownFenceAbort
*
* Public: No
*/
#include "script_component.hpp"
[ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);

View File

@ -1,22 +0,0 @@
/*
* Author: PabstMirror
* Once progressbar is done: Fence is cutdown
*
* Arguments:
* 0: Fence Object <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [aFence] call ace_logistics_wirecutter_fnc_cutDownFenceCallback
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_fenceObject);
_fenceObject setdamage 1;
// [localize LSTRING(FenceCut)] call EFUNC(common,displayTextStructured);
[ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);

View File

@ -1,28 +0,0 @@
/*
* Author: PabstMirror
* Gets nearest fence object (not actully used, left for utility)
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* The return value <OBJECT>
*
* Example:
* [player] call ace_logistics_wirecutter_fnc_getNearestFence
*
* Public: Yes
*/
#include "script_component.hpp"
private "_nearestFence";
PARAMS_1(_unit);
_nearestFence = objNull;
{
if ((isNull _nearestFence) && {[_x] call FUNC(isFence)}) then {
_nearestFence = _x;
};
} forEach nearestObjects [_unit, [], 15];
_nearestFence

View File

@ -15,22 +15,24 @@
*/
#include "script_component.hpp"
PARAMS_1(_interactionType);
params ["_interactionType"];
//Ignore self-interaction menu
if (_interactionType != 0) exitWith {};
//Ignore self-interaction menu or mounted vehicle interaction
if ((_interactionType != 0) || {(vehicle ACE_player) != ACE_player}) exitWith {};
//for performance only do stuff it they have a wirecutter item
//(if they somehow get one durring keydown they'll just have to reopen)
if (!("ACE_wirecutter" in (items ace_player))) exitWith {};
TRACE_1("Starting wire-cut action PFEH",_interactionType);
[{
private ["_fncStatement", "_attachedFence", "_fncCondition", "_helper", "_action"];
PARAMS_2(_args,_pfID);
EXPLODE_3_PVT(_args,_setPosition,_addedHelpers,_fencesHelped);
params ["_args", "_pfID"];
_args params ["_setPosition", "_addedHelpers", "_fencesHelped"];
if (!EGVAR(interact_menu,keyDown)) then {
{deleteVehicle _x;} forEach _addedHelpers;
{deleteVehicle _x; nil} count _addedHelpers;
[_pfID] call CBA_fnc_removePerFrameHandler;
} else {
// Prevent Rare Error when ending mission with interact key down:
@ -40,11 +42,12 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {};
if (((getPosASL ace_player) distance _setPosition) > 5) then {
_fncStatement = {
PARAMS_3(_dummyTarget,_player,_attachedFence);
params ["", "_player", "_attachedFence"];
[_player, _attachedFence] call FUNC(cutDownFence);
};
_fncCondition = {
PARAMS_3(_dummyTarget,_player,_attachedFence);
params ["", "_player", "_attachedFence"];
if (!([_player, _attachedFence, []] call EFUNC(common,canInteractWith))) exitWith {false};
((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items _player))})
};
@ -52,15 +55,15 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {};
if (!(_x in _fencesHelped)) then {
if ([_x] call FUNC(isFence)) then {
_fencesHelped pushBack _x;
_helper = "Sign_Sphere25cm_F" createVehicleLocal (getpos _x);
_helper = "ACE_LogicDummy" createVehicleLocal (getpos _x);
_action = [QGVAR(helperCutFence), (localize LSTRING(CutFence)), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, [0,0,0], 5] call EFUNC(interact_menu,createAction);
[_helper, 0, [],_action] call EFUNC(interact_menu,addActionToObject);
_helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]);
_helper hideObject true;
_addedHelpers pushBack _helper;
};
};
} forEach nearestObjects [ace_player, [], 15];
nil
} count nearestObjects [ace_player, [], 15];
_args set [0, (getPosASL ace_player)];
};

View File

@ -16,27 +16,26 @@
*/
#include "script_component.hpp"
//find is case sensitive, so keep everything lowercase
#define FENCE_TYPENAMES ["land_net_fence_4m_f", "land_net_fence_8m_f", "land_net_fenced_8m_f", "land_new_wiredfence_5m_f", "land_new_wiredfence_10m_dam_f", "land_new_wiredfence_10m_f", "land_pipe_fence_4m_f", "land_pipe_fence_4mnolc_f", "land_sportground_fence_f", "land_wired_fence_4m_f", "land_wired_fence_4md_f", "land_wired_fence_8m_f", "land_wired_fence_8md_f", "land_razorwire_f", "ace_concertinawire"]
#define FENCE_P3DS ["mil_wiredfence_f.p3d","wall_indfnc_3.p3d", "wall_indfnc_9.p3d", "wall_indfnc_corner.p3d", "pletivo_wired.p3d", "wall_fen1_5.p3d"]
params ["_object"];
TRACE_1("params",_object);
private ["_typeOf", "_returnValue"];
PARAMS_1(_object);
_typeOf = toLower (typeOf _object);
_typeOf = typeOf _object;
_returnValue = false;
if (_typeOf != "") then {
//If the fence has configEntry we can check it directly
_returnValue = _typeOf in FENCE_TYPENAMES;
_returnValue = (1 == (getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(isFence))));
} else {
//TODO: 1.50 use getModelInfo
_typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d"
{
if ((_typeOf find _x) != -1) exitWith {
_returnValue = true;
};
} forEach FENCE_P3DS;
nil
} count FENCE_P3DS;
};
_returnValue

View File

@ -1,6 +1,8 @@
#define COMPONENT logistics_wirecutter
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
#ifdef DEBUG_ENABLED_LOGISTICS_WIRECUTTER
#define DEBUG_MODE_FULL
#endif
@ -10,3 +12,9 @@
#endif
#include "\z\ace\addons\main\script_macros.hpp"
//find is case sensitive, so keep everything lowercase
#define FENCE_P3DS ["mil_wiredfence_f.p3d","wall_indfnc_3.p3d", "wall_indfnc_9.p3d", "wall_indfnc_corner.p3d", "pletivo_wired.p3d", "wall_fen1_5.p3d"]
#define SOUND_CLIP_TIME_SPACEING 1.5

View File

@ -541,7 +541,7 @@ class CfgPatches {
"a3_weapons_f_vests",
"a3data",
"map_vr",
"extended_eventhandlers", "CBA_UI", "CBA_XEH", "CBA_XEH_A3"
"extended_eventhandlers", "cba_ui", "cba_xeh", "cba_xeh_a3", "cba_jr"
};
author[] = {"ACE Team"};
authorUrl = "";

View File

@ -97,5 +97,87 @@
// Time functions for accuracy per frame
#define ACE_tickTime (ACE_time + (diag_tickTime - ACE_diagTime))
#define ACE_LOG(module,level,message) diag_log text ACE_LOGFORMAT(module,level,message)
#define ACE_LOGFORMAT(module,level,message) FORMAT_2(QUOTE([ACE] (module) %1: %2),level,message)
#include "script_debug.hpp"
#define ACE_LOGERROR(message) ACE_LOG(COMPONENT,"ERROR",message)
#define ACE_LOGERROR_1(message,arg1) ACE_LOGERROR(FORMAT_1(message,arg1))
#define ACE_LOGERROR_2(message,arg1,arg2) ACE_LOGERROR(FORMAT_2(message,arg1,arg2))
#define ACE_LOGERROR_3(message,arg1,arg2,arg3) ACE_LOGERROR(FORMAT_3(message,arg1,arg2,arg3))
#define ACE_LOGERROR_4(message,arg1,arg2,arg3,arg4) ACE_LOGERROR(FORMAT_4(message,arg1,arg2,arg3,arg4))
#define ACE_LOGERROR_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGERROR(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
#define ACE_LOGERROR_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGERROR(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
#define ACE_LOGERROR_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGERROR(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
#define ACE_LOGERROR_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGERROR(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
#define ACE_ERRORFORMAT(message) ACE_LOGFORMAT(COMPONENT,"ERROR",message)
#define ACE_ERRORFORMAT_1(message,arg1) ACE_ERRORFORMAT(FORMAT_1(message,arg1))
#define ACE_ERRORFORMAT_2(message,arg1,arg2) ACE_ERRORFORMAT(FORMAT_2(message,arg1,arg2))
#define ACE_ERRORFORMAT_3(message,arg1,arg2,arg3) ACE_ERRORFORMAT(FORMAT_3(message,arg1,arg2,arg3))
#define ACE_ERRORFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_ERRORFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4))
#define ACE_ERRORFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_ERRORFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
#define ACE_ERRORFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_ERRORFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
#define ACE_ERRORFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_ERRORFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
#define ACE_ERRORFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_ERRORFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
#define ACE_LOGWARNING(message) ACE_LOG(COMPONENT,"WARNING",message)
#define ACE_LOGWARNING_1(message,arg1) ACE_LOGWARNING(FORMAT_1(message,arg1))
#define ACE_LOGWARNING_2(message,arg1,arg2) ACE_LOGWARNING(FORMAT_2(message,arg1,arg2))
#define ACE_LOGWARNING_3(message,arg1,arg2,arg3) ACE_LOGWARNING(FORMAT_3(message,arg1,arg2,arg3))
#define ACE_LOGWARNING_4(message,arg1,arg2,arg3,arg4) ACE_LOGWARNING(FORMAT_4(message,arg1,arg2,arg3,arg4))
#define ACE_LOGWARNING_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGWARNING(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
#define ACE_LOGWARNING_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGWARNING(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
#define ACE_LOGWARNING_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGWARNING(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
#define ACE_LOGWARNING_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGWARNING(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
#define ACE_WARNINGFORMAT(message) ACE_LOGFORMAT(COMPONENT,"WARNING",message)
#define ACE_WARNINGFORMAT_1(message,arg1) ACE_WARNINGFORMAT(FORMAT_1(message,arg1))
#define ACE_WARNINGFORMAT_2(message,arg1,arg2) ACE_WARNINGFORMAT(FORMAT_2(message,arg1,arg2))
#define ACE_WARNINGFORMAT_3(message,arg1,arg2,arg3) ACE_WARNINGFORMAT(FORMAT_3(message,arg1,arg2,arg3))
#define ACE_WARNINGFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_WARNINGFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4))
#define ACE_WARNINGFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_WARNINGFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
#define ACE_WARNINGFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_WARNINGFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
#define ACE_WARNINGFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_WARNINGFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
#define ACE_WARNINGFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_WARNINGFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
#define ACE_LOGINFO(message) ACE_LOG(COMPONENT,"INFO",message)
#define ACE_LOGINFO_1(message,arg1) ACE_LOGINFO(FORMAT_1(message,arg1))
#define ACE_LOGINFO_2(message,arg1,arg2) ACE_LOGINFO(FORMAT_2(message,arg1,arg2))
#define ACE_LOGINFO_3(message,arg1,arg2,arg3) ACE_LOGINFO(FORMAT_3(message,arg1,arg2,arg3))
#define ACE_LOGINFO_4(message,arg1,arg2,arg3,arg4) ACE_LOGINFO(FORMAT_4(message,arg1,arg2,arg3,arg4))
#define ACE_LOGINFO_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGINFO(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
#define ACE_LOGINFO_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGINFO(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
#define ACE_LOGINFO_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGINFO(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
#define ACE_LOGINFO_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGINFO(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
#define ACE_INFOFORMAT(message) ACE_LOGFORMAT(COMPONENT,"INFO",message)
#define ACE_INFOFORMAT_1(message,arg1) ACE_INFOFORMAT(FORMAT_1(message,arg1))
#define ACE_INFOFORMAT_2(message,arg1,arg2) ACE_INFOFORMAT(FORMAT_2(message,arg1,arg2))
#define ACE_INFOFORMAT_3(message,arg1,arg2,arg3) ACE_INFOFORMAT(FORMAT_3(message,arg1,arg2,arg3))
#define ACE_INFOFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_INFOFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4))
#define ACE_INFOFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_INFOFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
#define ACE_INFOFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_INFOFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
#define ACE_INFOFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_INFOFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
#define ACE_INFOFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_INFOFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
#define ACE_LOGDEBUG(message) ACE_LOG(COMPONENT,"DEBUG",message)
#define ACE_LOGDEBUG_1(message,arg1) ACE_LOGDEBUG(FORMAT_1(message,arg1))
#define ACE_LOGDEBUG_2(message,arg1,arg2) ACE_LOGDEBUG(FORMAT_2(message,arg1,arg2))
#define ACE_LOGDEBUG_3(message,arg1,arg2,arg3) ACE_LOGDEBUG(FORMAT_3(message,arg1,arg2,arg3))
#define ACE_LOGDEBUG_4(message,arg1,arg2,arg3,arg4) ACE_LOGDEBUG(FORMAT_4(message,arg1,arg2,arg3,arg4))
#define ACE_LOGDEBUG_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGDEBUG(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
#define ACE_LOGDEBUG_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGDEBUG(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
#define ACE_LOGDEBUG_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGDEBUG(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
#define ACE_LOGDEBUG_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGDEBUG(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
#define ACE_DEBUGFORMAT(message) ACE_LOGFORMAT(COMPONENT,"DEBUG",message)
#define ACE_DEBUGFORMAT_1(message,arg1) ACE_DEBUGFORMAT(FORMAT_1(message,arg1))
#define ACE_DEBUGFORMAT_2(message,arg1,arg2) ACE_DEBUGFORMAT(FORMAT_2(message,arg1,arg2))
#define ACE_DEBUGFORMAT_3(message,arg1,arg2,arg3) ACE_DEBUGFORMAT(FORMAT_3(message,arg1,arg2,arg3))
#define ACE_DEBUGFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_DEBUGFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4))
#define ACE_DEBUGFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_DEBUGFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
#define ACE_DEBUGFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_DEBUGFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
#define ACE_DEBUGFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_DEBUGFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
#define ACE_DEBUGFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_DEBUGFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
#include "script_debug.hpp"

View File

@ -154,7 +154,7 @@ class ACE_Medical_Actions {
class Tourniquet: fieldDressing {
displayName = CSTRING(Apply_Tourniquet);
displayNameProgress = CSTRING(Applying_Tourniquet);
allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r", "body"};
allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"};
items[] = {"ACE_tourniquet"};
treatmentTime = 4;
callbackSuccess = QUOTE(DFUNC(treatmentTourniquet));

View File

@ -13,5 +13,6 @@
*/
#include "script_component.hpp"
params ["_caller", "_target"];
[[_caller, _target], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
params ["_caller", "_target", "_selectionName"];
[[_caller, _target, _selectionName], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -15,7 +15,7 @@
#include "script_component.hpp"
private ["_bloodPressure", "_logOutPut", "_output"];
params ["_caller", "_target"];
params ["_caller", "_target", "_selectionName"];
_bloodPressure = if (!alive _target) then {
[0,0]
@ -52,6 +52,11 @@ if ([_caller] call FUNC(isMedic)) then {
};
};
if (_selectionName in ["hand_l","hand_r"] && {[_unit, _selectionName] call FUNC(hasTourniquetAppliedTo)}) then {
_output = LSTRING(Check_Bloodpressure_Output_6);
_logOutPut = "";
};
["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent);
if (_logOutPut != "") then {

View File

@ -13,5 +13,7 @@
*/
#include "script_component.hpp"
params ["_caller","_target"];
[[_caller, _target], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
params ["_caller","_target", "_selectionName"];
[[_caller, _target, _selectionName], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -15,8 +15,7 @@
#include "script_component.hpp"
private ["_heartRateOutput", "_heartRate", "_logOutPut"];
params ["_caller", "_unit"];
params ["_caller", "_unit", "_selectionName"];
_heartRate = _unit getvariable [QGVAR(heartRate), 80];
if (!alive _unit) then {
@ -45,6 +44,11 @@ if (_heartRate > 1.0) then {
};
};
if (_selectionName in ["hand_l","hand_r"] && {[_unit, _selectionName] call FUNC(hasTourniquetAppliedTo)}) then {
_heartRateOutput = LSTRING(Check_Pulse_Output_5);
_logOutPut = LSTRING(Check_Pulse_None);
};
["displayTextStructured", [_caller], [[_heartRateOutput, [_unit] call EFUNC(common,getName), round(_heartRate)], 1.5, _caller]] call EFUNC(common,targetEvent);
if (_logOutPut != "") then {

View File

@ -37,7 +37,7 @@ class CfgVehicles {
displayName = CSTRING(Module_DisplayName);
function = QFUNC(moduleMapFill);
scope = 2;
isGlobal = 1;
isGlobal = 0;
icon = QUOTE(PATHTOF(UI\Icon_Module_microDAGR_ca.paa));
functionPriority = 0;
class Arguments {
@ -46,9 +46,9 @@ class CfgVehicles {
description = CSTRING(MapDataAvailable_Description);
typeName = "NUMBER";
class values {
class None {name = CSTRING(None); value = MAP_DETAIL_SAT; default = 1;};
class Side {name = CSTRING(Side); value = MAP_DETAIL_TOPOROADS;};
class Unique {name = CSTRING(Unique); value = MAP_DETAIL_NONE;};
class Full {name = CSTRING(MapFill_Full); value = MAP_DETAIL_SAT; default = 1;};
class Roads {name = CSTRING(MapFill_OnlyRoads); value = MAP_DETAIL_TOPOROADS;};
class Disabled {name = CSTRING(MapFill_None); value = MAP_DETAIL_NONE;};
};
};
};

View File

@ -6,7 +6,7 @@
* 0: String version of Keypad entry ["ok","del","1",...] <STRING>
*
* Return Value:
* Nothing
* None
*
* Example:
* ["ok"] call ace_microdagr_fnc_appMarkKeypadEntry
@ -16,15 +16,12 @@
#include "script_component.hpp"
private ["_display", "_editText", "_actualPos"];
PARAMS_1(_keypadButton);
params ["_keypadButton"];
disableSerialization;
_display = displayNull;
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
} else {
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
};
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
if (isNull _display) exitWith {ERROR("No Display");};
if (GVAR(currentApplicationPage) != APP_MODE_MARK) exitWith {};

View File

@ -3,18 +3,18 @@
* Handles the "Connect To" button from the menu application
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Nothing
* None
*
* Example:
* [] call ace_microdagr_fnc_appMenuButtonConnectRangefinder
* call ace_microdagr_fnc_appMenuButtonConnectRangefinder
*
* Public: No
*/
#include "script_component.hpp"
GVAR(currentWaypoint) = if (GVAR(currentWaypoint) == -2) then {-1} else {-2};
GVAR(currentWaypoint) = [-2, -1] select (GVAR(currentWaypoint) == -2);
GVAR(rangeFinderPositionASL) = [];
[APP_MODE_INFODISPLAY] call FUNC(saveCurrentAndSetNewMode);

View File

@ -7,7 +7,7 @@
* 1: Index <NUMBER>
*
* Return Value:
* Nothing
* None
*
* Example:
* [settingList, 1] call ace_microdagr_fnc_appSettingsLBClick
@ -17,7 +17,7 @@
#include "script_component.hpp"
disableSerialization;
PARAMS_2(_control,_itemClicked);
params ["", "_itemClicked"];
switch (_itemClicked) do {
case (0): { GVAR(settingUseMils) = ! GVAR(settingUseMils)};

View File

@ -3,13 +3,13 @@
* Handles clicking the delete button from the waypoint application
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Nothing
* None
*
* Example:
* [] call ace_microdagr_fnc_appWaypointsButtonDeleteWP
* call ace_microdagr_fnc_appWaypointsButtonDeleteWP
*
* Public: No
*/
@ -18,12 +18,8 @@
private ["_display", "_wpIndex"];
disableSerialization;
_display = displayNull;
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
} else {
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
};
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select GVAR(currentShowMode) == DISPLAY_MODE_DIALOG, displayNull];
if (isNull _display) exitWith {ERROR("No Display");};
_wpIndex = lbCurSel (_display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS);

View File

@ -6,10 +6,10 @@
* The "SetWP" button <CONTROL>
*
* Return Value:
* Nothing
* None
*
* Example:
* [] call ace_microdagr_fnc_appWaypointsButtonSetWP
* [1234] call ace_microdagr_fnc_appWaypointsButtonSetWP
*
* Public: No
*/
@ -18,7 +18,7 @@
private ["_wpListBox", "_newWpIndex", "_waypoints"];
disableSerialization;
PARAMS_1(_wpButton);
params ["_wpButton"];
_wpListBox = (ctrlParent _wpButton) displayCtrl 144501;
_newWpIndex = lbCurSel _wpListBox;

View File

@ -6,32 +6,31 @@
* The display mode to test showing <NUMBER>
*
* Return Value:
* Nothing
* None
*
* Example:
* [mode] call ace_microdagr_fnc_canShow
* [1] call ace_microdagr_fnc_canShow
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_showType);
params ["_showType"];
private ["_returnValue"];
_returnValue = false;
switch (_showType) do {
case (DISPLAY_MODE_CLOSED): {_returnValue = true}; //Can always close
case (DISPLAY_MODE_HIDDEN): {_returnValue = true}; //Can always hide
case (DISPLAY_MODE_DIALOG): {
_returnValue = ("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)};
_returnValue = switch (_showType) do {
case (DISPLAY_MODE_CLOSED): { true }; //Can always close
case (DISPLAY_MODE_HIDDEN): { true }; //Can always hide
case (DISPLAY_MODE_DIALOG): {
("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)}
};
case (DISPLAY_MODE_DISPLAY): {
case (DISPLAY_MODE_DISPLAY): {
//Can't have minimap up while zoomed in
_returnValue = (cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)};
(cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)}
};
default { false };
};
_returnValue

View File

@ -8,7 +8,7 @@
* 1: Waypoint Position ASL <ARRAY>
*
* Return Value:
* Nothing
* None
*
* Example:
* ["Hill 55", [41,324, 12]] call ace_microdagr_fnc_deviceAddWaypoint
@ -17,10 +17,11 @@
*/
#include "script_component.hpp"
PARAMS_2(_waypointName,_waypointPosASL);
private "_waypoints";
params ["_waypointName","_waypointPosASL"];
_waypoints = ace_player getVariable [QGVAR(waypoints), []];
_waypoints = ACE_player getVariable [QGVAR(waypoints), []];
_waypoints pushBack [_waypointName, _waypointPosASL];
ace_player setVariable [QGVAR(waypoints), _waypoints];
ACE_player setVariable [QGVAR(waypoints), _waypoints];

View File

@ -7,7 +7,7 @@
* 0: Waypoint Index <NUMBER>
*
* Return Value:
* Nothing
* None
*
* Example:
* ["Hill 55", [41,324, 12]] call ace_microdagr_fnc_deviceDeleteWaypoint
@ -16,13 +16,12 @@
*/
#include "script_component.hpp"
PARAMS_1(_wpIndex);
private "_waypoints";
params ["_wpIndex"];
_waypoints = ace_player getVariable [QGVAR(waypoints), []];
_waypoints = ACE_player getVariable [QGVAR(waypoints), []];
if ((_wpIndex < 0) || (_wpIndex > ((count _waypoints) - 1))) exitWith {ERROR("out of bounds wp");};
_waypoints deleteAt _wpIndex;
ace_player setVariable [QGVAR(waypoints), _waypoints];
ACE_player setVariable [QGVAR(waypoints), _waypoints];

View File

@ -4,7 +4,7 @@
* Device saving not implemented yet, just save to player object
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Waypoints <ARRAY>
@ -16,4 +16,4 @@
*/
#include "script_component.hpp"
(ace_player getVariable [QGVAR(waypoints), []])
(ACE_player getVariable [QGVAR(waypoints), []])

View File

@ -3,13 +3,13 @@
* Handles the dialog closeing, switches back to display mode
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Nothing
* None
*
* Example:
* [] call ace_microdagr_fnc_dialogClosedEH
* call ace_microdagr_fnc_dialogClosedEH
*
* Public: No
*/

View File

@ -10,7 +10,7 @@
* 3: MousePosY <NUMBER>
*
* Return Value:
* Nothing
* None
*
* Example:
* [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapButtonDownEH
@ -19,7 +19,7 @@
*/
#include "script_component.hpp"
PARAMS_4(_theMap,_mouseButton,_xPos,_yPos);
params ["", "_mouseButton"];
//Only handle RMB
if (_mouseButton != 1) exitWith {};

View File

@ -9,7 +9,7 @@
* 3: MousePosY <NUMBER>
*
* Return Value:
* Nothing
* None
*
* Example:
* [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapDoubleTapEH
@ -18,7 +18,7 @@
*/
#include "script_component.hpp"
PARAMS_4(_theMap,_mouseButton,_xPos,_yPos);
params ["_theMap", "_mouseButton", "_xPos", "_yPos"];
private ["_worldPos"];
@ -26,7 +26,7 @@ private ["_worldPos"];
if (_mouseButton != 0) exitWith {};
_worldPos = _theMap ctrlMapScreenToWorld [_xPos, _yPos];
_worldPos set [2, (getTerrainHeightASL _worldPos)];
_worldPos pushBack (getTerrainHeightASL _worldPos);
GVAR(newWaypointPosition) = _worldPos;
[APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode);

View File

@ -6,7 +6,7 @@
* 0: The Map <CONTROL>
*
* Return Value:
* Nothing
* None
*
* Example:
* [compassMap] call ace_microdagr_fnc_mapOnDrawEH
@ -15,10 +15,10 @@
*/
#include "script_component.hpp"
PARAMS_1(_theMap);
private ["_mapSize", "_waypoints", "_size", "_targetPos", "_relBearing", "_wpName", "_wpPos", "_alpha"];
params ["_theMap"];
_mapSize = (ctrlPosition _theMap) select 3;
_waypoints = [] call FUNC(deviceGetWaypoints);
@ -27,7 +27,7 @@ if (GVAR(currentApplicationPage) == 1) then {
_theMap ctrlMapAnimAdd [0, DUMMY_ZOOM, DUMMY_POS];
ctrlMapAnimCommit _theMap;
_size = 412 * _mapSize;
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (getDir ace_player)), '', 0 ];
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (getDir ACE_player)), '', 0 ];
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [0.533,0.769,0.76,1], DUMMY_POS, _size, _size, 0, '', 0 ];
if (GVAR(currentWaypoint) != -1) then {
@ -42,23 +42,23 @@ if (GVAR(currentApplicationPage) == 1) then {
};
};
if ((count _targetPos) == 3) then {
_relBearing = [ace_player, _targetPos] call BIS_fnc_relativeDirTo;
_relBearing = [ACE_player, _targetPos] call BIS_fnc_relativeDirTo;
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [1,0.564,0.564,1], DUMMY_POS, _size, _size, _relBearing, '', 0 ];
};
};
} else { //Map Mode:
if (GVAR(mapAutoTrackPosition)) then {
_theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), (getPosASL ace_player)];
_theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), (getPosASL ACE_player)];
ctrlMapAnimCommit _theMap;
};
_size = 48 * _mapSize;
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ace_player), _size, _size, (getDir ace_player), '', 0 ];
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ACE_player), _size, _size, (getDir ACE_player), '', 0 ];
if (GVAR(settingShowAllWaypointsOnMap)) then {
_size = 32 * _mapSize;
{
EXPLODE_2_PVT(_x,_wpName,_wpPos);
_x params ["_wpName", "_wpPos"];
_alpha = if (_forEachIndex == GVAR(currentWaypoint)) then {1} else {0.5};
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_mapWaypoints.paa)), [1,1,1,_alpha], _wpPos, _size, _size, 0, '', 0 ];
} forEach _waypoints;

View File

@ -6,7 +6,7 @@
* 0: String of the map button pressed <STRING>
*
* Return Value:
* Nothing
* None
*
* Example:
* ["autotrack"] call ace_microdagr_fnc_modeMapButtons
@ -15,7 +15,7 @@
*/
#include "script_component.hpp"
PARAMS_1(_mode);
params ["_mode"];
[-1] call FUNC(saveCurrentAndSetNewMode); //backup current draw pos/zoom

View File

@ -4,23 +4,18 @@
*
* Arguments:
* 0: logic <OBJECT>
* 1: synced units-not used <ARRAY>
* 2: Module Activated <BOOL>
*
* Return Value:
* Nothing
* None
*
* Example:
* [module, [], true] call ace_microdagr_fnc_moduleMapFill
* [module] call ace_microdagr_fnc_moduleMapFill
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_3(_logic,_syncedUnits,_activated);
if !(isServer) exitWith {};
params ["_logic"];
if (!_activated) exitWith {WARNING("Module Placed but not active");};
if (isServer) then {
[_logic, QGVAR(MapDataAvailable), "MapDataAvailable"] call EFUNC(common,readSettingFromModule);
};
[_logic, QGVAR(MapDataAvailable), "MapDataAvailable"] call EFUNC(common,readSettingFromModule);

View File

@ -6,7 +6,7 @@
* 0: Display Mode to show the microDAGR in <NUMBER><OPTIONAL>
*
* Return Value:
* Nothing
* None
*
* Example:
* [1] call ace_microdagr_fnc_openDisplay
@ -15,9 +15,9 @@
*/
#include "script_component.hpp"
private ["_oldShowMode", "_args", "_pfID", "_player"];
private ["_oldShowMode", "_args", "_player"];
DEFAULT_PARAM(0,_newDisplayShowMode,-1);
params [["_newDisplayShowMode", -1, [-1]]];
_oldShowMode = GVAR(currentShowMode);
if (_newDisplayShowMode == -1) then {
@ -30,11 +30,10 @@ if ((_newDisplayShowMode == DISPLAY_MODE_DISPLAY) && {!([DISPLAY_MODE_DISPLAY] c
if ((_newDisplayShowMode == DISPLAY_MODE_DIALOG) && {!([DISPLAY_MODE_DIALOG] call FUNC(canShow))}) then {_newDisplayShowMode = DISPLAY_MODE_HIDDEN};
//On first-startup
if (GVAR(currentApplicationPage) == APP_MODE_NULL) then {
GVAR(currentApplicationPage) = APP_MODE_INFODISPLAY;
GVAR(mapPosition) = getPos ace_player;
GVAR(mapPosition) = getPos ACE_player;
};
if (_newDisplayShowMode in [DISPLAY_MODE_CLOSED, DISPLAY_MODE_HIDDEN]) then {
@ -74,14 +73,14 @@ if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_M
//Start a pfeh to update display and handle hiding display
[{
PARAMS_2(_args,_pfID);
EXPLODE_1_PVT(_args,_player);
if ((isNull ace_player) || {!alive ace_player} || {ace_player != _player} || {!("ACE_microDAGR" in (items ace_player))} || {GVAR(currentShowMode) == DISPLAY_MODE_CLOSED}) then {
params ["_args", "_idPFH"];
_args params ["_player"];
if ((isNull ACE_player) || {!alive ACE_player} || {ACE_player != _player} || {!("ACE_microDAGR" in (items ACE_player))} || {GVAR(currentShowMode) == DISPLAY_MODE_CLOSED}) then {
//Close Display if still open:
if (GVAR(currentShowMode) != DISPLAY_MODE_CLOSED) then {
[DISPLAY_MODE_CLOSED] call FUNC(openDisplay);
};
[_pfID] call CBA_fnc_removePerFrameHandler;
[_idPFH] call CBA_fnc_removePerFrameHandler;
} else {
if (GVAR(currentShowMode) == DISPLAY_MODE_HIDDEN) then {
//If display is hidden, and we can show, then swithc modes:
@ -96,5 +95,5 @@ if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_M
};
};
};
}, 0.1, [ace_player]] call CBA_fnc_addPerFrameHandler;
}, 0.1, [ACE_player]] call CBA_fnc_addPerFrameHandler;
};

View File

@ -8,7 +8,7 @@
* 2: Inclination (Degrees) <NUMBER>
*
* Return Value:
* Nothing
* None
*
* Example:
* [1000, 45, 1] call ace_microdagr_fnc_recieveRangefinderData
@ -19,7 +19,7 @@
private ["_horizontalDistance", "_verticleDistance", "_targetOffset", "_targetPosASL"];
PARAMS_3(_slopeDistance,_azimuth,_inclination);
params ["_slopeDistance", "_azimuth", "_inclination"];
if (GVAR(currentWaypoint) != -2) exitWith {}; //Only take waypoint when "connected"
if (_slopeDistance < 0) exitWith {}; //Bad Data
@ -29,6 +29,6 @@ _verticleDistance = (sin _inclination) * _slopeDistance;
_targetOffset = [((sin _azimuth) * _horizontalDistance), ((cos _azimuth) * _horizontalDistance), _verticleDistance];
//This assumes the "rangefinder view" pos is very close to player, at worst the turret should only be a few meters different
_targetPosASL = (getPosASL ace_player) vectorAdd _targetOffset;
_targetPosASL = (getPosASL ACE_player) vectorAdd _targetOffset;
GVAR(rangeFinderPositionASL) = _targetPosASL;

View File

@ -7,7 +7,7 @@
* 0: New Mode <NUMBER>
*
* Return Value:
* Nothing
* None
*
* Example:
* [2] call ace_microdagr_fnc_saveCurrentAndSetNewMode
@ -16,24 +16,21 @@
*/
#include "script_component.hpp"
private ["_display", "_theMap", "_mapSize", "_centerPos", "_mapCtrlPos"];
private ["_display", "_theMap", "_centerPos", "_mapCtrlPos"];
PARAMS_1(_newMode);
params ["_newMode"];
disableSerialization;
_display = displayNull;
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
} else {
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
};
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
if (isNull _display) exitWith {ERROR("No Display");};
if (GVAR(currentApplicationPage) == 2) then {
_theMap = if (!GVAR(mapShowTexture)) then {_display displayCtrl IDC_MAPPLAIN} else {_display displayCtrl IDC_MAPDETAILS};
_theMap = [_display displayCtrl IDC_MAPDETAILS, _display displayCtrl IDC_MAPPLAIN] select (!GVAR(mapShowTexture));
_mapCtrlPos = ctrlPosition _theMap;
_mapSize = _mapCtrlPos select 3;
_centerPos = [((_mapCtrlPos select 0) + (_mapCtrlPos select 2) / 2), ((_mapCtrlPos select 1) + (_mapCtrlPos select 3) / 2)];
_mapCtrlPos params ["_mapCtrlPosX", "_mapCtrlPosY", "_mapCtrlPosZ", "_mapSize"];
_centerPos = [(_mapCtrlPosX + _mapCtrlPosZ / 2), (_mapCtrlPosY + _mapSize / 2)];
GVAR(mapPosition) = _theMap ctrlMapScreenToWorld _centerPos;
GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize;

View File

@ -3,10 +3,10 @@
* Changes the "application page" shown on the microDAGR
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Nothing
* None
*
* Example:
* [] call ace_microdagr_fnc_showApplicationPage
@ -19,12 +19,8 @@ private ["_display", "_theMap", "_mapSize"];
disableSerialization;
_display = displayNull;
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
} else {
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
};
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
if (isNull _display) exitWith {ERROR("No Display");};
//TopBar

View File

@ -3,10 +3,10 @@
* Updates the display (several times a second) called from the pfeh
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Nothing
* None
*
* Example:
* [] call ace_microdagr_fnc_updateDisplay
@ -15,15 +15,11 @@
*/
#include "script_component.hpp"
private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPos", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_playerPos2d", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString"];
private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPos", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString", "_daylight"];
disableSerialization;
_display = displayNull;
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
} else {
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
};
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
if (isNull _display) exitWith {ERROR("No Display");};
//Fade "shell" at night
@ -44,21 +40,21 @@ case (APP_MODE_INFODISPLAY): {
(_display displayCtrl IDC_MODEDISPLAY_NORTHING) ctrlSetText _northingText;
//Elevation:
_numASL = ((getPosASL ace_player) select 2) + EGVAR(common,mapAltitude);
_numASL = ((getPosASL ACE_player) select 2) + EGVAR(common,mapAltitude);
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
_aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"};
(_display displayCtrl IDC_MODEDISPLAY_ELEVATIONNUM) ctrlSetText _aboveSeaLevelText;
//Heading:
_compassAngleText = if (GVAR(settingUseMils)) then {
[(floor ((6400 / 360) * (getDir ace_player))), 4, 0] call CBA_fnc_formatNumber;
[(floor ((6400 / 360) * (getDir ACE_player))), 4, 0] call CBA_fnc_formatNumber;
} else {
([(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
([(floor (getDir ACE_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
};
(_display displayCtrl IDC_MODEDISPLAY_HEADINGNUM) ctrlSetText _compassAngleText;
//Speed:
(_display displayCtrl IDC_MODEDISPLAY_SPEEDNUM) ctrlSetText format ["%1kph", (round (speed (vehicle ace_player)))];;
(_display displayCtrl IDC_MODEDISPLAY_SPEEDNUM) ctrlSetText format ["%1kph", (round (speed (vehicle ACE_player)))];;
if (GVAR(currentWaypoint) == -1) then {
@ -89,13 +85,13 @@ case (APP_MODE_INFODISPLAY): {
};
if (!(_targetPosLocationASL isEqualTo [])) then {
_bearing = [(getPosASL ace_player), _targetPosLocationASL] call BIS_fnc_dirTo;
_bearing = [(getPosASL ACE_player), _targetPosLocationASL] call BIS_fnc_dirTo;
_bearingText = if (GVAR(settingUseMils)) then {
[(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber;
} else {
([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
};
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
_2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000;
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
_numASL = (_targetPosLocationASL select 2) + EGVAR(common,mapAltitude);
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
@ -111,14 +107,14 @@ case (APP_MODE_INFODISPLAY): {
case (APP_MODE_COMPASS): {
//Heading:
_compassAngleText = if (GVAR(settingUseMils)) then {
[(floor ((6400 / 360) * (getDir ace_player))), 4, 0] call CBA_fnc_formatNumber;
[(floor ((6400 / 360) * (getDir ACE_player))), 4, 0] call CBA_fnc_formatNumber;
} else {
([(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
([(floor (getDir ACE_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
};
(_display displayCtrl IDC_MODECOMPASS_HEADING) ctrlSetText _compassAngleText;
//Speed:
_SpeedText = format ["%1kph", (round (speed (vehicle ace_player)))];;
_SpeedText = format ["%1kph", (round (speed (vehicle ACE_player)))];;
(_display displayCtrl IDC_MODECOMPASS_SPEED) ctrlSetText _SpeedText;
if (GVAR(currentWaypoint) == -1) then {
@ -126,8 +122,6 @@ case (APP_MODE_COMPASS): {
(_display displayCtrl IDC_MODECOMPASS_RANGE) ctrlSetText "";
(_display displayCtrl IDC_MODECOMPASS_TARGET) ctrlSetText "";
} else {
_playerPos2d = (getPosASL ace_player) select [0,2];
_targetPosName = "";
_targetPosLocationASL = [];
@ -147,13 +141,13 @@ case (APP_MODE_COMPASS): {
_rangeText = "---";
if (!(_targetPosLocationASL isEqualTo [])) then {
_bearing = [(getPosASL ace_player), _targetPosLocationASL] call BIS_fnc_dirTo;
_bearing = [(getPosASL ACE_player), _targetPosLocationASL] call BIS_fnc_dirTo;
_bearingText = if (GVAR(settingUseMils)) then {
[(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber;
} else {
([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
};
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
_2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000;
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
};
@ -169,9 +163,9 @@ case (APP_MODE_WAYPOINTS): {
lbClear _wpListBox;
{
EXPLODE_2_PVT(_x,_wpName,_wpPos);
_x params ["_wpName", "_wpPos"];
_wpListBox lbAdd _wpName;
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_wpPos select [0,2])) / 1000;
_2dDistanceKm = ((getPosASL ACE_player) distance2D _wpPos) / 1000;
_wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)])];
} forEach _waypoints;

View File

@ -325,7 +325,7 @@
<Czech>Kolik informací je načteno do MicroDAGR?</Czech>
<Portuguese>Quanta informação é preenchida no mapa do MicroDAGR</Portuguese>
</Key>
<Key ID="STR_ACE_MicroDAGR_None">
<Key ID="STR_ACE_MicroDAGR_MapFill_Full">
<English>Full Satellite + Buildings</English>
<Polish>Pełna satelitarna + budynki</Polish>
<Spanish>Satelite completo + Edificios</Spanish>
@ -333,7 +333,7 @@
<Czech>Satelit + Budovy</Czech>
<Portuguese>Satélite completo + Edifícios</Portuguese>
</Key>
<Key ID="STR_ACE_MicroDAGR_Side">
<Key ID="STR_ACE_MicroDAGR_MapFill_OnlyRoads">
<English>Topographical + Roads</English>
<Polish>Topograficzna + drogi</Polish>
<Spanish>Topografico + Carreteras</Spanish>
@ -341,7 +341,7 @@
<Czech>Topografické + Cesty</Czech>
<Portuguese>Topográfico + Estradas</Portuguese>
</Key>
<Key ID="STR_ACE_MicroDAGR_Unique">
<Key ID="STR_ACE_MicroDAGR_MapFill_None">
<English>None (Cannot use map view)</English>
<Polish>Żadna (wyłącza ekran mapy)</Polish>
<Spanish>Nada (No se puede el mapa)</Spanish>

View File

@ -1,4 +1,3 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));

View File

@ -0,0 +1,15 @@
class asdg_OpticRail;
class asdg_OpticRail1913: asdg_OpticRail {
class compatibleItems {
ACE_optic_Hamr_2D = 1;
ACE_optic_Hamr_PIP = 1;
ACE_optic_Arco_2D = 1;
ACE_optic_Arco_PIP = 1;
ACE_optic_MRCO_2D = 1;
ACE_optic_MRCO_PIP = 1;
ACE_optic_SOS_2D = 1;
ACE_optic_SOS_PIP = 1;
ACE_optic_LRPS_2D = 1;
ACE_optic_LRPS_PIP = 1;
};
};

View File

@ -1,4 +1,3 @@
class CfgOpticsEffect {
class ACE_OpticsRadBlur1 {
type = "radialblur";

View File

@ -1,4 +1,3 @@
#define MACRO_PRELOAD \
GVAR(BodyDay) = "*"; \
GVAR(BodyNight) = "*"; \

View File

@ -1,4 +1,3 @@
class RscOpticsValue;
class RscMapControl;
class RscText;
@ -111,7 +110,7 @@ class RscInGameUI {
idc = 1713011;
x = "safeZoneXAbs + safeZoneWAbs - (safezoneX - safeZoneXABS) * ((getResolution select 4)/(16/3))";
colorBackground[] = {0,0,0,1};
};
};
};
class ACE_RscWeapon_Hamr: ACE_RscWeapon_base {

View File

@ -1,4 +1,3 @@
class CfgVehicles {
class Box_NATO_Support_F;
class ACE_Box_Misc: Box_NATO_Support_F {

View File

@ -1,18 +1,17 @@
class CfgWeapons {
class ItemCore;
class InventoryOpticsItem_Base_F;
class Default;
class Binocular: Default {
forceOptics = 0; // Allow using compass with Binocular
opticsZoomMin = 0.056889; // 5.25x power
opticsZoomMax = 0.056889; // 9 px/mil
modelOptics = "\z\ace\addons\optics\models\NWD_M22_5x"; // 7° horizontal field of view
modelOptics = "\z\ace\addons\optics\models\NWD_M22_5x"; // 7 degrees horizontal field of view
visionMode[] = {"Normal"}; // Can't use nvgs with binoculars any more than you can with scopes
// Fix AI using Binocs on short range - #18737
// minRange = 300; // 300 = uses Rangefinder often (runs a few meters, stops, uses RF, repeats)
minRange = 500; //500 = seem almost never use it..?
minRange = 500; //500 = seem almost never use it..?
minRangeProbab = 0.001;
midRange = 1000;
midRangeProbab = 0.01;

View File

@ -30,5 +30,6 @@ class CfgPatches {
#include "CfgRscTitles.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "CfgJointRails.hpp"
#include "CfgPreloadTextures.hpp"

View File

@ -1,4 +1,4 @@
class Mode_SemiAuto;
class Mode_FullAuto;
class CfgWeapons {
@ -510,14 +510,14 @@ class CfgWeapons {
class player: player {};
};
class cannon_105mm: cannon_120mm {
class cannon_105mm: CannonCore {
displayName = "M68";
class player: player {
class player: Mode_SemiAuto {
displayName = "M68";
};
};
class cannon_125mm: cannon_120mm {
class cannon_125mm: CannonCore {
displayName = "2A46";
};

View File

@ -31,7 +31,7 @@ class ACE_Repair {
class MiscRepair: ReplaceWheel {
displayName = CSTRING(Repairing); // let's make empty string an auto generated string
displayNameProgress = CSTRING(RepairingHitPoint);
condition = QUOTE((_target getHitPointDamage _hitPoint) > ([_caller] call FUNC(getPostRepairDamage)));
condition = QUOTE(call FUNC(canMiscRepair));
requiredEngineer = 0;
repairingTime = 15;
callbackSuccess = QUOTE(call FUNC(doRepair));
@ -63,7 +63,7 @@ class ACE_Repair {
requiredEngineer = QGVAR(engineerSetting_fullRepair);
repairLocations[] = {QGVAR(fullRepairLocation)};
repairingTime = 30;
condition = "damage (_this select 1) > 0";
condition = "damage _target > 0";
callbackSuccess = QUOTE(call FUNC(doFullRepair));
};
};

View File

@ -285,7 +285,10 @@ class CfgVehicles {
transportRepair = 0;
};
class Heli_Transport_04_base_F;
class Helicopter_Base_H;
class Heli_Transport_04_base_F: Helicopter_Base_H {
GVAR(hitpointGroups[]) = { {"HitEngine", {"HitEngine1", "HitEngine2"}}, {"Glass_1_hitpoint", {"Glass_2_hitpoint", "Glass_3_hitpoint", "Glass_4_hitpoint", "Glass_5_hitpoint", "Glass_6_hitpoint", "Glass_7_hitpoint", "Glass_8_hitpoint", "Glass_9_hitpoint", "Glass_10_hitpoint", "Glass_11_hitpoint", "Glass_12_hitpoint", "Glass_13_hitpoint", "Glass_14_hitpoint", "Glass_15_hitpoint", "Glass_16_hitpoint", "Glass_17_hitpoint", "Glass_18_hitpoint", "Glass_19_hitpoint", "Glass_20_hitpoint"}} };
};
class O_Heli_Transport_04_repair_F: Heli_Transport_04_base_F {
GVAR(canRepair) = 1;
transportRepair = 0;
@ -303,12 +306,19 @@ class CfgVehicles {
transportRepair = 0;
};
class Offroad_01_base_F;
class Car_F;
class Offroad_01_base_F: Car_F {
GVAR(hitpointGroups[]) = { {"HitGlass1", {"HitGlass2"}} };
};
class Offroad_01_repair_base_F: Offroad_01_base_F {
GVAR(canRepair) = 1;
transportRepair = 0;
};
class MRAP_01_base_F: Car_F {
GVAR(hitpointGroups[]) = { {"HitGlass1", {"HitGlass2", "HitGlass3", "HitGlass4", "HitGlass5", "HitGlass6"}} };
};
class B_Truck_01_mover_F;
class B_Truck_01_Repair_F: B_Truck_01_mover_F {
GVAR(canRepair) = 1;

View File

@ -3,6 +3,7 @@
ADDON = false;
PREP(addRepairActions);
PREP(canMiscRepair);
PREP(canRemove);
PREP(canRepair);
PREP(canRepairTrack);
@ -15,6 +16,7 @@ PREP(doRepair);
PREP(doRepairTrack);
PREP(doReplaceTrack);
PREP(doReplaceWheel);
PREP(getHitPointString);
PREP(getPostRepairDamage);
PREP(getWheelHitPointsWithSelections);
PREP(hasItems);

View File

@ -14,7 +14,6 @@
* Public: No
*/
#include "script_component.hpp"
#define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"]
params ["_vehicle"];
TRACE_1("params", _vehicle);
@ -35,6 +34,11 @@ if (_type in _initializedClasses) exitWith {};
([_vehicle] call FUNC(getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitPointSelections"];
private ["_hitPointsAddedNames", "_hitPointsAddedStrings", "_hitPointsAddedAmount"];
_hitPointsAddedNames = [];
_hitPointsAddedStrings = [];
_hitPointsAddedAmount = [];
// add repair events to this vehicle class
{
if (_x in _wheelHitPoints) then {
@ -51,7 +55,7 @@ if (_type in _initializedClasses) exitWith {};
// remove wheel action
_name = format ["Remove_%1", _x];
_text = localize "STR_ACE_Repair_RemoveWheel";
_text = localize LSTRING(RemoveWheel);
_condition = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(canRepair)};
_statement = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(repair)};
@ -74,22 +78,39 @@ if (_type in _initializedClasses) exitWith {};
// exit if the hitpoint is in the blacklist, e.g. glasses
if (_x in IGNORED_HITPOINTS) exitWith {};
private ["_hitpointGroupConfig", "_inHitpointSubGroup", "_currentHitpoint"];
// Get hitpoint groups if available
_hitpointGroupConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointGroups);
_inHitpointSubGroup = false;
if (isArray _hitpointGroupConfig) then {
// Set variable if current hitpoint is in a sub-group (to be excluded from adding action)
_currentHitpoint = _x;
{
{
if (_x == _currentHitpoint) exitWith {
_inHitpointSubGroup = true;
};
} forEach (_x select 1);
} forEach (getArray _hitpointGroupConfig);
};
// Exit if current hitpoint is in sub-group (only main hitpoints get actions)
if (_inHitpointSubGroup) exitWith {};
// exit if the hitpoint is virtual
if (isText (configFile >> "CfgVehicles" >> _type >> "HitPoints" >> _x >> "depends")) exitWith {};
// add misc repair action
private ["_name", "_text", "_icon", "_selection", "_customSelectionsConfig", "_currentHitpoint", "_condition", "_statement"];
private ["_name", "_icon", "_selection", "_condition", "_statement"];
_name = format ["Repair_%1", _x];
_text = format ["STR_ACE_Repair_%1", _x];
if (isLocalized _text) then {
_text = format [localize LSTRING(RepairHitpoint), localize _text];
} else {
_text = format [localize LSTRING(RepairHitpoint), _x];
};
// Find localized string and track those added for numerization
([_x, "%1", _x, [_hitPointsAddedNames, _hitPointsAddedStrings, _hitPointsAddedAmount]] call FUNC(getHitPointString)) params ["_text", "_trackArray"];
_hitPointsAddedNames = _trackArray select 0;
_hitPointsAddedStrings = _trackArray select 1;
_hitPointsAddedAmount = _trackArray select 2;
_icon = "A3\ui_f\data\igui\cfg\actions\repair_ca.paa";

View File

@ -0,0 +1,54 @@
/*
* Author: Jonpas
* Check if misc repair action can be done, called from callbackSuccess.
*
* Arguments:
* 0: Unit that does the repairing <OBJECT>
* 1: Vehicle to repair <OBJECT>
* 2: Selected hitpoint <STRING>
*
* Return Value:
* Can Misc Repair <BOOL>
*
* Example:
* [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_canMiscRepair
*
* Public: No
*/
#include "script_component.hpp"
private ["_hitpointGroupConfig", "_hitpointGroup", "_postRepairDamage", "_return"];
params ["_caller", "_target", "_hitPoint"];
// Get hitpoint groups if available
_hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hitpointGroups);
_hitpointGroup = [];
if (isArray _hitpointGroupConfig) then {
// Retrieve hitpoint subgroup if current hitpoint is main hitpoint of a group
{
// Exit using found hitpoint group if this hitpoint is leader of any
if (_x select 0 == _hitPoint) exitWith {
_hitpointGroup = _x select 1;
};
} forEach (getArray _hitpointGroupConfig);
};
// Add current hitpoint to the group
_hitpointGroup pushBack _hitPoint;
// Get post repair damage
_postRepairDamage = [_caller] call FUNC(getPostRepairDamage);
// Return true if damage can be repaired on any hitpoint in the group, else false
_return = false;
{
if ((_target getHitPointDamage _x) > _postRepairDamage) exitWith {
_return = true;
};
} forEach _hitpointGroup;
if (typeOf _target == "B_MRAP_01_F") then {
diag_log format ["%1 - %2", _hitPoint, _hitpointGroup];
};
_return

View File

@ -17,11 +17,11 @@
*/
#include "script_component.hpp"
private ["_hitPointDamage", "_text", "_hitpointGroup"];
params ["_unit", "_vehicle", "_hitPoint"];
TRACE_3("params",_unit,_vehicle,_hitPoint);
// get current hitpoint damage
private "_hitPointDamage";
_hitPointDamage = _vehicle getHitPointDamage _hitPoint;
_hitPointDamage = _hitPointDamage - 0.5;
@ -31,16 +31,36 @@ _hitPointDamage = _hitPointDamage max ([_unit] call FUNC(getPostRepairDamage));
// raise event to set the new hitpoint damage
["setVehicleHitPointDamage", _vehicle, [_vehicle, _hitPoint, _hitPointDamage]] call EFUNC(common,targetEvent);
// Get hitpoint groups if available
_hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(hitpointGroups);
_hitpointGroup = [];
if (isArray _hitpointGroupConfig) then {
// Retrieve group if current hitpoint is leader of any
{
if (_x select 0 == _hitPoint) exitWith {
([_vehicle] call EFUNC(common,getHitPointsWithSelections)) params ["_hitpoints"];
// Set all sub-group hitpoints' damage to 0, if a hitpoint is invalid print RPT error
{
if (_x in _hitpoints) then {
["setVehicleHitPointDamage", _vehicle, [_vehicle, _x, 0]] call EFUNC(common,targetEvent);
} else {
diag_log text format ["[ACE] ERROR: Invalid hitpoint %1 in hitpointGroups of %2", _x, _vehicle];
};
} forEach (_x select 1);
};
} forEach (getArray _hitpointGroupConfig);
};
// display text message if enabled
if (GVAR(DisplayTextOnRepair)) then {
private "_text";
_text = format ["STR_ACE_Repair_%1", _hitPoint];
private ["_textLocalized", "_textDefault"];
if (isLocalized _text) then {
_text = format [localize ([LSTRING(RepairedHitPointFully), LSTRING(RepairedHitPointPartially)] select (_hitPointDamage > 0)), localize _text];
} else {
_text = localize ([LSTRING(RepairedFully), LSTRING(RepairedPartially)] select (_hitPointDamage > 0));
};
// Find localized string
_textLocalized = localize ([LSTRING(RepairedHitPointFully), LSTRING(RepairedHitPointPartially)] select (_hitPointDamage > 0));
_textDefault = localize ([LSTRING(RepairedFully), LSTRING(RepairedPartially)] select (_hitPointDamage > 0));
([_hitPoint, _textLocalized, _textDefault] call FUNC(getHitPointString)) params ["_text"];
// Display text
[_text] call EFUNC(common,displayTextStructured);
};

View File

@ -0,0 +1,89 @@
/*
* Author: Jonpas
* Finds the localized string of the given hitpoint name or uses default text if none found.
*
* Arguments:
* 0: Hitpoint <STRING>
* 1: Localized Text <STRING>
* 2: Default Text <STRING>
* 3: Track Added Hitpoints <BOOL> (default: false)
*
* Return Value:
* 0: Text
* 1: Added Hitpoint (default: [])
*
* Example:
* [unit, vehicle, "hitpoint"] call ace_repair_fnc_getHitPointString
*
* Public: No
*/
#include "script_component.hpp"
private ["_track", "_trackNames", "_trackStrings", "_trackAmount", "_text", "_toFind", "_trackIndex", "_combinedString"];
params ["_hitPoint", "_textLocalized", "_textDefault", ["_trackArray", []]];
_track = if (count _trackArray > 0) then {true} else {false};
_trackNames = [];
_trackStrings = [];
_trackAmount = [];
if (_track) then {
_trackNames = _trackArray select 0;
_trackStrings = _trackArray select 1;
_trackAmount = _trackArray select 2;
};
// Prepare first part of the string from stringtable
_text = LSTRING(Hit);
// Remove "Hit" from hitpoint name if one exists
_toFind = if (_hitPoint find "Hit" == 0) then {
[_hitPoint, 3] call CBA_fnc_substr
} else {
_hitPoint
};
// Loop through always shorter part of the hitpoint name to find the string from stringtable
for "_i" from 0 to (count _hitPoint) do {
if (_track) then {
// Loop through already added hitpoints and save index
_trackIndex = -1;
{
if (_x == _toFind) exitWith {
_trackIndex = _forEachIndex;
};
} forEach _trackNames;
// Use already added hitpoint if one found above and numerize
if (_trackIndex != -1) exitWith {
_text = localize (_trackStrings select _trackIndex) + " " + str(_trackAmount select _trackIndex);
_trackAmount set [_trackIndex, (_trackAmount select _trackIndex) + 1]; // Set amount
TRACE_2("Same hitpoint found",_toFind,_trackNames);
};
};
// Localize if localization found
_combinedString = _text + _toFind;
if (isLocalized _combinedString) exitWith {
_text = format [_textLocalized, localize _combinedString];
TRACE_1("Hitpoint localized",_toFind);
if (_track) then {
// Add hitpoint to the list
_trackNames pushBack _toFind;
_trackStrings pushBack _combinedString;
_trackAmount pushBack 2;
};
};
// Cut off one character
_toFind = [_toFind, 0, count _toFind - 1] call CBA_fnc_substr;
};
// Don't display part name if no string is found in stringtable
if (_text == LSTRING(Hit)) then {
_text = _textDefault;
};
[_text, [_trackNames, _trackStrings, _trackAmount]]

View File

@ -164,14 +164,10 @@ _repairTime = if (isNumber (_config >> "repairingTime")) then {
0;
};
private ["_text", "_processText"];
private ["_processText"];
// Find localized string
_processText = getText (_config >> "displayNameProgress");
_text = format ["STR_ACE_Repair_%1", _hitPoint];
if (isLocalized _text) then {
_text = format [_processText, localize _text];
} else {
_text = _processText;
};
([_hitPoint, _processText, _processText] call FUNC(getHitPointString)) params ["_text"];
// Start repair
[

View File

@ -12,5 +12,5 @@
#include "\z\ace\addons\main\script_macros.hpp"
#define IGNORED_HITPOINTS ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitGlass7","HitGlass8","HitGlass9","HitGlass10","HitGlass11","HitGlass12","HitGlass13","HitGlass14","HitGlass15","HitRGlass","HitLGlass"]
// #define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"];
#define IGNORED_HITPOINTS ["HitGlass1", "HitGlass2", "HitGlass3", "HitGlass4", "HitGlass5", "HitGlass6", "HitGlass7", "HitGlass8", "HitGlass9", "HitGlass10", "HitGlass11", "HitGlass12", "HitGlass13", "HitGlass14", "HitGlass15", "HitRGlass", "HitLGlass", "Glass_1_hitpoint", "Glass_2_hitpoint", "Glass_3_hitpoint", "Glass_4_hitpoint", "Glass_5_hitpoint", "Glass_6_hitpoint", "Glass_7_hitpoint", "Glass_8_hitpoint", "Glass_9_hitpoint", "Glass_10_hitpoint", "Glass_11_hitpoint", "Glass_12_hitpoint", "Glass_13_hitpoint", "Glass_14_hitpoint", "Glass_15_hitpoint", "Glass_16_hitpoint", "Glass_17_hitpoint", "Glass_18_hitpoint", "Glass_19_hitpoint", "Glass_20_hitpoint"]
#define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"]

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-21 -->
<Project name="ACE">
<Package name="repair">
@ -118,18 +118,6 @@
<English>Who can perform a full repair on a vehicle?</English>
<Polish>Kto może przeprowadzić pełną naprawę pojazdu?</Polish>
</Key>
<Key ID="STR_ACE_Repair_RepairHitpoint">
<English>Repair %1</English>
<German>Reparieren %1</German>
<Spanish>Reparación %1</Spanish>
<French>Réparer %1</French>
<Polish>Napraw %1</Polish>
<Czech>Opravit %1</Czech>
<Portuguese>Reparar %1</Portuguese>
<Italian>Ripara %1</Italian>
<Hungarian>Szerelés %1</Hungarian>
<Russian>Ремонт %1</Russian>
</Key>
<Key ID="STR_ACE_Repair_Repair">
<English>Repair &gt;&gt;</English>
<German>Reparieren &gt;&gt;</German>
@ -242,6 +230,15 @@
<Hungarian>Motor</Hungarian>
<Russian>Двигатель</Russian>
</Key>
<Key ID="STR_ACE_Repair_HitHStabilizerL1">
<English>Left Horizontal Stabilizer</English>
</Key>
<Key ID="STR_ACE_Repair_HitHStabilizerR1">
<English>Right Horizontal Stabilizer</English>
</Key>
<Key ID="STR_ACE_Repair_HitVStabilizer1">
<English>Vertical Stabilizer</English>
</Key>
<Key ID="STR_ACE_Repair_HitFuel">
<English>Fuel Tank</English>
<German>Tank</German>
@ -254,15 +251,36 @@
<Hungarian>Üzemanyagtank</Hungarian>
<Russian>Топливный бак</Russian>
</Key>
<Key ID="STR_ACE_Repair_HitTransmission">
<English>Transmission</English>
</Key>
<Key ID="STR_ACE_Repair_HitGear">
<English>Gear</English>
</Key>
<Key ID="STR_ACE_Repair_HitStarter">
<English>Starter</English>
</Key>
<Key ID="STR_ACE_Repair_HitTail">
<English>Tail</English>
</Key>
<Key ID="STR_ACE_Repair_HitPilotTube">
<English>Pilot Tube</English>
</Key>
<Key ID="STR_ACE_Repair_HitStaticPort">
<English>Static Port</English>
</Key>
<Key ID="STR_ACE_Repair_HitAmmo">
<English>Ammo</English>
</Key>
<Key ID="STR_ACE_Repair_HitTurret">
<English>Main Turret</English>
<English>Turret</English>
<German>Turm</German>
<Spanish>Torreta príncipal</Spanish>
<Spanish>Torreta</Spanish>
<French>Tourelle</French>
<Polish>Wieżyczka</Polish>
<Czech>Hlavní Věž</Czech>
<Portuguese>Torre principal</Portuguese>
<Italian>Torretta principale</Italian>
<Czech>Věž</Czech>
<Portuguese>Torre</Portuguese>
<Italian>Torretta</Italian>
<Hungarian>Lövegtorony</Hungarian>
<Russian>Башню</Russian>
</Key>
@ -278,6 +296,9 @@
<Hungarian>Ágyú</Hungarian>
<Russian>Пушку</Russian>
</Key>
<Key ID="STR_ACE_Repair_HitMissiles">
<English>Missiles</English>
</Key>
<Key ID="STR_ACE_Repair_HitLTrack">
<English>Left Track</English>
<German>Linke Kette</German>
@ -463,77 +484,17 @@
<Hungarian>Bal szélvédő</Hungarian>
<Russian>Стекло (слава)</Russian>
</Key>
<Key ID="STR_ACE_Repair_HitGlass1">
<English>Glass 1</English>
<German>Scheibe 1</German>
<Spanish>Ventana 1</Spanish>
<French>Vitre 1</French>
<Polish>Szyba 1</Polish>
<Czech>Sklo 1</Czech>
<Portuguese>Vidro 1</Portuguese>
<Italian>Vetro 1</Italian>
<Hungarian>Üveg 1</Hungarian>
<Russian>Стекло 1</Russian>
</Key>
<Key ID="STR_ACE_Repair_HitGlass2">
<English>Glass 2</English>
<German>Scheibe 2</German>
<Spanish>Ventana 2</Spanish>
<French>Vitre 2</French>
<Polish>Szyba 2</Polish>
<Czech>Sklo 2</Czech>
<Portuguese>Vidro 2</Portuguese>
<Italian>Vetro 2</Italian>
<Hungarian>Üveg 2</Hungarian>
<Russian>Стекло 2</Russian>
</Key>
<Key ID="STR_ACE_Repair_HitGlass3">
<English>Glass 3</English>
<German>Scheibe 3</German>
<Spanish>Ventana 3</Spanish>
<French>Vitre 3</French>
<Polish>Szyba 3</Polish>
<Czech>Sklo 3</Czech>
<Portuguese>Vidro 3</Portuguese>
<Italian>Vetro 3</Italian>
<Hungarian>Üveg 3</Hungarian>
<Russian>Стекло 3</Russian>
</Key>
<Key ID="STR_ACE_Repair_HitGlass4">
<English>Glass 4</English>
<German>Scheibe 4</German>
<Spanish>Ventana 4</Spanish>
<French>Vitre 4</French>
<Polish>Szyba 4</Polish>
<Czech>Sklo 4</Czech>
<Portuguese>Vidro 4</Portuguese>
<Italian>Vetro 4</Italian>
<Hungarian>Üveg 4</Hungarian>
<Russian>Стекло 4</Russian>
</Key>
<Key ID="STR_ACE_Repair_HitGlass5">
<English>Glass 5</English>
<German>Scheibe 5</German>
<Spanish>Ventana 5</Spanish>
<French>Vitre 5</French>
<Polish>Szyba 5</Polish>
<Czech>Sklo 5</Czech>
<Portuguese>Vidro 5</Portuguese>
<Italian>Vetro 5</Italian>
<Hungarian>Üveg 5</Hungarian>
<Russian>Стекло 5</Russian>
</Key>
<Key ID="STR_ACE_Repair_HitGlass6">
<English>Glass 6</English>
<German>Scheibe 6</German>
<Spanish>Ventana 6</Spanish>
<French>Vitre 6</French>
<Polish>Szyba 6</Polish>
<Czech>Sklo 6</Czech>
<Portuguese>Vidro 6</Portuguese>
<Italian>Vetro 6</Italian>
<Hungarian>Üveg 6</Hungarian>
<Russian>Стекло 6</Russian>
<Key ID="STR_ACE_Repair_HitGlass">
<English>Glass</English>
<German>Scheibe</German>
<Spanish>Ventana</Spanish>
<French>Vitre</French>
<Polish>Szyba</Polish>
<Czech>Sklo</Czech>
<Portuguese>Vidro</Portuguese>
<Italian>Vetro</Italian>
<Hungarian>Üveg</Hungarian>
<Russian>Стекло</Russian>
</Key>
<Key ID="STR_ACE_Repair_moduleName">
<English>Repair Settings</English>
@ -696,4 +657,4 @@
<Polish>Przydziel klasę budynku naprawczego do jednego lub kilku budynków.</Polish>
</Key>
</Package>
</Project>
</Project>

View File

@ -0,0 +1 @@
z\ace\addons\spectator

View File

@ -0,0 +1,22 @@
class ACE_Settings {
class GVAR(filterUnits) {
typeName = "SCALAR";
value = 2;
values[] = {CSTRING(units_none), CSTRING(units_players), CSTRING(units_playable), CSTRING(units_all)};
};
class GVAR(filterSides) {
typeName = "SCALAR";
value = 0;
values[] = {CSTRING(sides_player), CSTRING(sides_friendly), CSTRING(sides_hostile), CSTRING(sides_all)};
};
class GVAR(restrictModes) {
typeName = "SCALAR";
value = 0;
values[] = {CSTRING(modes_all), CSTRING(modes_unit), CSTRING(modes_free), CSTRING(modes_internal), CSTRING(modes_external)};
};
class GVAR(restrictVisions) {
typeName = "SCALAR";
value = 0;
values[] = {CSTRING(modes_all), CSTRING(visions_nv), CSTRING(visions_ti), "$STR_Special_None"};
};
};

Some files were not shown because too many files have changed in this diff Show More