Merge branch 'master' into switchUnits_codecleanup

This commit is contained in:
bux578 2015-03-01 13:12:15 +01:00
commit f55623130d
410 changed files with 6826 additions and 5381 deletions

13
.editorconfig Normal file
View File

@ -0,0 +1,13 @@
root = true
[*]
end_of_line = crlf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

View File

@ -1,3 +0,0 @@
// by commy2
[missionNamespace, "playerChanged", {_this call AGM_Captives_fnc_handlePlayerChanged}] call AGM_Core_fnc_addCustomEventhandler;

View File

@ -1,363 +0,0 @@
class CfgPatches {
class AGM_Captives {
units[] = {};
weapons[] = {"AGM_CableTie"};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core, AGM_Interaction};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"commy2", "KoffeinFlummi"};
authorUrl = "https://github.com/commy2/";
};
};
class CfgFunctions {
class AGM_Captives {
class AGM_Captives {
file = "\AGM_Captives\functions";
class canFriskPerson;
class canLoadCaptive;
class canUnloadCaptive;
class escortCaptive;
class handleGetOut;
class handleKnockedOut;
class handlePlayerChanged;
class handleWokeUp;
class initPost;
class initUnit;
class loadCaptive;
class openFriskMenu;
class setCaptive;
class surrender;
class unloadCaptive;
};
};
};
//release escorted captive when entering a vehicle
class Extended_GetIn_EventHandlers {
class All {
class AGM_Captives_AutoDetachCaptive {
getIn = "if (local (_this select 2) && {(_this select 2) getVariable ['AGM_isEscorting', false]}) then {(_this select 2) setVariable ['AGM_isEscorting', false, true]}";
};
};
};
//reset captive animation after leaving vehicle
class Extended_GetOut_EventHandlers {
class All {
class AGM_Captives_LeaveVehicle {
getOut = "if (local (_this select 2) && {(_this select 2) getVariable ['AGM_isCaptive', false]}) then {_this call AGM_Captives_fnc_handleGetOut}";
};
};
};
//reset captivity and escorting status when getting killed
class Extended_Killed_EventHandlers {
class CAManBase {
class AGM_Captives_AutoDetachCaptive {
killed = "if ((_this select 0) getVariable ['AGM_isCaptive', false]) then {(_this select 0) setVariable ['AGM_isCaptive', false, true]}; if ((_this select 0) getVariable ['AGM_isEscorting', false]) then {(_this select 0) setVariable ['AGM_isEscorting', false, true]};";
};
};
};
//handle captive and unconsciousness state
class Extended_Init_EventHandlers {
class CAManBase {
class AGM_Captives_AutoDetachCaptive {
init = "_this call AGM_Captives_fnc_initUnit";
};
};
};
//mission start
class Extended_InitPost_EventHandlers {
class CAManBase {
class AGM_Captives_InitPost {
init = "if (local (_this select 0)) then {_this call AGM_Captives_fnc_initPost};";
};
};
};
class Extended_PostInit_EventHandlers {
class AGM_Captives {
clientInit = "call compile preprocessFileLineNumbers '\AGM_Captives\clientInit.sqf'";
};
};
class AGM_Core_canInteractConditions {
class AGM_Interaction_isNotEscorting {
condition = "!(_player getVariable ['AGM_isEscorting', false])";
};
class AGM_Interaction_isNotCaptive {
condition = "!(_player getVariable ['AGM_isCaptive', false])";
};
class AGM_Interaction_isNotSurrendering {
condition = "!(_player getVariable ['AGM_isSurrender', false])";
};
};
class CfgVehicles {
class Man;
class CAManBase: Man {
class AGM_Actions {
class AGM_SetCaptive {
displayName = "$STR_AGM_Captives_SetCaptive";
distance = 4;
condition = "'AGM_CableTie' in items _player && {alive _target} && {!(_target getVariable ['AGM_isCaptive', false])}";
statement = "player removeItem 'AGM_CableTie'; [_target, true] call AGM_Captives_fnc_setCaptive";
showDisabled = 0;
priority = 2.4;
icon = "\AGM_Captives\UI\handcuff_ca.paa";
hotkey = "C";
};
class AGM_ReleaseCaptive {
displayName = "$STR_AGM_Captives_ReleaseCaptive";
distance = 4;
condition = "_target getVariable ['AGM_isCaptive', false] && {isNull (attachedTo _target)}";
statement = "[_target, false] call AGM_Captives_fnc_setCaptive";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
showDisabled = 0;
priority = 2.4;
icon = "\AGM_Captives\UI\handcuff_ca.paa";
hotkey = "R";
};
class AGM_EscortCaptive {
displayName = "$STR_AGM_Captives_EscortCaptive";
distance = 4;
condition = "_target getVariable ['AGM_isCaptive', false] && {isNull (attachedTo _target)} && {alive _target} && {!(_target getVariable ['AGM_isUnconscious', false])}";
statement = "[_target, true] call AGM_Captives_fnc_escortCaptive";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
showDisabled = 0;
icon = "\AGM_Captives\UI\captive_ca.paa";
priority = 2.3;
hotkey = "E";
};
class AGM_StopEscorting {
displayName = "$STR_AGM_Captives_StopEscorting";
distance = 4;
condition = "_target getVariable ['AGM_isCaptive', false] && {_target in attachedObjects _player}";
statement = "[_target, false] call AGM_Captives_fnc_escortCaptive";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
showDisabled = 0;
icon = "\AGM_Captives\UI\captive_ca.paa";
priority = 2.3;
hotkey = "E";
};
class AGM_LoadCaptive {
displayName = "$STR_AGM_Captives_LoadCaptive";
distance = 4;
condition = "[_player, _target, objNull] call AGM_Captives_fnc_canLoadCaptive";
statement = "[_player, _target, objNull] call AGM_Captives_fnc_loadCaptive";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
showDisabled = 0;
icon = "\AGM_Captives\UI\captive_ca.paa";
priority = 2.2;
hotkey = "L";
};
class AGM_FriskPerson {
displayName = "$STR_AGM_Captives_FriskPerson";
distance = 2;
condition = "[_player, _target] call AGM_Captives_fnc_canFriskPerson";
statement = "[_player, _target] call AGM_Captives_fnc_openFriskMenu";
showDisabled = 0;
//icon = ""; //@todo
priority = 3;
hotkey = "F";
};
};
class AGM_SelfActions {
class AGM_StopEscortingSelf {
displayName = "$STR_AGM_Captives_StopEscorting";
condition = "(_player getVariable ['AGM_escortedUnit', objNull]) getVariable ['AGM_isCaptive', false] && {(_player getVariable ['AGM_escortedUnit', objNull]) in attachedObjects _player}";
statement = "[_player getVariable ['AGM_escortedUnit', objNull], false] call AGM_Captives_fnc_escortCaptive;";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
showDisabled = 0;
priority = 2.3;
hotkey = "C";
};
/*class AGM_LoadCaptiveSelf {
displayName = "$STR_AGM_Captives_LoadCaptive";
condition = "[_player, objNull, objNull] call AGM_Captives_fnc_canLoadCaptiveIntoVehicle";
statement = "[_player, objNull, objNull] call AGM_Captives_fnc_loadCaptiveIntoVehicle";
exceptions[] = {"AGM_Interaction_isNotEscorting"};
showDisabled = 0;
priority = 2.2;
hotkey = "K";
};*/
};
};
#define MACRO_LOADUNLOADCAPTIVE \
class AGM_Actions { \
class AGM_LoadCaptive { \
displayName = "$STR_AGM_Captives_LoadCaptive"; \
distance = 4; \
condition = "[_player, objNull, _target] call AGM_Captives_fnc_canLoadCaptive"; \
statement = "[_player, objNull, _target] call AGM_Captives_fnc_loadCaptive"; \
exceptions[] = {"AGM_Interaction_isNotEscorting"}; \
showDisabled = 0; \
priority = 1.2; \
hotkey = "L"; \
}; \
class AGM_UnloadCaptive { \
displayName = "$STR_AGM_Captives_UnloadCaptive"; \
distance = 4; \
condition = "[_player, _target] call AGM_Captives_fnc_canUnloadCaptive"; \
statement = "[_player, _target] call AGM_Captives_fnc_unloadCaptive"; \
showDisabled = 0; \
priority = 1.2; \
hotkey = "C"; \
}; \
};
class LandVehicle;
class Car: LandVehicle {
MACRO_LOADUNLOADCAPTIVE
};
class Tank: LandVehicle {
MACRO_LOADUNLOADCAPTIVE
};
class Air;
class Helicopter: Air {
MACRO_LOADUNLOADCAPTIVE
};
class Plane: Air {
MACRO_LOADUNLOADCAPTIVE
};
class Ship;
class Ship_F: Ship {
MACRO_LOADUNLOADCAPTIVE
};
class StaticWeapon: LandVehicle {
MACRO_LOADUNLOADCAPTIVE
};
class StaticMortar;
class Mortar_01_base_F: StaticMortar {
MACRO_LOADUNLOADCAPTIVE
};
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
name = #ITEM; \
count = COUNT; \
};
class Box_NATO_Support_F;
class AGM_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(AGM_CableTie,12)
};
};
};
class CfgWeapons {
class AGM_ItemCore;
class InventoryItem_Base_F;
class AGM_CableTie: AGM_ItemCore {
displayName = "$STR_AGM_Captives_CableTie";
descriptionShort = "$STR_AGM_Captives_CableTieDescription";
model = "\AGM_Captives\agm_cabletie.p3d";
picture = "\AGM_Captives\UI\agm_cabletie_x_ca.paa";
scope = 2;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
};
};
};
/*class CfgMovesBasic;
class CfgMovesMaleSdr: CfgMovesBasic {
class States {
class CutSceneAnimationBase;
class AmovPercMstpSnonWnonDnon_EaseIn: CutSceneAnimationBase {
head = "headDefault";
static = 1;
disableWeapons = 0;
forceAim = 0;
InterpolateTo[] = {"AmovPercMstpSnonWnonDnon_EaseOut",0.02,"Unconscious",0.1};
};
class AmovPercMstpSnonWnonDnon_Ease: AmovPercMstpSnonWnonDnon_EaseIn {
looped = 1;
InterpolateTo[] = {"Unconscious",0.1};
};
class AmovPercMstpSnonWnonDnon_EaseOut: AmovPercMstpSnonWnonDnon_EaseIn {
InterpolateTo[] = {"AmovPercMstpSnonWnonDnon_EaseIn",0.02,"Unconscious",0.1};
};
class AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon: CutSceneAnimationBase {
InterpolateTo[] = {"Unconscious",0.01,"AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
};
class AmovPercMstpSsurWnonDnon: AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
looped = 1;
InterpolateTo[] = {"Unconscious",0.01};
};
class AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon: AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
InterpolateTo[] = {"Unconscious",0.01,"AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon",0.1};
};
};
};*/
class CfgMovesBasic {
class Actions {
class CivilStandActions;
class AGM_CivilStandCaptiveActions: CivilStandActions {
turnL = "";
turnR = "";
stop = "AGM_AmovPercMstpScapWnonDnon";
StopRelaxed = "AGM_AmovPercMstpScapWnonDnon";
default = "AGM_AmovPercMstpScapWnonDnon";
getOver = "";
throwPrepare = "";
throwGrenade[] = {"","Gesture"};
};
};
};
class CfgMovesMaleSdr: CfgMovesBasic {
class StandBase;
class States {
class AmovPercMstpSnonWnonDnon: StandBase {
ConnectTo[] += {"AGM_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1};
};
class CutSceneAnimationBase;
class AGM_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon: CutSceneAnimationBase {
actions = "AGM_CivilStandCaptiveActions";
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_EaseIn";
speed = 1;
looped = 0;
interpolationRestart = 2;
ConnectTo[] = {"AGM_AmovPercMstpScapWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"AGM_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
};
class AGM_AmovPercMstpScapWnonDnon: AGM_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon {
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease";
speed = 0;
ConnectTo[] = {"AGM_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01};
looped = 1;
};
class AGM_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon: AGM_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon {
actions = "CivilStandActions";
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\amovpercmstpsnonwnondnon_easeout";
ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"AGM_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1};
};
};
};
/*
player playMove "AGM_AmovPercMstpScapWnonDnon";
player switchMove "AGM_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon";
*/

View File

@ -1,21 +0,0 @@
/*
* By: bux578
*
* Checks the conditions for being able to frisk a unit
*
* Arguments:
* 0: caller (player) (Object)
* 1: target (Object)
*
* Return Value:
* Boolean
*/
private ["_unit", "_target"];
_unit = _this select 0;
_target = _this select 1;
_target getVariable ["AGM_isCaptive", false]
|| {_target getVariable ["AGM_isSearchable", false]}
|| {_target getVariable ["AGM_isUnconscious", false]}

View File

@ -1,35 +0,0 @@
/*
* Author: commy2
*
* Check if the unit can load the target object into a vehicle.
*
* Argument:
* 0: Unit that wants to load a captive (Object)
* 1: A captive. ObjNull for the first escorted captive (Object)
* 2: Vehicle to load the captive into. ObjNull for the nearest vehicle (Object)
*
* Return value:
* Boolean (Bool)
*/
private ["_unit", "_target", "_vehicle", "_objects"];
_unit = _this select 0;
_target = _this select 1;
_vehicle = _this select 2;
if (isNull _target) then {
_objects = attachedObjects _unit;
_objects = [_objects, {_this getVariable ["AGM_isCaptive", false]}] call AGM_Core_fnc_filter;
_target = _objects select 0;
};
if (isNull _vehicle) then {
_objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship_F"], 10];
_vehicle = _objects select 0;
};
_unit getVariable ["AGM_isEscorting", false]
&& {!isNil "_target"}
&& {!isNil "_vehicle"}
&& {_vehicle emptyPositions "cargo" > 0}

View File

@ -1,23 +0,0 @@
/*
* Author: commy2
*
* Check if the unit can unload a captive from the vehicle.
*
* Argument:
* 0: Unit that wants to unload a captive (Object)
* 1: Vehicle to unload a captive from. (Object)
*
* Return value:
* Boolean (Bool)
*/
private ["_unit", "_vehicle", "_cargo"];
_unit = _this select 0;
_vehicle = _this select 1;
_cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turret positions. They shouldn't be there anyway.
_cargo = [_cargo, {_this getVariable ["AGM_isCaptive", false]}] call AGM_Core_fnc_filter;
count _cargo > 0

View File

@ -1,43 +0,0 @@
//author : Nic547
//Attaches a Captive to the player
private ["_unit", "_state"];
_unit = _this select 0;
_state = _this select 1;
if !("AGM_Handcuffed" in ([_unit] call AGM_Core_fnc_getCaptivityStatus)) exitWith {
[localize "STR_AGM_Captives_NoCaptive"] call AGM_Core_fnc_displayTextStructured;
};
if (_state) then {
if (player getVariable ["AGM_isEscorting", false]) exitWith {};
[player, _unit] call AGM_Core_fnc_claim;
player setVariable ["AGM_isEscorting", true, true];
_unit attachTo [player, [0, 1, 0]];
player setVariable ["AGM_escortedUnit", _unit, true];
_actionID = player addAction [format ["<t color='#FF0000'>%1</t>", localize "STR_AGM_Captives_StopEscorting"], "[player getVariable ['AGM_escortedUnit', objNull], false] call AGM_Captives_fnc_escortCaptive;", nil, 20, false, true, "", "!isNull (player getVariable ['AGM_escortedUnit', objNull])"];
[_unit, _actionID] spawn {
_unit = _this select 0;
_actionID = _this select 1;
while {player getVariable ["AGM_isEscorting", false]} do {
sleep 0.2;
if (!alive _unit || {!alive player} || {!canStand _unit} || {!canStand player} || {_unit getVariable ["AGM_isUnconscious", false]} || {player getVariable ["AGM_isUnconscious", false]} || {!isNull (attachedTo player)}) then {
player setVariable ["AGM_isEscorting", false, true];
};
};
[objNull, _unit] call AGM_Core_fnc_claim;
detach _unit;
player removeAction _actionID;
};
} else {
player setVariable ["AGM_isEscorting", false, true];
player setVariable ["AGM_escortedUnit", objNull, true];
};

View File

@ -1,14 +0,0 @@
// by commy2
private ["_vehicle", "_unit", "_cargoIndex"];
_vehicle = _this select 0;
_unit = _this select 2;
_cargoIndex = _unit getVariable ["AGM_Captives_CargoIndex", -1];
if (_cargoIndex != -1) exitWith {
_unit moveInCargo [_vehicle, _cargoIndex];
};
[_unit, 'AGM_AmovPercMstpScapWnonDnon', 2] call AGM_Core_fnc_doAnimation;

View File

@ -1,2 +0,0 @@
// by commy2

View File

@ -1,12 +0,0 @@
// by commy2
private ["_unit", "_oldUnit"];
_unit = _this select 0;
_oldUnit = _this select 1;
if (_unit getVariable ["AGM_isCaptive", false]) then {
showHUD false;
} else {
showHUD true;
};

View File

@ -1,10 +0,0 @@
// by commy2
private "_unit";
_unit = _this select 0;
if (_unit getVariable ["AGM_isCaptive", false] && {vehicle _unit == _unit}) then {
[_unit] call AGM_Core_fnc_fixLoweredRifleAnimation;
[_unit, "AGM_AmovPercMstpScapWnonDnon", 0] call AGM_Core_fnc_doAnimation;
};

View File

@ -1,11 +0,0 @@
// by commy2
private "_unit";
_unit = _this select 0;
// reset status on mission start
if (_unit getVariable ["AGM_isCaptive", false]) then {
_unit setVariable ["AGM_isCaptive", false];
[_unit, true] call AGM_Captives_fnc_setCaptive;
};

View File

@ -1,12 +0,0 @@
// by commy2
[_this select 0, "knockedOut", {
if (local (_this select 0)) then {_this call AGM_Captives_fnc_handleKnockedOut};
}] call AGM_Core_fnc_addCustomEventhandler;
[_this select 0, "wokeUp", {
if (local (_this select 0)) then {_this call AGM_Captives_fnc_handleWokeUp};
}] call AGM_Core_fnc_addCustomEventhandler;
// prevent players from throwing grenades
[_this select 0, "Throw", {(_this select 1) getVariable ["AGM_isCaptive", false]}, {}] call AGM_Core_fnc_addActionEventhandler;

View File

@ -1,35 +0,0 @@
/*
* Author: commy2
*
* Unit loads the target object into a vehicle.
*
* Argument:
* 0: Unit that wants to load a captive (Object)
* 1: A captive. ObjNull for the first escorted captive (Object)
* 2: Vehicle to load the captive into. ObjNull for the nearest vehicle (Object)
*
* Return value:
* Nothing
*/
private ["_unit", "_target", "_vehicle", "_objects"];
_unit = _this select 0;
_target = _this select 1;
_vehicle = _this select 2;
if (isNull _target) then {
_objects = attachedObjects _unit;
_objects = [_objects, {_this getVariable ["AGM_isCaptive", false]}] call AGM_Core_fnc_filter;
_target = _objects select 0;
};
if (isNull _vehicle) then {
_objects = nearestObjects [_unit, ["Car_F", "Tank_F", "Helicopter_F", "Boat_F", "Plane_F"], 10];
_vehicle = _objects select 0;
};
if (!isNil "_target" && {!isNil "_vehicle"}) then {
_unit setVariable ["AGM_isEscorting", false];
[[_target, _vehicle], "{(_this select 0) moveInCargo (_this select 1); (_this select 0) assignAsCargo (_this select 1); (_this select 0) setVariable ['AGM_Captives_CargoIndex', (_this select 1) getCargoIndex (_this select 0), true];}", _target] call AGM_Core_fnc_execRemoteFnc;
};

View File

@ -1,70 +0,0 @@
/*
Name: AGM_Captives_fnc_openFriskMenu
Author: bux578
Description:
Open the select menu with the "personal" items of a frisked unit
It only shows "handgunWeapon", "uniformItems", "vestItems", "backpackItems" and "assignedItems" because every other item is visible on the character
Parameters:
0: Object - player unit
1: Object - unit
Returns:
Nothing
*/
private ["_player", "_unit", "_weapon", "_listedItemClasses", "_actions", "_allGear"];
_player = _this select 0;
_unit = _this select 1;
_weapon = currentWeapon _player;
if (_weapon == primaryWeapon _player && {_weapon != ""}) then {
[_player, "AmovPercMstpSlowWrflDnon", 0] call AGM_Core_fnc_doAnimation;
};
_listedItemClasses = [];
_actions = [localize "STR_AGM_Captives_FriskMenuHeader", localize "STR_AGM_Captives_CancelSelection"] call AGM_Interaction_fnc_prepareSelectMenu;
_allGear = [];
if ((handgunWeapon _unit) != "") then {
_allGear pushBack (handgunWeapon _unit);
};
if (count (uniformItems _unit) > 0) then {
_allGear = _allGear + (uniformItems _unit);
};
if (count (vestItems _unit) > 0) then {
_allGear = _allGear + (vestItems _unit);
};
if (count (backpackItems _unit) > 0) then {
_allGear = _allGear + (backpackItems _unit);
};
if (count (assignedItems _unit) > 0) then {
_allGear = _allGear + (assignedItems _unit);
};
// Handgun
// Uniform Items
// Vest Items
// Backpack Items
// Assigned Items
{
if (!(_x in _listedItemClasses)) then {
private "_item";
_item = configFile >> "CfgMagazines" >> _x;
if (isNil "_item" || str _item == "") then { //str _item ?
_item = configFile >> "CfgWeapons" >> _x;
};
_actions = [_actions, getText(_item >> "displayName"), getText(_item >> "picture"), _x] call AGM_Interaction_fnc_addSelectableItem;
_listedItemClasses pushBack _x;
};
} forEach (_allGear);
[_actions, {call AGM_Interaction_fnc_hideMenu;}, {call AGM_Interaction_fnc_hideMenu;}] call AGM_Interaction_fnc_openSelectMenu;
// don't need an "Ok" Button
ctrlShow [8860, false];

View File

@ -1,57 +0,0 @@
/*
* Author: Nic547, commy2
*
* Makes a civilian unable to move.
*
* Argument:
* 0: Unit (Object)
* 1: True to take captive, false to release captive (Object)
*
* Return value:
* Nothing
*/
private ["_unit", "_state"];
_unit = _this select 0;
_state = _this select 1;
if (!local _unit) exitWith {[[_unit, _state, true], _fnc_scriptName, _unit] call AGM_Core_fnc_execRemoteFnc};
if (_state) then {
if (_unit getVariable ["AGM_isCaptive", false]) exitWith {};
_unit setVariable ["AGM_isCaptive", true, true];
// fix anim on mission start (should work on dedicated servers)
_unit spawn {
[_this, "AGM_Handcuffed", true] call AGM_Core_fnc_setCaptivityStatus;
if (_this getVariable ["AGM_isCaptive", false] && {vehicle _this == _this}) then {
[_this] call AGM_Core_fnc_fixLoweredRifleAnimation;
[_this, "AGM_AmovPercMstpScapWnonDnon", 0] spawn AGM_Core_fnc_doAnimation;
};
};
_unit setVariable ["AGM_Captives_CargoIndex", vehicle _unit getCargoIndex _unit, true];
if (_unit == AGM_player) then {
showHUD false;
};
} else {
if !(_unit getVariable ["AGM_isCaptive", false]) exitWith {};
_unit setVariable ["AGM_isCaptive", false, true];
[_unit, "AGM_Handcuffed", false] call AGM_Core_fnc_setCaptivityStatus;
if (vehicle _unit == _unit) then {
[_unit, "AGM_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call AGM_Core_fnc_doAnimation;
};
if (_unit getVariable ["AGM_Captives_CargoIndex", -1] != -1) then {
_unit setVariable ["AGM_Captives_CargoIndex", -1, true];
};
if (_unit == AGM_player) then {
showHUD true;
};
};

View File

@ -1,50 +0,0 @@
// by commy2
private ["_unit", "_state"];
_unit = _this select 0;
_state = _this select 1;
if (!local _unit) exitWith {[_this, _fnc_scriptName, _unit] call AGM_Core_fnc_execRemoteFnc};
if (_state) then {
if (_unit getVariable ["AGM_isSurrender", false]) exitWith {};
_unit setVariable ["AGM_isSurrender", true, true];
[_unit, "AGM_Surrendered", true] call AGM_Core_fnc_setCaptivityStatus;
_unit spawn {
// fix for lowered rifle animation glitch
if (currentWeapon _this != "" && {currentWeapon _this == primaryWeapon _this} && {weaponLowered _this} && {stance _this == "STAND"}) then {
_this playMove "amovpercmstpsraswrfldnon";
};
while {_this getVariable ["AGM_isSurrender", false]} do {
sleep 0.001; //sleep in UI
if (isPlayer _this) then {showHUD false};
if (!alive _this || {_this getVariable ["AGM_isUnconscious", false]}) then {
_this setVariable ["AGM_isSurrender", false, true];
} else {
_this playMove "amovpercmstpsnonwnondnon_amovpercmstpssurwnondnon";
};
};
if !(_this getVariable ["AGM_isUnconscious", false]) then {
_this playMoveNow "AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon";
} else {
_this playMoveNow "unconscious";
};
[_this, "AGM_Surrendered", false] call AGM_Core_fnc_setCaptivityStatus;
if (isPlayer _this) then {showHUD true};
};
} else {
_unit setVariable ["AGM_isSurrender", false, true];
};
/*
player playMove "AmovPercMstpSsurWnonDnon"
player switchMove "AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon"
*/

View File

@ -1,31 +0,0 @@
/*
* Author: commy2
*
* Unit unloads a captive from a vehicle.
*
* Argument:
* 0: Unit that wants to unload a captive (Object)
* 1: Vehicle to unload a captive from. (Object)
*
* Return value:
* Nothing
*/
private ["_unit", "_vehicle", "_cargo", "_target"];
_unit = _this select 0;
_vehicle = _this select 1;
_cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turret positions. They shouldn't be there anyway.
_cargo = [_cargo, {_this getVariable ["AGM_isCaptive", false]}] call AGM_Core_fnc_filter;
if (count _cargo > 0) then {
_target = _cargo select 0;
_target setVariable ["AGM_Captives_CargoIndex", -1, true];
moveOut _target;
[_target, "AGM_AmovPercMstpScapWnonDnon", 2] call AGM_Core_fnc_doAnimation;
[_target, "{unassignVehicle _this}", _target] call AGM_Core_fnc_execRemoteFnc;
};

View File

@ -1,98 +0,0 @@
/**
* fn_moduleAmbianceSoundLoop.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_logic", "_units", "_activated","_ambianceSounds", "_soundFiles", "_minimalDistance","_maximalDistance", "_minimalDistance", "_maxDelayBetweenSounds", "_allUnits", "_newPos", "_targetUnit", "_soundToPlay", "_soundPath", "_unparsedSounds", "_list", "_splittedList", "_nilCheckPassedList"];
_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param;
_units = [_this,1,[],[[]]] call BIS_fnc_param;
_activated = [_this,2,true,[true]] call BIS_fnc_param;
if (_activated && isServer) then {
_ambianceSounds = [];
_unparsedSounds = _logic getvariable ["soundFiles", ""];
_minimalDistance = (_logic getvariable ["minimalDistance", 400]) max 1;
_maximalDistance = (_logic getvariable ["maximalDistance", 10]) max _minimalDistance;
_minDelayBetweensounds = (_logic getvariable ["minimalDelay", 10]) max 1;
_maxDelayBetweenSounds = (_logic getvariable ["maximalDelay", 170]) max _minDelayBetweensounds;
_volume = (_logic getvariable ["soundVolume", 30]) max 1;
_followPlayers = _logic getvariable ["followPlayers", false];
_splittedList = [_unparsedSounds, ","] call BIS_fnc_splitString;
_nilCheckPassedList = "";
{
_x = [_x] call cse_fnc_string_removeWhiteSpace;
_splittedList set [_foreachIndex, _x];
}foreach _splittedList;
_soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
{
if (isclass (missionConfigFile >> "CfgSounds" >> _x)) then {
_ambianceSounds pushback (_soundPath + (getArray(missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0));
} else {
if (isclass (configFile >> "CfgSounds" >> _x)) then {
_ambianceSounds pushback ((getArray(configFile >> "CfgSounds" >> _x >> "sound") select 0));
};
};
}foreach _splittedList;
if (count _ambianceSounds == 0) exitwith {
[format["No Ambiance sounds available"]] call cse_fnc_debug;
};
{
if !([".", _x, true] call BIS_fnc_inString) then {
[format["Ambiance soundfile does not contain a file extension %1", _x]] call cse_fnc_debug;
_ambianceSounds set [_foreachIndex, _x + ".wss"];
};
}foreach _ambianceSounds;
[format["Ambiance sounds %1", _ambianceSounds]] call cse_fnc_debug;
while {alive _logic} do {
_allUnits = switch (true) do {
case isMultiplayer: {playableUnits};
case isDedicated: {[_logic]};
default {[player]};
};
if (count _allUnits > 0) then {
_targetUnit = _allUnits select (round(random((count _allUnits)-1)));
_newPos = (getPos _targetUnit);
if (!_followPlayers) then {
_newPos = getPos _logic;
};
if (random(1) >= 0.5) then {
if (random(1) >= 0.5) then {
_newPos set [0, (_newPos select 0) + (_minimalDistance + random(_maximalDistance))];
} else {
_newPos set [0, (_newPos select 0) - (_minimalDistance + random(_maximalDistance))];
};
} else {
if (random(1) >= 0.5) then {
_newPos set [1, (_newPos select 1) + (_minimalDistance + random(_maximalDistance))];
} else {
_newPos set [1, (_newPos select 1) - (_minimalDistance + random(_maximalDistance))];
};
};
if ({(_newPos distance _x < (_minimalDistance / 2))}count _allUnits == 0) then {
_soundToPlay = _ambianceSounds select (round(random((count _ambianceSounds)-1)));
playSound3D [_soundToPlay, _targetUnit, false, _newPos, _volume, 1, 1000];
[format["Played a sound %1", _soundToPlay]] call cse_fnc_debug;
sleep (_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds;
};
};
};
};
true;

View File

@ -1,302 +1,43 @@
class CfgAmmo {
class BulletBase;
class B_20mm: BulletBase {
deflecting = 3;
hit = 100;
indirectHit = 10;
indirectHitRange = 2;
model = "\A3\Weapons_f\Data\bullettracer\tracer_red";
};
// adjust minigun caliber and deflection to other ammo
class SubmunitionBullet;
class B_65x39_Minigun_Caseless: SubmunitionBullet {
hit = 10;
indirectHit = 0;
indirectHitRange = 0;
caliber = 1;
deflecting = 5;
typicalSpeed = 850;
deflecting = 15;
};
class B_762x51_Minigun_Tracer_Red: SubmunitionBullet {
hit = 12;
indirectHit = 0;
indirectHitRange = 0;
model = "\A3\Weapons_f\Data\bullettracer\tracer_red";
caliber = 1.6;
deflecting = 5;
typicalSpeed = 850;
};
class M_Titan_AA;
class M_Zephyr: M_Titan_AA {
proxyShape = "\A3\Weapons_F\Ammo\Missile_AA_02_F.p3d";
model = "\A3\Weapons_F\Ammo\Missile_AA_02_fly_F.p3d";
airFriction = 0.078;
sideAirFriction = 0.18;
maneuvrability = 24;
class CamShakeFire {};
class CamShakePlayerFire {};
};
class M_Zephyr_Mi06: M_Zephyr {
maverickWeaponIndexOffset = 6;
};
class MissileBase;
class M_Air_AA: MissileBase {
model = "\A3\Weapons_F\Ammo\Missile_AT_02_fly_F";
proxyShape = "\A3\Weapons_F\Ammo\Missile_AT_02_F";
hit = 280;
indirectHit = 85;
indirectHitRange = 10;
maneuvrability = 27;
simulationStep = 0.002;
airLock = 1;
irLock = 1;
cost = 1500;
//maxSpeed = 2400;
timeToLive = 40;
airFriction = 0.05;
sideAirFriction = 0.1;
trackOversteer = 1;
trackLead = 1;
initTime = 0;
thrustTime = 12;
thrust = 340;
fuseDistance = 500;
weaponLockSystem = "2 + 16";
maxControlRange = 8000;
class CamShakeExplode {};
class CamShakeHit {};
class CamShakeFire {};
class CamShakePlayerFire {};
};
class Missile_AA_04_F: MissileBase {
hit = 800;
indirectHit = 60;
indirectHitRange = 12;
airLock = 2;
irLock = 1;
laserLock = 0;
nvLock = 0;
weaponLockSystem = "2 + 16";
cmimmunity = 0.8;
initTime = 0;
thrust = 380;
thrustTime = 9.5;
airFriction = 0.04;
sideAirFriction = 0.08;
//maxSpeed = 2600;
maneuvrability = 14;
simulationStep = 0.002;
fuseDistance = 500;
timeToLive = 19;
trackLead = 1;
trackOversteer = 1;
deflecting = 15;
};
// also adjust tracer, "muh lightshow"; also adjust splash damage radius
class BulletBase;
class Gatling_30mm_HE_Plane_CAS_01_F: BulletBase {
model = "\A3\Weapons_f\Data\bullettracer\tracer_red.p3d";
cost = 20;
hit = 80;
indirectHit = 12;
indirectHitRange = 3;
indirectHitRange = 3; //2;
caliber = 1.4;
explosive = 0.6;
airlock = 1;
deflecting = 3;
airFriction = -0.00042;
typicalSpeed = 960;
visibleFire = 32;
audibleFire = 32;
visibleFireTime = 3;
fuseDistance = 3;
tracerScale = 2.5;
tracerStartTime = 0.02;
tracerEndTime = 4.7;
multiSoundHit[] = {"soundHit1",0.2,"soundHit2",0.2,"soundHit3",0.2,"soundHit4",0.1,"soundHit5",0.15,"soundHit6",0.15};
soundFly[] = {"A3\Sounds_F\weapons\Explosion\cannon_fly",1,1,50};
explosionSoundEffect = "DefaultExplosion";
explosionEffects = "ExploAmmoExplosion";
craterEffects = "ExploAmmoCrater";
soundHit1[] = {"A3\Sounds_F\weapons\Explosion\gr_explosion_1",3.16228,1,1600};
soundHit2[] = {"A3\Sounds_F\weapons\Explosion\gr_explosion_2",3.16228,1,1600};
soundHit3[] = {"A3\Sounds_F\weapons\Explosion\gr_explosion_3",3.16228,1,1600};
soundHit4[] = {"A3\Sounds_F\weapons\Explosion\gr_explosion_4",3.16228,1,1600};
soundHit5[] = {"A3\Sounds_F\weapons\Explosion\gr_explosion_5",3.16228,1,1600};
soundHit6[] = {"A3\Sounds_F\weapons\Explosion\gr_explosion_6",3.16228,1,1600};
class CamShakeExplode {};
class CamShakeHit {};
class CamShakeFire {};
class CamShakePlayerFire {};
};
// helper projectiles to simulate a rof > fps
class ACE_Gatling_30mm_HE_Plane_CAS_01_Deploy: Gatling_30mm_HE_Plane_CAS_01_F {
simulation = "shotSubmunitions";
triggerTime = 0;
submunitionAmmo = "ACE_Gatling_30mm_HE_Plane_CAS_01_Sub";
submunitionConeType[] = {"custom", {{0,0}, {0,0}, {0,0}} };
};
class ACE_Gatling_30mm_HE_Plane_CAS_01_Sub: Gatling_30mm_HE_Plane_CAS_01_F {
};
class ACE_Gatling_30mm_HE_Plane_CAS_01_Sub: Gatling_30mm_HE_Plane_CAS_01_F {};
// adjust damage and splash damage, closer to bluefor gatling with same caliber
class Cannon_30mm_HE_Plane_CAS_02_F: Gatling_30mm_HE_Plane_CAS_01_F {
model = "\A3\Weapons_f\Data\bullettracer\tracer_green.p3d";
hit = 70;
indirectHit = 11;
hit = 70; //40;
indirectHit = 11; //14;
indirectHitRange = 3;
caliber = 2;
explosive = 0.6;
};
class Missile_AGM_02_F: MissileBase {
model = "\A3\Weapons_F_EPC\Ammo\Missile_AGM_02_fly_F.p3d";
proxyShape = "\A3\Weapons_F_EPC\Ammo\Missile_AGM_02_F.p3d";
maverickWeaponIndexOffset = 2;
cost = 1500;
hit = 2100;
indirectHit = 85;
indirectHitRange = 8;
manualControl = 0;
maxControlRange = 8000;
airLock = 0;
irLock = 1;
laserLock = 0;
nvLock = 0;
weaponLockSystem = "2 + 16";
cmimmunity = 0.8;
initTime = 0;
thrust = 240;
thrustTime = 5;
airFriction = 0.05;
sideAirFriction = 0.1;
maxSpeed = 828;
maneuvrability = 27;
simulationStep = 0.002;
fuseDistance = 500;
timeToLive = 40;
trackLead = 1;
trackOversteer = 1;
craterEffects = "AAMissileCrater";
effectsMissile = "missile3";
explosionEffects = "AAMissileExplosion";
muzzleEffect = "BIS_fnc_effectFiredHeliRocket";
whistleDist = 20;
class CamShakeExplode {};
class CamShakeHit {};
class CamShakeFire {};
class CamShakePlayerFire {};
};
class LaserBombCore;
class Bomb_04_F: LaserBombCore {
model = "\A3\Weapons_F_EPC\Ammo\Bomb_04_fly_F.p3d";
proxyShape = "\A3\Weapons_F_EPC\Ammo\Bomb_04_F.p3d";
maverickWeaponIndexOffset = 8;
hit = 6000;
indirectHit = 1400;
indirectHitRange = 15;
nvLock = 1;
weaponLockSystem = "2 + 16 + 4";
maneuvrability = 20;
fuseDistance = 35;
trackLead = 0.95;
trackOversteer = 1;
craterEffects = "BombCrater";
explosionEffects = "BombExplosion";
explosionSoundEffect = "DefaultExplosion";
explosionTime = 2;
multiSoundHit[] = {"soundHit1",0.2,"soundHit2",0.2,"soundHit3",0.2,"soundHit4",0.2,"soundHit5",0.2};
soundHit1[] = {"\A3\Sounds_F\weapons\Explosion\expl_big_1",2.51189,1,2400};
soundHit2[] = {"\A3\Sounds_F\weapons\Explosion\expl_big_2",2.51189,1,2400};
soundHit3[] = {"\A3\Sounds_F\weapons\Explosion\expl_big_3",2.51189,1,2400};
soundHit4[] = {"\A3\Sounds_F\weapons\Explosion\expl_shell_1",2.51189,1,2400};
soundHit5[] = {"\A3\Sounds_F\weapons\Explosion\expl_shell_2",2.51189,1,2400};
whistleDist = 24;
};
class Rocket_04_HE_F: MissileBase {
model = "\A3\Weapons_F_EPC\Ammo\Rocket_04_HE_fly_F.p3d";
proxyShape = "\A3\Weapons_F_EPC\Ammo\Rocket_04_HE_F.p3d";
maverickWeaponIndexOffset = 12;
cost = 500;
hit = 210;
indirectHit = 55;
indirectHitRange = 15;
manualControl = 0;
maxControlRange = 8000;
airLock = 0;
irLock = 1;
laserLock = 0;
nvLock = 0;
weaponLockSystem = 0;
cmimmunity = 1;
initTime = 0.002;
thrust = 1600;
thrustTime = 0.7;
airFriction = 0.0046;
sideAirFriction = 0.005;
maxSpeed = 610;
maneuvrability = 0;
fuseDistance = 50;
timeToLive = 60;
effectsMissileInit = "MissileDAR1";
whistleDist = 30;
class CamShakeExplode {};
class CamShakeHit {};
class CamShakeFire {};
class CamShakePlayerFire {};
};
class Rocket_04_AP_F: Rocket_04_HE_F {
model = "\A3\Weapons_F_EPC\Ammo\Rocket_04_AP_fly_F.p3d";
proxyShape = "\A3\Weapons_F_EPC\Ammo\Rocket_04_AP_F.p3d";
maverickWeaponIndexOffset = 19;
hit = 400;
indirectHit = 20;
indirectHitRange = 10;
};
class Missile_AA_03_F: Missile_AA_04_F {
model = "\A3\Weapons_F_EPC\Ammo\Missile_AA_03_fly_F.p3d";
proxyShape = "\A3\Weapons_F_EPC\Ammo\Missile_AA_03_F.p3d";
maverickWeaponIndexOffset = 0;
hit = 900;
indirectHit = 50;
indirectHitRange = 15;
};
class Missile_AGM_01_F: Missile_AGM_02_F {
model = "\A3\Weapons_F_EPC\Ammo\Missile_AGM_01_fly_F.p3d";
proxyShape = "\A3\Weapons_F_EPC\Ammo\Missile_AGM_01_F.p3d";
maverickWeaponIndexOffset = 2;
hit = 2200;
indirectHit = 90;
indirectHitRange = 10;
};
class Bomb_03_F: Bomb_04_F {
model = "\A3\Weapons_F_EPC\Ammo\Bomb_03_F.p3d";
proxyShape = "\A3\Weapons_F_EPC\Ammo\Bomb_03_F.p3d";
maverickWeaponIndexOffset = 6;
hit = 6400;
indirectHit = 1400;
indirectHitRange = 16;
};
class Rocket_03_HE_F: Rocket_04_HE_F {
model = "\A3\Weapons_F_EPC\Ammo\Rocket_03_HE_fly_F.p3d";
proxyShape = "\A3\Weapons_F_EPC\Ammo\Rocket_03_HE_F.p3d";
maverickWeaponIndexOffset = 8;
};
class Rocket_03_AP_F: Rocket_04_AP_F {
model = "\A3\Weapons_F_EPC\Ammo\Rocket_03_AP_fly_F.p3d";
proxyShape = "\A3\Weapons_F_EPC\Ammo\Rocket_03_AP_F.p3d";
maverickWeaponIndexOffset = 28;
};
class RocketBase;
};

View File

@ -1,202 +1,15 @@
class CfgMagazines {
// shoot helper object to tripple rof
class VehicleMagazine;
class 24Rnd_PG_missiles;
class 12Rnd_PG_missiles: 24Rnd_PG_missiles {
count = 12;
displayName = "$STR_A3_CfgMagazines_12Rnd_PG_missiles0";
displayNameShort = "$STR_A3_CfgMagazines_12Rnd_PG_missiles_dns";
descriptionShort = "$STR_A3_CfgMagazines_12Rnd_PG_missiles1";
};
class 12Rnd_missiles: VehicleMagazine {
scope = 2;
count = 12;
ammo = "M_AT";
displayName = "$STR_A3_CfgMagazines_24Rnd_PuG_missiles0";
displayNameShort = "$STR_A3_CfgMagazines_24Rnd_PuG_missiles_dns";
descriptionShort = "$STR_A3_CfgMagazines_24Rnd_PuG_missiles0";
initSpeed = 44;
maxLeadSpeed = 800;
nameSound = "rockets";
sound[] = {"A3\sounds_f\weapons\rockets\explosion_missile_01",1,1,1200};
reloadSound[] = {"",0.000316228,1};
};
//minigun magazines, muzzle velocities and tracercounts
class 200Rnd_65x39_Belt: VehicleMagazine {};
class 2000Rnd_65x39_Belt: 200Rnd_65x39_Belt {};
class 2000Rnd_65x39_Belt_Tracer_Red: 2000Rnd_65x39_Belt {
};
class 2000Rnd_65x39_Belt_Green: 2000Rnd_65x39_Belt {};
class 2000Rnd_65x39_Belt_Tracer_Green: 2000Rnd_65x39_Belt_Green {
tracersEvery = 1;
};
class 2000Rnd_65x39_Belt_Yellow: 2000Rnd_65x39_Belt {
tracersEvery = 1;
};
class 2000Rnd_65x39_Belt_Tracer_Yellow: 2000Rnd_65x39_Belt_Yellow {
tracersEvery = 1;
};
class 5000Rnd_762x51_Belt: 2000Rnd_65x39_Belt {
tracersEvery = 1;
count = 5000;
};
class 5000Rnd_762x51_Yellow_Belt: 5000Rnd_762x51_Belt {};
class 4000Rnd_762x51_M134 : 5000Rnd_762x51_Belt {
count = 4000;
tracersEvery = 1;
};
class 2000Rnd_762x51_M134 : 4000Rnd_762x51_M134 {
count = 2000;
tracersEvery = 1;
};
class 2Rnd_AAA_missiles: VehicleMagazine {
scope = 2;
displayName = "$STR_A3_CfgMagazines_2Rnd_AAA_missiles0";
displayNameShort = "$STR_A3_CfgMagazines_2Rnd_AAA_missiles_dns";
ammo = "M_Air_AA";
count = 2;
maxLeadSpeed = 950;
nameSound = "missiles";
};
class 2Rnd_AAA_missiles_MI02: 2Rnd_AAA_missiles {
ammo = "M_Air_AA_MI02";
};
class 4Rnd_AAA_missiles: 2Rnd_AAA_missiles {
displayName = "$STR_A3_CfgMagazines_4Rnd_AAA_missiles0";
displayNameShort = "$STR_A3_CfgMagazines_4Rnd_AAA_missiles_dns";
count = 4;
};
class 4Rnd_AAA_missiles_MI02: 4Rnd_AAA_missiles {
ammo = "M_Air_AA_MI02";
};
class 4Rnd_GAA_missiles: VehicleMagazine {
scope = 2;
displayName = "$STR_A3_CfgMagazines_4Rnd_GAA_missiles0";
displayNameShort = "$STR_A3_CfgMagazines_4Rnd_GAA_missiles_dns";
count = 4;
ammo = "M_Zephyr";
maxLeadSpeed = 950;
nameSound = "missiles";
};
class 300Rnd_20mm_shells: VehicleMagazine {
scope = 2;
displayName = "$STR_A3_CfgMagazines_300Rnd_20mm_shells0";
displayNameShort = "$STR_A3_CfgMagazines_300Rnd_20mm_shells_dns";
ammo = "B_20mm";
count = 300;
deflecting = 3;
maxLeadSpeed = 300;
tracersEvery = 5;
nameSound = "cannon";
};
class 1000Rnd_Gatling_30mm_Plane_CAS_01_F: VehicleMagazine {
scope = 2;
displayNameShort = "";
ammo = "ACE_Gatling_30mm_HE_Plane_CAS_01_Deploy";
count = 1170;
//count = 390;
//initSpeed = 3852;
maxLeadSpeed = 300;
nameSound = "cannon";
tracersEvery = 1;
};
class 2Rnd_Missile_AA_04_F: VehicleMagazine {
scope = 2;
displayNameShort = "$STR_A3_CFGMAGAZINES_4RND_AAA_MISSILES_DNS";
ammo = "Missile_AA_04_F";
count = 2;
maxLeadSpeed = 220;
nameSound = "missiles";
};
class 6Rnd_Missile_AGM_02_F: VehicleMagazine {
scope = 2;
displayNameShort = "$STR_A3_CFGMAGAZINES_38RND_80MM_ROCKETS_DNS";
ammo = "Missile_AGM_02_F";
count = 6;
maxLeadSpeed = 450;
nameSound = "missiles";
};
class 2Rnd_Missile_AGM_02_F: VehicleMagazine {
scope = 2;
displayNameShort = "$STR_A3_CFGMAGAZINES_38RND_80MM_ROCKETS_DNS";
ammo = "Missile_AGM_02_F";
count = 2;
maxLeadSpeed = 450;
nameSound = "missiles";
};
class 7Rnd_Rocket_04_HE_F: VehicleMagazine {
scope = 2;
displayNameShort = "$STR_A3_CFGMAGAZINES_40RND_20MM_G_BELT_DNS";
ammo = "Rocket_04_HE_F";
count = 7;
maxLeadSpeed = 200;
nameSound = "rockets";
};
class 7Rnd_Rocket_04_AP_F: 7Rnd_Rocket_04_HE_F {
displayNameShort = "$STR_A3_CFGMAGAZINES_TITAN_AP_DNS";
ammo = "Rocket_04_AP_F";
};
class 4Rnd_Bomb_04_F: VehicleMagazine {
scope = 2;
displayNameShort = "$STR_A3_CFGVEHICLES_BOMB0";
ammo = "Bomb_04_F";
count = 4;
maxLeadSpeed = 1000;
nameSound = "cannon";
};
class 500Rnd_Cannon_30mm_Plane_CAS_02_F: 1000Rnd_Gatling_30mm_Plane_CAS_01_F {
displayNameShort = "";
ammo = "Cannon_30mm_HE_Plane_CAS_02_F";
count = 500;
};
class 2Rnd_Missile_AA_03_F: 2Rnd_Missile_AA_04_F {
displayNameShort = "$STR_A3_CFGMAGAZINES_4RND_AAA_MISSILES_DNS";
ammo = "Missile_AA_03_F";
count = 2;
};
class 4Rnd_Missile_AGM_01_F: 6Rnd_Missile_AGM_02_F {
displayNameShort = "$STR_A3_CFGMAGAZINES_38RND_80MM_ROCKETS_DNS";
ammo = "Missile_AGM_01_F";
count = 4;
};
class 20Rnd_Rocket_03_HE_F: 7Rnd_Rocket_04_HE_F {
displayNameShort = "$STR_A3_CFGMAGAZINES_40RND_20MM_G_BELT_DNS";
ammo = "Rocket_03_HE_F";
count = 20;
};
class 20Rnd_Rocket_03_AP_F: 7Rnd_Rocket_04_AP_F {
displayNameShort = "$STR_A3_CFGMAGAZINES_TITAN_AP_DNS";
ammo = "Rocket_03_AP_F";
count = 20;
};
class 2Rnd_Bomb_03_F: 4Rnd_Bomb_04_F {
displayNameShort = "$STR_A3_CFGVEHICLES_BOMB0";
ammo = "Bomb_03_F";
count = 2;
};
// an extended magazine for the comanche
class 300Rnd_20mm_shells;
class ACE_500Rnd_20mm_shells_Comanche: 300Rnd_20mm_shells {
displayName = "20mm";
displayNameShort = "20mm";
ammo = "B_20mm";
count = 500;
deflecting = 3;
initSpeed = 1030;
maxLeadSpeed = 300;
tracersEvery = 5;
};
};

View File

@ -8,12 +8,9 @@ class CfgVehicles {
class NewTurret {
class Turrets;
};
class CargoTurret;
};
class Air: AllVehicles {
class AnimationSources;
};
class Air: AllVehicles {};
class Helicopter: Air {
class Turrets {
@ -33,6 +30,7 @@ class CfgVehicles {
class Turrets: Turrets {
class CopilotTurret;
};
class AnimationSources;
};
class Helicopter_Base_H: Helicopter_Base_F {
@ -46,7 +44,7 @@ class CfgVehicles {
lockDetectionSystem = 0;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
//class MFD {};
class Turrets: Turrets {
class CopilotTurret: CopilotTurret {
canEject = 1;
@ -55,14 +53,11 @@ class CfgVehicles {
};
};
class B_Heli_Light_01_F: Heli_Light_01_base_F {
class Heli_Light_01_unarmed_base_F: Heli_Light_01_base_F {};
class B_Heli_Light_01_F: Heli_Light_01_unarmed_base_F {
/*class Turrets: Turrets {
class CopilotTurret: CopilotTurret {};
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
class CargoTurret_03: CargoTurret_02 {};
class CargoTurret_04: CargoTurret_01 {};
};*/
};
@ -70,7 +65,7 @@ class CfgVehicles {
lockDetectionSystem = 0;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
//class MFD {};
class Turrets: Turrets {
class CopilotTurret: CopilotTurret {
canEject = 1;
@ -84,7 +79,8 @@ class CfgVehicles {
driverCanEject = 1;
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
magazines[] = {"2000Rnd_762x51_Belt_T_Green", "12Rnd_PG_missiles", "168Rnd_CMFlare_Chaff_Magazine"};
magazines[] = {"2000Rnd_762x51_Belt_T_Green","12Rnd_PG_missiles","168Rnd_CMFlare_Chaff_Magazine"};
class Turrets: Turrets {
class CopilotTurret: CopilotTurret {
canEject = 1;
@ -103,36 +99,7 @@ class CfgVehicles {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
//class MFD {};
class AnimationSources: AnimationSources {
class HitGlass1 {
source = "Hit";
hitpoint = "HitGlass1";
raw = 1;
};
class HitGlass2: HitGlass1 {
hitpoint = "HitGlass2";
};
class HitGlass3: HitGlass1 {
hitpoint = "HitGlass3";
};
class HitGlass4: HitGlass1 {
hitpoint = "HitGlass4";
};
class Gatling {
source = "revolving";
weapon = "ACE_gatling_20mm_Comanche";
};
class Hide {
source = "user";
animPeriod = 0;
initPhase = 0;
};
class Muzzle_flash {
source = "ammorandom";
weapon = "ACE_gatling_20mm_Comanche";
};
};
class Turrets: Turrets {
class MainTurret: MainTurret {
canEject = 1;
@ -141,6 +108,15 @@ class CfgVehicles {
magazines[] = {"ACE_500Rnd_20mm_shells_Comanche","4Rnd_AAA_missiles","24Rnd_PG_missiles"};
};
};
class AnimationSources: AnimationSources {
class Gatling {
weapon = "ACE_gatling_20mm_Comanche";
};
class Muzzle_flash {
weapon = "ACE_gatling_20mm_Comanche";
};
};
};
class B_Heli_Attack_01_F: Heli_Attack_01_base_F {};
@ -149,6 +125,7 @@ class CfgVehicles {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
class Turrets: Turrets {
class MainTurret: MainTurret {
canEject = 1;
@ -160,6 +137,7 @@ class CfgVehicles {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
class Turrets: Turrets {
class CopilotTurret: CopilotTurret {
canEject = 1;
@ -174,6 +152,7 @@ class CfgVehicles {
canEject = 1;
};
};
/*class UserActions {
class DoorL1_Open {
available = 1;
@ -195,16 +174,14 @@ class CfgVehicles {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
//class MFD {};
class Turrets: Turrets {
class CopilotTurret: CopilotTurret {
canEject = 1;
showHMD = 1;
};
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};
/*class UserActions: UserActions {
class DoorL1_Open {
available = 1;
@ -246,9 +223,9 @@ class CfgVehicles {
lockDetectionSystem = 0;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
//class MFD {};
weapons[] = {"M134_minigun","missiles_DAR","CMFlareLauncher"};
magazines[] = {"5000Rnd_762x51_Yellow_Belt","24Rnd_missiles","168Rnd_CMFlare_Chaff_Magazine"};
class Turrets: Turrets {
class MainTurret: MainTurret {
canEject = 1;
@ -268,36 +245,37 @@ class CfgVehicles {
class I_Heli_light_03_F: I_Heli_light_03_base_F {
class Turrets: Turrets {
class MainTurret: MainTurret {};
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};
};
class I_Heli_light_03_unarmed_base_F: I_Heli_light_03_base_F {
//class MFD {};
};
class I_Heli_light_03_unarmed_base_F: I_Heli_light_03_base_F {};
class I_Heli_light_03_unarmed_F: I_Heli_light_03_unarmed_base_F {};
class Plane_CAS_01_base_F: Plane_Base_F {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
//class MFD {};
class Turrets;
#include <flightmodel_thunderbolt.hpp>
};
class Plane_CAS_02_base_F: Plane_Base_F {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
class Turrets;
#include <flightmodel_yak.hpp>
};
class Plane_Fighter_03_base_F: Plane_Base_F {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
class Turrets;
#include <flightmodel_alca.hpp>
};
@ -308,34 +286,34 @@ class CfgVehicles {
};
class UAV_02_base_F: UAV {
weapons[] = {};
magazines[] = {};
class Turrets {
class MainTurret;
};
weapons[] = {};
magazines[] = {};
};
class UAV_02_CAS_base_F: UAV_02_base_F {
weapons[] = {};
magazines[] = {};
/*class Turrets: Turrets {
class MainTurret: MainTurret {};
};*/
weapons[] = {};
magazines[] = {};
};
class B_Heli_Transport_03_base_F: Helicopter_Base_H {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
class Turrets: Turrets {
class CopilotTurret: CopilotTurret {
canEject = 1;
};
//class MainTurret: MainTurret {};
class RightDoorGun: MainTurret {};
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};
};
@ -346,9 +324,6 @@ class CfgVehicles {
};
//class MainTurret: MainTurret {};
//class RightDoorGun: MainTurret {};
//class CargoTurret_01: CargoTurret {};
//class CargoTurret_02: CargoTurret_01 {};
};
};
@ -356,6 +331,7 @@ class CfgVehicles {
lockDetectionSystem = 12;
incomingMissileDetectionSystem = 16;
driverCanEject = 1;
class Turrets: Turrets {
class CopilotTurret: CopilotTurret {
canEject = 1;
@ -374,15 +350,6 @@ class CfgVehicles {
class LoadmasterTurret: LoadmasterTurret {
canEject = 1;
};
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
class CargoTurret_03: CargoTurret_01 {};
class CargoTurret_04: CargoTurret_01 {};
class CargoTurret_05: CargoTurret_01 {};
class CargoTurret_06: CargoTurret_05 {};
class CargoTurret_07: CargoTurret_05 {};
class CargoTurret_08: CargoTurret_05 {};
};
};
@ -394,9 +361,6 @@ class CfgVehicles {
class LoadmasterTurret: LoadmasterTurret {
canEject = 1;
};
class CargoTurret_01: CargoTurret {};
class CargoTurret_02: CargoTurret_01 {};
};
};
};

View File

@ -4,15 +4,10 @@ class Mode_Burst;
class Mode_FullAuto;
class CfgWeapons {
class MGunCore;
class MGun: MGunCore {};
class LMG_RCWS: MGun {};
// Manual Switching Of Flare Mode
class SmokeLauncher;
class CMFlareLauncher: SmokeLauncher {
modes[] = {"Single", "Burst", "AIBurst"};
modes[] = {"Single","Burst","AIBurst"};
class Single: Mode_SemiAuto {
reloadTime = 0.1;
};
@ -21,13 +16,15 @@ class CfgWeapons {
};
};
// bigger mag for comanche
class CannonCore;
class gatling_20mm: CannonCore {
magazines[] = {"2000Rnd_20mm_shells","1000Rnd_20mm_shells","300Rnd_20mm_shells","ACE_500Rnd_20mm_shells_Comanche"};
magazines[] += {"ACE_500Rnd_20mm_shells_Comanche"};
// buff gatling rof
class manual: CannonCore {
reloadTime = 0.023;
dispersion = 0.006;
reloadTime = 0.023; //0.04;
dispersion = 0.006; //0.0022;
};
class close: manual {};
class short: close {};
@ -36,21 +33,14 @@ class CfgWeapons {
};
class ACE_gatling_20mm_Comanche: gatling_20mm {
displayName = "XM301";
class close: close {
reloadTime = 0.04;
dispersion = 0.0022;
};
class far: far {
reloadTime = 0.04;
dispersion = 0.0022;
};
displayName = "$STR_ACE_Aircraft_gatling_20mm_Name";
class manual: manual {
reloadTime = 0.04;
dispersion = 0.0022;
displayName = "XM301";
displayName = "$STR_ACE_Aircraft_gatling_20mm_Name";
};
class medium: medium {
class close: close {
reloadTime = 0.04;
dispersion = 0.0022;
};
@ -58,38 +48,53 @@ class CfgWeapons {
reloadTime = 0.04;
dispersion = 0.0022;
};
class medium: medium {
reloadTime = 0.04;
dispersion = 0.0022;
};
class far: far {
reloadTime = 0.04;
dispersion = 0.0022;
};
};
// buff gatling rof
class MGunCore;
class MGun: MGunCore {};
class LMG_RCWS: MGun {};
class LMG_Minigun: LMG_RCWS {
magazines[] = {"1000Rnd_65x39_Belt","1000Rnd_65x39_Belt_Green","1000Rnd_65x39_Belt_Tracer_Green","1000Rnd_65x39_Belt_Tracer_Red","1000Rnd_65x39_Belt_Tracer_Yellow","1000Rnd_65x39_Belt_Yellow","2000Rnd_65x39_Belt","2000Rnd_65x39_Belt_Green","2000Rnd_65x39_Belt_Tracer_Green","2000Rnd_65x39_Belt_Tracer_Green_Splash","2000Rnd_65x39_Belt_Tracer_Red","2000Rnd_65x39_Belt_Tracer_Yellow","2000Rnd_65x39_Belt_Tracer_Yellow_Splash","2000Rnd_65x39_Belt_Yellow","2000Rnd_762x51_Belt_T_Green","2000Rnd_762x51_Belt_T_Red","2000Rnd_762x51_Belt_T_Yellow","200Rnd_65x39_Belt","200Rnd_65x39_Belt_Tracer_Green","200Rnd_65x39_Belt_Tracer_Red","200Rnd_65x39_Belt_Tracer_Yellow","5000Rnd_762x51_Belt","5000Rnd_762x51_Yellow_Belt"};
class manual: MGun {
reloadTime = 0.015;
dispersion = 0.006;
reloadTime = 0.075; //0.015;
dispersion = 0.00093; //0.006;
};
class close: manual {};
class short: close {};
class medium: close {};
class far: close {};
};
class LMG_Minigun_heli: LMG_Minigun {
showAimCursorInternal = 0;
class manual: manual {
reloadTime = 0.015;
dispersion = 0.006;
reloadTime = 0.015; //0.033; Note: This is a way to fast ROF (requires over 60 FPS) @todo
dispersion = 0.006; //0.0087;
};
class close: manual {};
class short: close {};
class medium: close {};
class far: close {};
};
class M134_minigun: MGunCore {
class LowROF: Mode_FullAuto {
reloadTime = 0.015;
dispersion = 0.006;
reloadTime = 0.015; //0.03; same as above @todo
dispersion = 0.006; //0.0023;
};
class HighROF: LowROF {
reloadTime = 0.015;
dispersion = 0.006;
reloadTime = 0.015; //0.03;
dispersion = 0.006; //0.0023;
};
class close: HighROF {};
class short: close {};
@ -100,19 +105,10 @@ class CfgWeapons {
class Gatling_30mm_Plane_CAS_01_F: CannonCore {
autoFire = 1;
burst = 1;
reloadTime = 0.0154;
class LowROF: Mode_FullAuto {
autoFire = 0;
//burst = 65;
burst = 22;
//reloadTime = 0.0154;
reloadTime = 0.0462;
//sound[] = {"A3\Sounds_F_epc\weapons\cas_02_cannon",1.77828,1,3800};
sound[] = {"A3\Sounds_F_EPC\Weapons\gau_03_burst",2.51189,1,4500,{25704,32159}};
weaponSoundEffect = "DefaultRifle";
dispersion = 0.005;
soundContinuous = 1;
textureType = "burst";
burst = 22; //65;
reloadTime = 0.0462; //0.0154; //0.034;
multiplier = 3;
};
class close: LowROF {};
@ -121,120 +117,4 @@ class CfgWeapons {
class medium: close {};
class far: close {};
};
class RocketPods;
class Missile_AA_04_Plane_CAS_01_F: RocketPods {
holdsterAnimValue = 2;
aiRateOfFire = 5;
aiRateOfFireDistance = 500;
autoFire = 0;
cursor = "EmptyCursor";
cursorAim = "missile";
nameSound = "MissileLauncher";
textureType = "fullAuto";
weaponLockDelay = 3;
minRange = 300;
minRangeProbab = 0.25;
midRange = 2500;
midRangeProbab = 0.9;
maxRange = 9000;
maxRangeProbab = 0.01;
};
class MissileLauncher;
class Missile_AGM_02_Plane_CAS_01_F: MissileLauncher {
holdsterAnimValue = 3;
magazineReloadTime = 30;
reloadTime = 0.001;
textureType = "semi";
weaponLockDelay = 3;
weaponSoundEffect = "DefaultRifle";
};
class Rocket_04_HE_Plane_CAS_01_F: RocketPods {
holdsterAnimValue = 4;
canLock = 1;
modes[] = {"Far_AI","Medium_AI","Close_AI","Burst"};
weaponLockDelay = 0;
class Far_AI: RocketPods {
canLock = 1;
weaponLockDelay = 0;
showToPlayer = 0;
minRange = 800;
minRangeProbab = 0.31;
midRange = 2500;
midRangeProbab = 0.71;
maxRange = 3200;
maxRangeProbab = 0.1;
burst = 1;
reloadTime = 0.001;
autoFire = 0;
aiRateOfFire = 5;
aiRateOfFireDistance = 500;
};
class Medium_AI: Far_AI {};
class Close_AI: Far_AI {};
class Burst: RocketPods {
burst = 1;
reloadTime = 0.002;
minRange = 300;
minRangeProbab = 0.25;
midRange = 400;
midRangeProbab = 0.7;
maxRange = 1300;
maxRangeProbab = 0.1;
aiRateOfFire = 5;
aiRateOfFireDistance = 500;
autoFire = 0;
soundContinuous = 0;
textureType = "fullAuto";
weaponSoundEffect = "DefaultRifle";
};
};
class Rocket_04_AP_Plane_CAS_01_F: Rocket_04_HE_Plane_CAS_01_F {
holdsterAnimValue = 5;
};
class Bomb_04_Plane_CAS_01_F: RocketPods {
holdsterAnimValue = 6;
aiRateOfFire = 5;
aiRateOfFireDistance = 500;
missileLockCone = 180;
nameSound = "";
textureType = "fullAuto";
weaponLockDelay = 1;
};
class Cannon_30mm_Plane_CAS_02_F: CannonCore {
scope = 1;
holdsterAnimValue = 1;
ballisticsComputer = 2;
canLock = 1;
modes[] = {"LowROF","close","near","short","medium","far"};
nameSound = "cannon";
shotFromTurret = 0;
muzzlePos = "Cannon_muzzleflash";
muzzleEnd = "Cannon_barrel_end";
selectionFireAnim = "Cannon_muzzleflash";
autoFire = 1;
burst = 5;
reloadTime = 0.04;
class GunParticles {
class Effect {
effectName = "MachineGun2";
positionName = "Cannon_barrel_start";
directionName = "Cannon_barrel_end";
};
};
class LowROF: Mode_FullAuto {
dispersion = 0.0055;
reloadTime = 0.04;
};
class close: LowROF {};
class near: close {};
class short: close {};
class medium: close {};
class far: close {};
};
};

View File

@ -6,7 +6,7 @@ class CfgPatches {
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"KoffeinFlummi","Crusty"};
author[] = {"KoffeinFlummi","Crusty","commy2"};
authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG;
};

View File

@ -14,6 +14,18 @@
<Portuguese>Rajada</Portuguese>
<Italian>Raffica</Italian>
</Key>
<Key ID="STR_ACE_Aircraft_gatling_20mm_Name">
<English>XM301</English>
<German>XM301</German>
<Spanish>XM301</Spanish>
<Polish>XM301</Polish>
<Czech>XM301</Czech>
<French>XM301</French>
<Russian>XM301</Russian>
<Hungarian>XM301</Hungarian>
<Portuguese>XM301</Portuguese>
<Italian>XM301</Italian>
</Key>
<Key ID="STR_ACE_Aircraft_OpenCargoRamp">
<English>Open Cargo Door</English>
<German>Laderampe öffnen</German>
@ -35,4 +47,4 @@
<Russian>Закрыть грузовой отсек</Russian>
</Key>
</Package>
</Project>
</Project>

View File

@ -1,5 +1,6 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
};

View File

@ -1,10 +1,12 @@
class CfgMagazines {
class CA_Magazine;
class B_IR_Grenade: CA_Magazine {
ACE_Attachable = 1;
};
class SmokeShell;
class Chemlight_green: SmokeShell {
ACE_Attachable = 1;
};
};
};

View File

@ -1,29 +1,30 @@
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
name = #ITEM; \
count = COUNT; \
};
#define MACRO_ATTACHTOVEHICLE \
class ACE_Actions { \
class GVAR(AttachVehicle) { \
displayName = "$STR_ACE_Attach_AttachDetach"; \
condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \
exceptions[] = {"ACE_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 0; \
icon = PATHTOF(UI\attach_ca.paa); \
distance = 4; \
}; \
class GVAR(DetachVehicle) { \
displayName = "$STR_ACE_Attach_Detach"; \
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \
exceptions[] = {"ACE_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 0; \
icon = PATHTOF(UI\detach_ca.paa); \
distance = 4; \
class ACE_MainActions { \
selection = ""; \
distance = 5; \
condition = "true"; \
class GVAR(AttachVehicle) { \
displayName = "$STR_ACE_Attach_AttachDetach"; \
condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \
exceptions[] = {"ACE_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 0; \
icon = PATHTOF(UI\attach_ca.paa); \
distance = 4; \
}; \
class GVAR(DetachVehicle) { \
displayName = "$STR_ACE_Attach_Detach"; \
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \
exceptions[] = {"ACE_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 0; \
icon = PATHTOF(UI\detach_ca.paa); \
distance = 4; \
}; \
}; \
};
@ -32,16 +33,20 @@ class CfgVehicles {
class Car: LandVehicle {
MACRO_ATTACHTOVEHICLE
};
class Tank: LandVehicle {
MACRO_ATTACHTOVEHICLE
};
class Air;
class Helicopter: Air {
MACRO_ATTACHTOVEHICLE
};
class Plane: Air {
MACRO_ATTACHTOVEHICLE
};
class Ship;
class Ship_F: Ship {
MACRO_ATTACHTOVEHICLE
@ -83,19 +88,22 @@ class CfgVehicles {
simulation = "nvmarker";
class NVGMarker {
diffuse[] = {0,0,0};
ambient[] = {0,0,0};
brightness = 0.004;
diffuse[] = {0.006, 0.006, 0.006, 1};
ambient[] = {0.005, 0.005, 0.005, 1};
brightness = 0.2;
name = "pozicni blik";
drawLight = 1;
drawLightSize = 0.005;
drawLightSize = 0.2;
drawLightCenterSize = 0.003;
activeLight = 0;
blinking=1;
blinkingStartsOn=1;
blinkingPattern[] = {2,2};
blinkingPatternGuarantee = false;
dayLight = 0;
onlyInNvg = 1;
useFlare = 0;
};
side = 7;//-1=NO_SIDE yellow box,3=CIV grey box,4=NEUTRAL yellow box,6=FRIENDLY green box,7=LOGIC no radar signature
accuracy = 1000;
cost = 0;
@ -111,37 +119,36 @@ class CfgVehicles {
};
class NATO_Box_Base;
class EAST_Box_Base;
class IND_Box_Base;
class FIA_Box_Base_F;
class Box_NATO_Support_F: NATO_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
MACRO_ADDITEM(ACE_IR_Strobe_Item,12);
};
};
class EAST_Box_Base;
class Box_East_Support_F: EAST_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
MACRO_ADDITEM(ACE_IR_Strobe_Item,12);
};
};
class IND_Box_Base;
class Box_IND_Support_F: IND_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
MACRO_ADDITEM(ACE_IR_Strobe_Item,12);
};
};
class FIA_Box_Base_F;
class Box_FIA_Support_F: FIA_Box_Base_F {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
MACRO_ADDITEM(ACE_IR_Strobe_Item,12);
};
};
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
MACRO_ADDITEM(ACE_IR_Strobe_Item,12);
};
};
};
};

View File

@ -1,16 +1,19 @@
class CfgWeapons {
class ACE_ItemCore;
class InventoryItem_Base_F;
class ACE_IR_Strobe_Item: ACE_ItemCore {
ACE_attachable = 1;
author = "$STR_ACE_Common_ACETeam";
scope = 2;
displayName = "$STR_ACE_IrStrobe_Name";
descriptionShort = "$STR_ACE_IrStrobe_Description";
model = "\A3\weapons_F\ammo\mag_univ.p3d";
picture = PATHTOF(UI\irstrobe_item.paa);
scope = 2;
ACE_attachable = 1;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
};
};
};
};

View File

@ -5,17 +5,14 @@ class CfgPatches {
units[] = {};
weapons[] = {"ACE_IR_Strobe_Item"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common", "ace_interaction"};
author[] = {"KoffeinFlummi", "eRazeri", "CAA-Picard"};
requiredAddons[] = {"ace_interaction"};
author[] = {"KoffeinFlummi","eRazeri","CAA-Picard"};
authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "CfgMagazines.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"

View File

@ -20,31 +20,33 @@
PARAMS_3(_unit,_attachToVehicle,_itemName);
//Sanity Check (_unit has item in inventory, not over attach limit)
if (!([_unit,_attachToVehicle,_itemName] call FUNC(canAttach))) exitWith {ERROR("Tried to attach, but check failed");};
if !([_unit, _attachToVehicle, _itemName] call FUNC(canAttach)) exitWith {ERROR("Tried to attach, but check failed");};
private ["_itemVehClass", "_onAtachText", "_selfAttachPosition"];
_selfAttachPosition = [_unit, [-0.05,0,0.12], "rightshoulder"];
_itemVehClass = "";
_onAtachText = "";
_selfAttachPosition = [_unit, [-0.05, 0, 0.12], "rightshoulder"];
switch true do {
case (_itemName == "ACE_IR_Strobe_Item"): {
switch (true) do {
case (_itemName == "ACE_IR_Strobe_Item"): {
_itemVehClass = "ACE_IR_Strobe_Effect";
_onAtachText = localize "STR_ACE_Attach_IrStrobe_Attached";
_selfAttachPosition = [_unit,[0,-0.11,0.16],"pilot"]; //makes it attach to the head a bit better, shoulder is not good for visibility - eRazeri
//_selfAttachPosition = [_unit, [0, -0.11, 0.16], "pilot"]; //makes it attach to the head a bit better, shoulder is not good for visibility - eRazeri
};
case (_itemName == "B_IR_Grenade"): {
case (_itemName == "B_IR_Grenade"): {
_itemVehClass = "B_IRStrobe";
_onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached";
};
case (_itemName == "O_IR_Grenade"): {
case (_itemName == "O_IR_Grenade"): {
_itemVehClass = "O_IRStrobe";
_onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached";
};
case (_itemName == "I_IR_Grenade"): {
case (_itemName == "I_IR_Grenade"): {
_itemVehClass = "I_IRStrobe";
_onAtachText = localize "STR_ACE_Attach_IrGrenade_Attached";
};
case (_itemName == "Chemlight_blue" or {_itemName == "Chemlight_green"} or {_itemName == "Chemlight_red"} or {_itemName == "Chemlight_yellow"}): {
case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]): {
_itemVehClass = _itemName;
_onAtachText = localize "STR_ACE_Attach_Chemlight_Attached";
};
@ -57,8 +59,8 @@ if (_unit == _attachToVehicle) then { //Self Attachment
_attachedItem = _itemVehClass createVehicle [0,0,0];
_attachedItem attachTo _selfAttachPosition;
[_onAtachText] call EFUNC(common,displayTextStructured);
_attachToVehicle setVariable ["ACE_AttachedObjects", [_attachedItem], true];
_attachToVehicle setVariable ["ACE_AttachedItemNames", [_itemName], true];
_attachToVehicle setVariable [QGVAR(Objects), [_attachedItem], true];
_attachToVehicle setVariable [QGVAR(ItemNames), [_itemName], true];
} else {
GVAR(setupObject) = _itemVehClass createVehicleLocal [0,0,-10000];
GVAR(setupObject) enableSimulationGlobal false;
@ -72,17 +74,17 @@ if (_unit == _attachToVehicle) then { //Self Attachment
private "_player";
_player = ACE_player;
//Stop if player switch or player gets to far from vehicle
if ((GVAR(placer) != _player) || {(_player distance GVAR(SetupAttachVehicle)) > 7}) exitWith {
if (GVAR(placer) != _player || {_player distance GVAR(SetupAttachVehicle) > 7}) exitWith {
call FUNC(placeCancel);
};
GVAR(pfeh_running) = true;
_pos = (ASLtoATL eyePos _player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]);
GVAR(setupObject) setPosATL _pos;
}] call BIS_fnc_addStackedEventHandler;
}] call BIS_fnc_addStackedEventHandler; // @todo replace with CBA PFH
//had to delay the mouseHint, not sure why
[{[localize "STR_ACE_Attach_PlaceAction", localize "STR_ACE_Attach_CancelAction"] call EFUNC(interaction,showMouseHint)}, [], 0, 0] call EFUNC(common,waitAndExecute);
_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {GVAR(pfeh_running) AND !isNull (GVAR(setupObject))}, {call FUNC(placeApprove);}] call EFUNC(common,AddActionEventHandler)];
_unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {GVAR(pfeh_running) AND !isNull (GVAR(setupObject))}, {call FUNC(placeCancel);}] call EFUNC(common,AddActionEventHandler)];
_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {GVAR(pfeh_running) && {!isNull (GVAR(setupObject))}}, {call FUNC(placeApprove);}] call EFUNC(common,AddActionEventHandler)];
_unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {GVAR(pfeh_running) && {!isNull (GVAR(setupObject))}}, {call FUNC(placeCancel);}] call EFUNC(common,AddActionEventHandler)];
};

View File

@ -19,7 +19,9 @@
PARAMS_3(_unit,_attachToVehicle,_item);
_attachLimit = if (_unit == _attachToVehicle) then {1} else {10};
_attachedObjects = _attachToVehicle getVariable ["ACE_AttachedObjects", []];
private ["_attachLimit", "_attachedObjects"];
canStand _unit && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_item in ((magazines _unit) + (items _unit) + [""])}
_attachLimit = [10, 1] select (_unit == _attachToVehicle);
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
canStand _unit && {alive _attachToVehicle} && {count _attachedObjects < _attachLimit} && {_item in (itemsWithMagazines _unit + [""])}

View File

@ -16,24 +16,25 @@
*/
#include "script_component.hpp"
private ["_attachedObjects", "_inRange", "_unitPos", "_objectPos"];
PARAMS_2(_unit,_attachToVehicle);
_attachedObjects = _attachToVehicle getVariable ["ACE_AttachedObjects", []];
private ["_attachedObjects", "_inRange"];
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
_inRange = false;
if (_unit == _attachToVehicle) then {
_inRange = (count _attachedObjects) > 0;
_inRange = count _attachedObjects > 0;
} else {
//Scan if unit is within range (using 2d distance)
private ["_unitPos", "_objectPos"];
_unitPos = getPos _unit;
_unitPos set [2,0];
{
_objectPos = getPos _x;
_objectPos set [2, 0];
if ((_objectPos distance _unitPos) < 4) exitWith {_inRange = true};
if (_objectPos distance _unitPos < 4) exitWith {_inRange = true};
} forEach _attachedObjects;
};
(canStand _unit) && _inRange && {alive _attachToVehicle}
canStand _unit && {_inRange} && {alive _attachToVehicle}

View File

@ -16,12 +16,14 @@
*/
#include "script_component.hpp"
private ["_itemName", "_count", "_attachedItem", "_fnc_detachDelay"];
PARAMS_2(_unit,_attachToVehicle);
_attachedObjectsArray = _attachToVehicle getVariable ["ACE_AttachedObjects", []];
_attachedItemsArray = _attachToVehicle getVariable ["ACE_AttachedItemNames", []];
private ["_attachedObjects", "_attachedItems"];
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
_attachedItems = _attachToVehicle getVariable [QGVAR(ItemNames), []];
private ["_attachedObject", "_attachedIndex", "_itemName", "_minDistance", "_unitPos", "_objectPos"];
_attachedObject = objNull;
_attachedIndex = -1;
@ -34,53 +36,51 @@ _unitPos set [2,0];
{
_objectPos = getPos _x;
_objectPos set [2, 0];
if ((_objectPos distance _unitPos) < _minDistance) then {
_minDistance = (_objectPos distance _unitPos);
if (_objectPos distance _unitPos < _minDistance) then {
_minDistance = _objectPos distance _unitPos;
_attachedObject = _x;
_itemName = _attachedItemsArray select _forEachIndex;
_itemName = _attachedItems select _forEachIndex;
_attachedIndex = _forEachIndex;
};
} forEach _attachedObjectsArray;
} forEach _attachedObjects;
// Check if unit has an attached item
if ((isNull _attachedObject) || {_itemName == ""}) exitWith {ERROR("Could not find attached object")};
if (isNull _attachedObject || {_itemName == ""}) exitWith {ERROR("Could not find attached object")};
// Add item to inventory
_count = (count items _unit) + (count magazines _unit);
_unit addItem _itemName;
if ((count items _unit) + (count magazines _unit) <= _count) exitWith {
// Exit if can't add the item
if !(_unit canAdd _itemName) exitWith {
[localize "STR_ACE_Attach_Inventory_Full"] call EFUNC(common,displayTextStructured);
};
if (_itemName == "B_IR_Grenade" or _itemName == "O_IR_Grenade" or _itemName == "I_IR_Grenade") then {
// Add item to inventory
_unit addItem _itemName;
if (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) then {
// Hack for dealing with X_IR_Grenade effect not dissapearing on deleteVehicle
detach _attachedObject;
_attachedObject setPos [getPos _unit select 0, getPos _unit select 1, ((getPos _unit select 2) - 1000)];
_attachedObject setPos ((getPos _unit) vectorAdd [0, 0, -1000]);
// Delete attached item after 0.5 seconds
_fnc_detachDelay = {
deleteVehicle (_this select 0);
};
[_fnc_detachDelay, [_attachedObject], 0.5, 0] call EFUNC(common,waitAndExecute);
[{deleteVehicle (_this select 0)}, [_attachedObject], 0.5, 0] call EFUNC(common,waitAndExecute);
} else {
// Delete attached item
deleteVehicle _attachedObject;
};
// Reset unit variables
_attachedObjectsArray deleteAt _attachedIndex;
_attachedItemsArray deleteAt _attachedIndex;
_attachToVehicle setVariable ["ACE_AttachedObjects", _attachedObjectsArray, true];
_attachToVehicle setVariable ["ACE_AttachedItemNames", _attachedItemsArray, true];
_attachedObjects deleteAt _attachedIndex;
_attachedItems deleteAt _attachedIndex;
_attachToVehicle setVariable [QGVAR(Objects), _attachedObjects, true];
_attachToVehicle setVariable [QGVAR(ItemNames), _attachedItems, true];
// Display message
switch true do {
case (_itemName == "ACE_IR_Strobe_Item") : {
switch (true) do {
case (_itemName == "ACE_IR_Strobe_Item") : {
[localize "STR_ACE_Attach_IrStrobe_Detached"] call EFUNC(common,displayTextStructured);
};
case (_itemName == "B_IR_Grenade" or _itemName == "O_IR_Grenade" or _itemName == "I_IR_Grenade") : {
case (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) : {
[localize "STR_ACE_Attach_IrGrenade_Detached"] call EFUNC(common,displayTextStructured);
};
case (_itemName == "Chemlight_blue" or {_itemName == "Chemlight_green"} or {_itemName == "Chemlight_red"} or {_itemName == "Chemlight_yellow"}) : {
case (toLower _itemName in ["chemlight_blue", "chemlight_green", "chemlight_red", "chemlight_yellow"]) : {
[localize "STR_ACE_Attach_Chemlight_Detached"] call EFUNC(common,displayTextStructured);
};
};

View File

@ -55,13 +55,13 @@ _attachables = items _unit;
} forEach _attachables;
[
_actions,
{
[ACE_player, GVAR(attachTarget), _this] call FUNC(attach);
call EFUNC(interaction,hideMenu);
},
{
call EFUNC(interaction,hideMenu);
if !(profileNamespace getVariable [QEGVAR(interaction,AutoCloseMenu), false]) then {"Default" call EFUNC(interaction,openMenuSelf)};
}
_actions,
{
[ACE_player, GVAR(attachTarget), _this] call FUNC(attach);
call EFUNC(interaction,hideMenu);
},
{
call EFUNC(interaction,hideMenu);
if !(profileNamespace getVariable [QEGVAR(interaction,AutoCloseMenu), false]) then {"Default" call EFUNC(interaction,openMenuSelf)};
}
] call EFUNC(interaction,openSelectMenu);

View File

@ -100,11 +100,11 @@ _attachedObject attachTo [_attachToVehicle, _endPosTestOffset];
_placer removeItem _itemClassname;
//Add Object to ACE_AttachedObjects and ACE_AttachedItemNames
_currentObjects = _attachToVehicle getVariable ["ACE_AttachedObjects", []];
_currentObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
_currentObjects pushBack _attachedObject;
_attachToVehicle setVariable ["ACE_AttachedObjects", _currentObjects, true];
_currentItemNames = _attachToVehicle getVariable ["ACE_AttachedItemNames", []];
_attachToVehicle setVariable [QGVAR(Objects), _currentObjects, true];
_currentItemNames = _attachToVehicle getVariable [QGVAR(ItemNames), []];
_currentItemNames pushBack _itemClassname;
_attachToVehicle setVariable ["ACE_AttachedItemNames", _currentItemNames, true];
_attachToVehicle setVariable [QGVAR(ItemNames), _currentItemNames, true];
[_placementText] call EFUNC(common,displayTextStructured);

View File

@ -176,4 +176,4 @@
<Spanish>Error en Acoplar</Spanish>
</Key>
</Package>
</Project>
</Project>

View File

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

View File

@ -1,17 +0,0 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit) );
};
};
class Extended_FiredNear_EventHandlers {
class CAManBase {
class GVAR(LauncherBackblast) {
FiredNear = QUOTE( if (local (_this select 0) && {getNumber (configfile >> 'CfgWeapons' >> _this select 3 >> 'ACE_Backblast_Damage') > 0}) then {_this call FUNC(launcherBackblast)} );
};
class GVAR(TankDangerZone) {
FiredNear = QUOTE( if (local (_this select 0) && {getNumber (configfile >> 'CfgWeapons' >> _this select 3 >> 'ACE_DangerZone_Damage') > 0}) then {_this call FUNC(tankDangerZone)} );
};
};
};

View File

@ -1,44 +0,0 @@
class CfgWeapons {
class LauncherCore;
class Launcher: LauncherCore {
ACE_Backblast_Angle = 60;
ACE_Backblast_Range = 10;
ACE_Backblast_Damage = 0.7;
};
class Launcher_Base_F: Launcher {};
class launch_Titan_base: Launcher_Base_F {
ACE_Backblast_Angle = 40;
ACE_Backblast_Range = 8;
ACE_Backblast_Damage = 0.5;
};
class launch_Titan_short_base: launch_Titan_base {
ACE_Backblast_Angle = 40;
ACE_Backblast_Range = 8;
ACE_Backblast_Damage = 0.5;
};
class launch_NLAW_F: Launcher_Base_F {
ACE_Backblast_Angle = 40;
ACE_Backblast_Range = 5;
ACE_Backblast_Damage = 0.6;
};
class launch_RPG32_F: Launcher_Base_F {
ACE_Backblast_Angle = 60;
ACE_Backblast_Range = 15;
ACE_Backblast_Damage = 0.7;
};
class CannonCore;
class cannon_120mm: CannonCore {
ACE_DangerZone_Angle = 90;
ACE_DangerZone_Range = 50;
ACE_DangerZone_Damage = 0.85;
};
class mortar_155mm_AMOS: CannonCore {
ACE_DangerZone_Angle = 90;
ACE_DangerZone_Range = 60;
ACE_DangerZone_Damage = 1;
};
};

View File

@ -1,31 +0,0 @@
// by commy2
#include "script_component.hpp"
private ["_position", "_direction", "_maxDistance", "_distance", "_iteration", "_laser", "_line"];
_position = + _this select 0;
_direction = + _this select 1;
_maxDistance = _this select 2;
_distance = _maxDistance;
_iteration = _distance;
_laser = [];
_line = [_position, _laser];
while {
_iteration > 0.1
} do {
_iteration = _iteration / 2;
_laser set [0, (_position select 0) - _distance * (_direction select 0)];
_laser set [1, (_position select 1) - _distance * (_direction select 1)];
_laser set [2, (_position select 2) - _distance * (_direction select 2)];
_intersections = {
_x isKindOf "Static" || {_x isKindOf "AllVehicles"}
} count (lineIntersectsWith _line);
_distance = _distance + ([1, -1] select (_intersections > 0)) * _iteration;
};
if (_distance > _maxDistance) then {999} else {_distance}

View File

@ -1,72 +0,0 @@
// by commy2
#include "script_component.hpp"
_unit = _this select 0;
_firer = _this select 1;
_distance = _this select 2;
_weapon = _this select 3;
if (vehicle _unit != _unit || {!([_firer] call EFUNC(common,isPlayer))}) exitWith {};
_backblastAngle = getNumber (configFile >> "CfgWeapons" >> _weapon >> "ACE_Backblast_Angle") / 2;
_backblastRange = getNumber (configFile >> "CfgWeapons" >> _weapon >> "ACE_Backblast_Range");
_backblastDamage = getNumber (configFile >> "CfgWeapons" >> _weapon >> "ACE_Backblast_Damage");
_position = eyePos _firer;
_direction = _firer weaponDirection currentWeapon _firer;
if (_unit == _firer) then {
_distance = [_position, _direction, _backblastRange] call FUNC(getDistance);
hint format ["%1", _distance];
if (_distance < _backblastRange) then {
_alpha = sqrt (1 - _distance / _backblastRange);
_beta = sqrt 0.5;
_damage = 2 * _alpha * _beta * _backblastDamage;
[_damage * 100] call BIS_fnc_bloodEffect;
// TODO: Sort this interaction with medical
if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then {
[_unit, "HitBody", ([_unit, "", ((_unit getHitPointDamage "HitBody") + _damage), objNull, objNull] call EFUNC(medical,handleDamage))] call EFUNC(medical,setHitPointDamage);
} else {
_unit setDamage (damage _unit + _damage);
};
};
} else {
_direction = [0, 0, 0] vectorDiff _direction;
_azimuth = (_direction select 0) atan2 (_direction select 1);
_inclination = asin (_direction select 2);
_relativePosition = eyePos _unit;
_relativeDirection = _relativePosition vectorDiff _position;
_relativeAzimuth = (_relativeDirection select 0) atan2 (_relativeDirection select 1);
_relativeInclination = asin (_relativeDirection select 2);
_angle = sqrt ((_relativeAzimuth - _azimuth) ^ 2 + (_relativeInclination - _inclination) ^ 2);
_distance = vectorMagnitude _relativeDirection;
_line = [_position, _relativePosition];
if (_angle < _backblastAngle && {_distance < _backblastRange} && {!lineIntersects _line} && {!terrainIntersectASL _line}) then {
_alpha = sqrt (1 - _distance / _backblastRange);
_beta = sqrt (1 - _angle / _backblastAngle);
_damage = 2 * _alpha * _beta * _backblastDamage;
if (_unit == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect};
// TODO: Sort this interaction with medical
if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then {
[_unit, "HitBody", ([_unit, "", ((_unit getHitPointDamage "HitBody") + _damage), objNull, objNull] call EFUNC(medical,handleDamage))] call EFUNC(medical,setHitPointDamage);
_unit spawn {
sleep 0.5;
[_this, "", 0, objNull, objNull] call EFUNC(medical,handleDamage);
};
} else {
_unit setDamage (damage _unit + _damage);
};
};
};

View File

@ -1,54 +0,0 @@
// by commy2
#include "script_component.hpp"
#define BARREL_MUZZLE "usti hlavne"
_unit = _this select 0;
_vehicle = vehicle (_this select 1);
_distance = _this select 2;
_weapon = _this select 3;
if (vehicle _unit != _unit || {!([gunner _firer] call EFUNC(common,isPlayer))}) exitWith {};
_dangerZoneAngle = getNumber (configFile >> "CfgWeapons" >> _weapon >> "ACE_DangerZone_Angle") / 2;
_dangerZoneRange = getNumber (configFile >> "CfgWeapons" >> _weapon >> "ACE_DangerZone_Range");
_dangerZoneDamage = getNumber (configFile >> "CfgWeapons" >> _weapon >> "ACE_DangerZone_Damage");
_position = ATLToASL (_vehicle modelToWorld (_vehicle selectionPosition BARREL_MUZZLE));
_direction = _vehicle weaponDirection _weapon;
if (_unit != _vehicle) then {
_azimuth = (_direction select 0) atan2 (_direction select 1);
_inclination = asin (_direction select 2);
_relativePosition = eyePos _unit;
_relativeDirection = _relativePosition vectorDiff _position;
_relativeAzimuth = (_relativeDirection select 0) atan2 (_relativeDirection select 1);
_relativeInclination = asin (_relativeDirection select 2);
_angle = sqrt ((_relativeAzimuth - _azimuth) ^ 2 + (_relativeInclination - _inclination) ^ 2);
_distance = vectorMagnitude _relativeDirection;
_line = [_position, _relativePosition];
if (_angle < _dangerZoneAngle && {_distance < _dangerZoneRange} && {!lineIntersects (_line + [_vehicle])} && {!terrainIntersectASL _line}) then {
_alpha = sqrt (1 - _distance / _dangerZoneRange);
_beta = sqrt (1 - _angle / _dangerZoneAngle);
_damage = 2 * _alpha * _beta * _dangerZoneDamage;
if (_unit == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect};
// TODO: Sort this interaction with medical
if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then {
[_unit, "HitBody", ([_unit, "", ((_unit getHitPointDamage "HitBody") + _damage), objNull, objNull] call EFUNC(medical,handleDamage))] call EFUNC(medical,setHitPointDamage);
_unit spawn {
sleep 0.5;
[_this, "", 0, objNull, objNull] call EFUNC(medical,handleDamage);
};
} else {
_unit setDamage (damage _unit + _damage);
};
};
};

View File

@ -1 +0,0 @@
#include "\z\ace\addons\backblast\script_component.hpp"

View File

@ -1,12 +0,0 @@
#define COMPONENT backblast
#include "\z\ace\Addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_BACKBLAST
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_BACKBLAST
#define DEBUG_SETTINGS DEBUG_SETTINGS_BACKBLAST
#endif
#include "\z\ace\Addons\main\script_macros.hpp"

View File

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

View File

@ -0,0 +1,43 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
//release escorted captive when entering a vehicle
class Extended_GetIn_EventHandlers {
class All {
class GVAR(AutoDetachCaptive) {
getIn = QUOTE(_this call FUNC(handleGetIn));
};
};
};
//reset captive animation after leaving vehicle
class Extended_GetOut_EventHandlers {
class All {
class GVAR(AutoDetachCaptive) {
getOut = QUOTE(_this call FUNC(handleGetOut));
};
};
};
//reset captivity and escorting status when getting killed
class Extended_Killed_EventHandlers {
class CAManBase {
class GVAR(AutoDetachCaptive) {
killed = QUOTE(_this call FUNC(handleKilled));
};
};
};
//mission start
class Extended_InitPost_EventHandlers {
class CAManBase {
class GVAR(InitPost) {
init = QUOTE(_this call FUNC(handleUnitInitPost));
};
};
};

View File

@ -0,0 +1,83 @@
class CfgMovesBasic {
class Actions {
class CivilStandActions;
class ACE_CivilStandHandcuffedActions: CivilStandActions {
turnL = "";
turnR = "";
stop = "ACE_AmovPercMstpScapWnonDnon";
StopRelaxed = "ACE_AmovPercMstpScapWnonDnon";
default = "ACE_AmovPercMstpScapWnonDnon";
PutDown = "";
getOver = "";
throwPrepare = "";
throwGrenade[] = {"","Gesture"};
};
class ACE_CivilStandSurrenderActions: ACE_CivilStandHandcuffedActions {
stop = "ACE_AmovPercMstpSsurWnonDnon";
StopRelaxed = "ACE_AmovPercMstpSsurWnonDnon";
default = "ACE_AmovPercMstpSsurWnonDnon";
PutDown = "";
};
};
};
class CfgMovesMaleSdr: CfgMovesBasic {
class StandBase;
class States {
class AmovPercMstpSnonWnonDnon: StandBase {
ConnectTo[] += {"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon",0.1};
};
class CutSceneAnimationBase;
//Handcuffed Anims:
class ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon: CutSceneAnimationBase {
actions = "ACE_CivilStandHandcuffedActions";
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_EaseIn";
speed = 1;
looped = 0;
interpolationRestart = 2;
ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
};
class ACE_AmovPercMstpScapWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon {
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease";
speed = 0;
ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01};
looped = 1;
};
class ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon {
actions = "CivilStandActions";
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\amovpercmstpsnonwnondnon_easeout";
ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1};
};
//Surrender Anims:
class ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon: CutSceneAnimationBase {
actions = "ACE_CivilStandSurrenderActions";
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon";
speed = 1;
looped = 0;
interpolationRestart = 2;
ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
};
class ACE_AmovPercMstpSsurWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon";
speed = 0;
looped = 1;
ConnectTo[] = {"ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01};
};
class ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon {
speed = 0.5; //for gameplay reasons, slow this down
actions = "CivilStandActions";
file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\sur\non\AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon";
ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1};
InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon",0.1};
};
};
};

View File

@ -0,0 +1,202 @@
class CfgVehicles {
class Man;
class CAManBase: Man {
class ACE_Actions {
class ACE_RightHandActions {
selection = "righthand";
displayName = "Right hand";
distance = 5;
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs)) || ([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs)));
class ACE_ApplyHandcuffs {
displayName = "$STR_ACE_Captives_SetCaptive";
distance = 4;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs));
exceptions[] = {};
showDisabled = 0;
priority = 2.4;
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
hotkey = "C";
};
class ACE_RemoveHandcuffs {
displayName = "$STR_ACE_Captives_ReleaseCaptive";
distance = 4;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs));
exceptions[] = {};
showDisabled = 0;
priority = 2.4;
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
hotkey = "R";
};
};
class ACE_MainActions {
class ACE_EscortCaptive {
displayName = "$STR_ACE_Captives_EscortCaptive";
distance = 4;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canEscortCaptive));
statement = QUOTE([ARR_3(_player, _target, true)] call FUNC(doEscortCaptive));
exceptions[] = {};
showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.3;
hotkey = "E";
};
class ACE_StopEscorting {
displayName = "$STR_ACE_Captives_StopEscorting";
distance = 4;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canStopEscorting));
statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive));
exceptions[] = {QGVAR(isNotEscorting)};
showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.3;
hotkey = "E";
};
class ACE_LoadCaptive {
displayName = "$STR_ACE_Captives_LoadCaptive";
distance = 4;
condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive));
statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive));
exceptions[] = {QGVAR(isNotEscorting)};
showDisabled = 0;
icon = QUOTE(PATHTOF(UI\captive_ca.paa));
priority = 2.2;
hotkey = "L";
};
class ACE_FriskPerson {
displayName = "$STR_ACE_Captives_FriskPerson";
distance = 2;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canFriskPerson));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doFriskPerson));
showDisabled = 0;
//icon = ""; //@todo
priority = 3;
hotkey = "F";
};
};
};
class ACE_SelfActions {
class ACE_StopEscortingSelf {
displayName = "$STR_ACE_Captives_StopEscorting";
condition = QUOTE([ARR_2(_player, objNull)] call FUNC(canStopEscorting));
statement = QUOTE([ARR_3(_player,objNull, false)] call FUNC(doEscortCaptive));
exceptions[] = {QGVAR(isNotEscorting)};
showDisabled = 0;
priority = 2.3;
hotkey = "C";
};
class ACE_StartSurrenderingSelf {
displayName = "$STR_ACE_Captives_StartSurrendering";
condition = QUOTE([ARR_2(_player, true)] call FUNC(canSurrender));
statement = QUOTE([ARR_2(_player, true)] call FUNC(setSurrendered));
exceptions[] = {};
showDisabled = 0;
priority = 0;
};
class ACE_StopSurrenderingSelf {
displayName = "$STR_ACE_Captives_StopSurrendering";
condition = QUOTE([ARR_2(_player, false)] call FUNC(canSurrender));
statement = QUOTE([ARR_2(_player, false)] call FUNC(setSurrendered));
exceptions[] = {QGVAR(isNotSurrendering)};
showDisabled = 0;
priority = 0;
};
};
};
#define MACRO_LOADUNLOADCAPTIVE \
class ACE_Actions { \
class ACE_MainActions { \
selection = ""; \
class ACE_LoadCaptive { \
displayName = "$STR_ACE_Captives_LoadCaptive"; \
distance = 4; \
condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \
statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \
exceptions[] = {QGVAR(isNotEscorting)}; \
showDisabled = 0; \
priority = 1.2; \
hotkey = "L"; \
}; \
class ACE_UnloadCaptive { \
displayName = "$STR_ACE_Captives_UnloadCaptive"; \
distance = 4; \
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); \
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doUnloadCaptive)); \
showDisabled = 0; \
priority = 1.2; \
hotkey = "C"; \
}; \
}; \
};
class LandVehicle;
class Car: LandVehicle {
MACRO_LOADUNLOADCAPTIVE
};
class Tank: LandVehicle {
MACRO_LOADUNLOADCAPTIVE
};
class Air;
class Helicopter: Air {
MACRO_LOADUNLOADCAPTIVE
};
class Plane: Air {
MACRO_LOADUNLOADCAPTIVE
};
class Ship;
class Ship_F: Ship {
MACRO_LOADUNLOADCAPTIVE
};
class StaticWeapon: LandVehicle {
MACRO_LOADUNLOADCAPTIVE
};
class StaticMortar;
class Mortar_01_base_F: StaticMortar {
MACRO_LOADUNLOADCAPTIVE
};
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
name = #ITEM; \
count = COUNT; \
};
class Box_NATO_Support_F;
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(ACE_CableTie,12)
};
};
class Logic;
class Module_F: Logic {
class ArgumentsBaseUnits {};
class ModuleDescription {};
};
class GVAR(ModuleSurrender): Module_F {
author = "$STR_ACE_Common_ACETeam";
category = "ACE";
displayName = "Make Unit Surrender";
function = QUOTE(DFUNC(moduleSurrender));
scope = 2; //show in editor
scopeCurator = 2; //show in zeus
curatorCost = 0; //???
isGlobal = 1; //run global
isTriggerActivated = 1; //Wait for triggers
// icon = QUOTE(PATHTOF(ui\todo.paa));
functionPriority = 0;
class Arguments {};
class ModuleDescription: ModuleDescription {
description = "Sync a unit to make them surrender.<br/>Source: ace_captives";
sync[] = {"AnyAI"};
};
};
};

View File

@ -0,0 +1,15 @@
class CfgWeapons {
class ACE_ItemCore;
class InventoryItem_Base_F;
class ACE_CableTie: ACE_ItemCore {
displayName = "$STR_ACE_Captives_CableTie";
descriptionShort = "$STR_ACE_Captives_CableTieDescription";
model = QUOTE(PATHTOF(models\ace_cabletie.p3d));
picture = QUOTE(PATHTOF(UI\ace_cabletie_ca.paa));
scope = 2;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
};
};
};

14
addons/captives/README.md Normal file
View File

@ -0,0 +1,14 @@
ace_captives
============
Allows taking people captive/handcuffed
####Items:
`ACE_CableTie` - adds ability to take someone captive
## Maintainers
The people responsible for merging changes to this component or answering potential questions.
- [PabstMirror](https://github.com/PabstMirror)

View File

@ -0,0 +1,38 @@
#include "script_component.hpp"
//Handles when someone starts escorting and then disconnects, leaving the captive attached
//This is normaly handled by the PFEH in doEscortCaptive, but that won't be running if they DC
if (isServer) then {
addMissionEventHandler ["HandleDisconnect", {
PARAMS_1(_disconnectedPlayer);
_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];
};
}];
};
["playerVehicleChanged", {_this call FUNC(handleVehicleChanged)}] call EFUNC(common,addEventHandler);
["zeusDisplayChanged", {_this call FUNC(handleZeusDisplayChanged)}] call EFUNC(common,addEventHandler);
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler);
["MoveOutCaptive", {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler);
["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler);
["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler);
//TODO: Medical Integration Events???
// [_unit, "knockedOut", {
// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleKnockedOut};
// }] call ACE_Core_fnc_addCustomEventhandler;
// [_unit, "wokeUp", {
// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleWokeUp};
// }] call ACE_Core_fnc_addCustomEventhandler;

View File

@ -0,0 +1,33 @@
#include "script_component.hpp"
ADDON = false;
PREP(canApplyHandcuffs);
PREP(canEscortCaptive);
PREP(canFriskPerson);
PREP(canLoadCaptive);
PREP(canRemoveHandcuffs);
PREP(canStopEscorting);
PREP(canSurrender);
PREP(canUnloadCaptive);
PREP(doApplyHandcuffs);
PREP(doEscortCaptive);
PREP(doFriskPerson);
PREP(doLoadCaptive);
PREP(doRemoveHandcuffs);
PREP(doUnloadCaptive);
PREP(handleGetIn);
PREP(handleGetOut);
PREP(handleKilled);
PREP(handleKnockedOut);
PREP(handlePlayerChanged);
PREP(handleUnitInitPost);
PREP(handleWokeUp);
PREP(handleZeusDisplayChanged);
PREP(moduleSurrender);
PREP(setHandcuffed);
PREP(setSurrendered);
PREP(vehicleCaptiveMoveIn);
PREP(vehicleCaptiveMoveOut);
ADDON = true;

View File

@ -0,0 +1,31 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {QGVAR(ModuleSurrender)};
weapons[] = {"ACE_CableTie"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ACE_Interaction"};
author[] = {"commy2", "KoffeinFlummi"};
authorUrl = "https://github.com/commy2/";
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgMoves.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
class ACE_canInteractConditions {
class GVAR(isNotEscorting) {
condition = QUOTE(!(GETVAR(player,QGVAR(isEscorting),false)));
};
class GVAR(isNotHandcuffed) {
condition = QUOTE(!(GETVAR(player,QGVAR(isHandcuffed),false)));
};
class GVAR(isNotSurrendering) {
condition = QUOTE(!(GETVAR(player,QGVAR(isSurrendering),false)));
};
};

View File

@ -0,0 +1,25 @@
/*
* Author: PabstMirror
* Checks the conditions for being able to apply handcuffs
*
* Arguments:
* 0: caller (player) <OBJECT>
* 1: target <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [player, bob] call ACE_captives_fnc_canApplyHandcuffs
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_target);
//Player has cableTie, target is alive and not already handcuffed
("ACE_CableTie" in (items _unit)) &&
{alive _target} &&
{!(_target getVariable [QGVAR(isHandcuffed), false])}

View File

@ -0,0 +1,26 @@
/*
* Author: PabstMirror
* Tests if can escort target (attach)
*
* Arguments:
* 0: caller (player) <OBJECT>
* 1: target <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [player, bob] call ACE_captives_fnc_canEscortCaptive
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_target);
//Alive, handcuffed, not being escored, and not unconscious
(_target getVariable [QGVAR(isHandcuffed), false]) &&
{isNull (attachedTo _target)} &&
{alive _target} &&
{!(_target getVariable ["ACE_isUnconscious", false])}

View File

@ -0,0 +1,24 @@
/*
* Author: bux578
* Checks the conditions for being able to frisk a unit
*
* Arguments:
* 0: caller (player) <OBJECT>
* 1: target <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [player, bob] call ACE_captives_fnc_canFriskPerson
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_target);
_target getVariable [QGVAR(isHandcuffed), false]
|| {_target getVariable [QGVAR(isSurrendering), false]}
|| {_target getVariable ["ACE_isSearchable", false]}
|| {_target getVariable ["ACE_isUnconscious", false]}

View File

@ -0,0 +1,39 @@
/*
* Author: commy2
* Check if the unit can load the target object into a vehicle.
*
* Arguments:
* 0: Unit that wants to load a captive <OBJECT>
* 1: A captive. ObjNull for the first escorted captive (may be null) <OBJECT>
* 2: Vehicle to load the captive into. ObjNull for the nearest vehicle (may be null) <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [player, bob] call ACE_captives_fnc_canLoadCaptive
*
* Public: No
*/
#include "script_component.hpp"
private ["_objects"];
PARAMS_3(_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 _vehicle) then {
_objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship_F"], 10];
if ((count _objects) > 0) then {_vehicle = _objects select 0;};
};
(!isNull _target)
&& {!isNull _vehicle}
&& {_unit getVariable [QGVAR(isEscorting), false]}
&& {_target getVariable [QGVAR(isHandcuffed), false]}
&& {_vehicle emptyPositions "cargo" > 0}

View File

@ -0,0 +1,23 @@
/*
* Author: PabstMirror
* Checks the conditions for being able to remove handcuffs
*
* Arguments:
* 0: caller (player) <OBJECT>
* 1: target <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [player, bob] call ACE_captives_fnc_canRemoveHandcuffs
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_target);
//Unit is handcuffed and not currently being escorted
_target getVariable [QGVAR(isHandcuffed), false] &&
{isNull (attachedTo _target)}

View File

@ -0,0 +1,28 @@
/*
* Author: PabstMirror
* Tests if player can stop escorting
*
* Arguments:
* 0: caller (player) <OBJECT>
* 1: target <OBJECT><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [player, bob] call ACE_captives_fnc_canStopEscorting
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_unit);
DEFAULT_PARAM(1,_target,objNull);
if (isNull _target) then {
_target = _unit getVariable [QGVAR(escortedUnit), objNull];
};
if (isNull _target) exitWith {false};
(_target in (attachedObjects _unit)) && {_target getVariable [QGVAR(isHandcuffed), false]}

View File

@ -0,0 +1,29 @@
/*
* Author: PabstMirror
* Checks the conditions for being able to surrender
*
* Arguments:
* 0: caller (player) <OBJECT>
* 1: New Surrender State to test <BOOL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [Jean, true] call ACE_captives_fnc_canSurrender;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_newSurrenderState);
private "_returnValue";
_returnValue = if (_newSurrenderState) then {
!(_unit getVariable [QGVAR(isSurrendering), false]); //Not currently surrendering
} else {
(_unit getVariable [QGVAR(isSurrendering), false]); //is Surrendering
};
_returnValue

View File

@ -0,0 +1,28 @@
/*
* Author: commy2
* Check if the unit can unload a captive from the vehicle.
*
* Arguments:
* 0: Unit that wants to unload a captive <OBJECT>
* 1: A captive. ObjNull for the first escorted captive <OBJECT>
* 2: Vehicle to unload a captive from <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [player, bob, car1] call ACE_captives_fnc_canUnloadCaptive;
*
* Public: No
*/
#include "script_component.hpp"
private ["_cargo"];
PARAMS_2(_unit,_vehicle);
_cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turret positions. They shouldn't be there anyway.
_cargo = [_cargo, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter);
count _cargo > 0

View File

@ -0,0 +1,25 @@
/*
* Author: PabstMirror
* Checks the conditions for being able to apply handcuffs
*
* Arguments:
* 0: caller (player) <OBJECT>
* 1: target <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [player, bob] call ACE_captives_fnc_doApplyHandcuffs;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_target);
_unit removeItem "ACE_CableTie";
playSound3D [QUOTE(PATHTO_R(sounds\cable_tie_zipping.ogg)), objNull, false, (getPosASL _target), 1, 1, 10];
["SetHandcuffed", [_target], [_target, true]] call EFUNC(common,targetEvent);

View File

@ -0,0 +1,59 @@
/*
* Author: Nic547
* Attaches a Captive to the _unit
*
* Arguments:
* 0: _unit-Player <OBJECT>
* 1: target <OBJECT>
* 2: _state <BOOL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [player, bob, true] call ACE_captives_fnc_doEscorteCaptive;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_3(_unit,_target,_state);
if (_state) then {
if (_unit getVariable [QGVAR(isEscorting), false]) exitWith {};
[_unit, _target] call EFUNC(common,claim);
_unit setVariable [QGVAR(isEscorting), true, true];
_target attachTo [_unit, [0, 1, 0]];
_unit setVariable [QGVAR(escortedUnit), _target, true];
//Add Actionmenu to release captive
_actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", localize "STR_ACE_Captives_StopEscorting"],
{[(_this select 0), ((_this select 0) getVariable [QGVAR(escortedUnit), objNull]), false] call FUNC(doEscortCaptive);},
nil, 20, false, true, "", QUOTE(!isNull (GETVAR(_target,QGVAR(escortedUnit),objNull)))];
private "_escortFnc";
_escortFnc = {
EXPLODE_3_PVT((_this select 0),_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];
};
};
if (!(_unit getVariable [QGVAR(isEscorting), false])) then {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
[objNull, _target] call EFUNC(common,claim);
detach _target;
_unit removeAction _actionID;
_unit setVariable [QGVAR(escortedUnit), objNull, true];
};
};
[_escortFnc, 0.2, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler;
} else {
_unit setVariable [QGVAR(isEscorting), false, true];
_unit setVariable [QGVAR(escortedUnit), objNull, true];
};

View File

@ -0,0 +1,70 @@
/*
* Author: bux578
* Open the select menu with the "personal" items of a frisked unit. It only shows "handgunWeapon", "uniformItems", "vestItems", "backpackItems" and "assignedItems" because every other item is visible on the character
*
* Arguments:
* 0: player unit <OBJECT>
* 1: unit <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [player, bob] call ACE_captives_fnc_doFristPerson;
*
* Public: No
*/
#include "script_component.hpp"
private ["_weapon", "_listedItemClasses", "_actions", "_allGear"];
PARAMS_2(_player,_unit);
_weapon = currentWeapon _player;
if (_weapon == primaryWeapon _player && {_weapon != ""}) then {
[_player, "AmovPercMstpSlowWrflDnon", 0] call EFUNC(common,doAnimation);
};
_listedItemClasses = [];
_actions = [localize "STR_ACE_Captives_FriskMenuHeader", localize "STR_ACE_Captives_CancelSelection"] call ACE_Interaction_fnc_prepareSelectMenu;
_allGear = [];
if ((handgunWeapon _unit) != "") then {
_allGear pushBack (handgunWeapon _unit);
};
if (count (uniformItems _unit) > 0) then {
_allGear = _allGear + (uniformItems _unit);
};
if (count (vestItems _unit) > 0) then {
_allGear = _allGear + (vestItems _unit);
};
if (count (backpackItems _unit) > 0) then {
_allGear = _allGear + (backpackItems _unit);
};
if (count (assignedItems _unit) > 0) then {
_allGear = _allGear + (assignedItems _unit);
};
// Handgun
// Uniform Items
// Vest Items
// Backpack Items
// Assigned Items
{
if (!(_x in _listedItemClasses)) then {
private "_item";
_item = configFile >> "CfgMagazines" >> _x;
if (isNil "_item" || str _item == "") then { //str _item ?
_item = configFile >> "CfgWeapons" >> _x;
};
_actions = [_actions, getText(_item >> "displayName"), getText(_item >> "picture"), _x] call ACE_Interaction_fnc_addSelectableItem;
_listedItemClasses pushBack _x;
};
} forEach (_allGear);
[_actions, {call ACE_Interaction_fnc_hideMenu;}, {call ACE_Interaction_fnc_hideMenu;}] call ACE_Interaction_fnc_openSelectMenu;
// don't need an "Ok" Button
ctrlShow [8860, false];

View File

@ -0,0 +1,38 @@
/*
* Author: commy2
* Unit loads the target object into a vehicle.
*
* Arguments:
* 0: Unit that wants to load a captive <OBJECT>
* 1: A captive. ObjNull for the first escorted captive <OBJECT>
* 2: Vehicle to load the captive into. ObjNull for the nearest vehicle <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [bob, tom, car] call ACE_captives_fnc_doLoadCaptive
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_3(_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) exitWith {};
if (isNull _vehicle) then {
_objects = nearestObjects [_unit, ["Car_F", "Tank_F", "Helicopter_F", "Boat_F", "Plane_F"], 10];
if ((count _objects) > 0) then {_vehicle = _objects select 0;};
};
if (isNull _vehicle) exitWith {};
if ((!isNil "_target") && {!isNil "_vehicle"}) then {
_unit setVariable [QGVAR(isEscorting), false, true];
["MoveInCaptive", [_target], [_target, _vehicle]] call EFUNC(common,targetEvent);
};

View File

@ -0,0 +1,20 @@
/*
* Author: PabstMirror
* Remove handcuffs from a target
*
* Arguments:
* 0: target <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [bob, false] call ACE_captives_fnc_doRemoveHandcuffs
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_target);
["SetHandcuffed", [_target], [_target, false]] call EFUNC(common,targetEvent);

View File

@ -0,0 +1,32 @@
/*
* Author: commy2
* Unit unloads a captive from a vehicle.
*
* Arguments:
* 0: Unit that wants to unload a captive <OBJECT>
* 1: Vehicle to unload a captive from. <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* [bob, car] call ACE_captives_fnc_doUnloadCaptive
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_vehicle);
private ["_cargo", "_target"];
_cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turret positions. They shouldn't be there anyway.
_cargo = [_cargo, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter);
if ((count _cargo) > 0) then {
_target = _cargo select 0;
["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent);
} else {
ERROR("No captive to unload");
};

View File

@ -0,0 +1,30 @@
/*
* Author: commy2
* Handles when a unit gets in to a vehicle. Release escorted captive when entering a vehicle
*
* Arguments:
* 0: _vehicle <OBJECT>
* 2: dunno <OBJECT>
* 1: _unit <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [car2, x, player] call ACE_captives_fnc_handleGetIn
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_3(_vehicle,_dontcare,_unit);
if (local _unit) then {
if (_unit getVariable [QGVAR(isEscorting), false]) then {
_unit setVariable [QGVAR(isEscorting), false, true];
};
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
[_unit, false] call FUNC(setSurrender);
};
};

View File

@ -0,0 +1,33 @@
/*
* Author: commy2
* Handles when a captive unit gets out of a vehicle.
*
* Arguments:
* 0: _vehicle <OBJECT>
* 2: dunno <OBJECT>
* 1: _unit <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [car2, x, player] call ACE_captives_fnc_handleGetOut
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_3(_vehicle,_dontcare,_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 {
_unit moveInCargo [_vehicle, _cargoIndex];
};
[_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation);
};

View File

@ -0,0 +1,30 @@
/*
* Author: PabstMirror
* Handles when a unit is kill. Reset captivity and escorting status
*
* Arguments:
* 0: _oldUnit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [bob1] call ACE_captives_fnc_handleKilled
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_oldUnit);
if (_oldUnit getVariable [QGVAR(isHandcuffed), false]) then {
_oldUnit setVariable [QGVAR(isHandcuffed), false, true];
};
if (_oldUnit getVariable [QGVAR(isEscorting), false]) then {
_oldUnit setVariable [QGVAR(isEscorting), false, true];
};
if (_oldUnit getVariable [QGVAR(isSurrendering), false]) then {
_oldUnit setVariable [QGVAR(isSurrendering), false, true];
};

View File

@ -0,0 +1,25 @@
/*
* Author: commy2, PabstMirror
* Handles when a unit gets knocked out. Ends surrendering.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [bob, true] call ACE_captives_fnc_handleKnockedOut
*
* Public: No
*/
#include "script_component.hpp"
//ToDo: Waiting on medical integration
PARAMS_1(_unit);
if (_unit getVariable [QGVAR(isSurrendering), false]) then { //If surrendering, stop
[_unit, false] call FUNC(setSurrendered);
};

View File

@ -0,0 +1,33 @@
/*
* Author: commy2
* Handles playerChanged. Resets "showHUD" based on handcuff status
*
* Arguments:
* 0: _newUnit <OBJECT>
* 1: _oldUnit <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [bob1, bob2] call ACE_captives_fnc_handlePlayerChange
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_newUnit,_oldUnit);
//set showHUD based on new unit status:
if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_newUnit getVariable [QGVAR(isSurrendering), false]}) then {
TRACE_1("Player Change (showHUD false)",_newUnit);
showHUD false;
} else {
TRACE_1("Player Change (showHUD true)",_newUnit);
showHUD true;
};
//If old player was escorting, stop
if (_oldUnit getVariable [QGVAR(isEscorting), false]) then {
_oldUnit setVariable [QGVAR(isEscorting), false, true];
};

View File

@ -0,0 +1,34 @@
/*
* Author: commy2
* handle captive and unconsciousness state and prevent grenades
*
* Arguments:
* 0: _unit <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [bob] call ACE_captives_fnc_handleUnitInitPost
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_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);
if (local _unit) then {
// reset status on mission start
if (_unit getVariable [QGVAR(isHandcuffed), false]) then {
_unit setVariable [QGVAR(isHandcuffed), false];
[_unit, true] call FUNC(setHandcuffed);
};
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
_unit setVariable [QGVAR(isSurrendering), false];
[_unit, true] call FUNC(setSurrendered);
};
};

View File

@ -0,0 +1,23 @@
/*
* Author: commy2
* TODO
*
* Arguments:
* 0: _unit <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [bob] call ACE_captives_fnc_handleWokeUp
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_unit);
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 0] call EFUNC(common,doAnimation);
};

View File

@ -0,0 +1,31 @@
/*
* Author: PabstMirror
* Handles ZeusDisplayChanged event
* Need to reset showHUD after closing zeus
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Display is now open <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* [bob1, false] call ACE_captives_fnc_handleZeusDisplayChanged
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_zeusIsOpen);
//set showHUD based on unit status:
if (!_zeusIsOpen) then {
if ((_unit getVariable [QGVAR(isHandcuffed), false]) || {_unit getVariable [QGVAR(isSurrendering), false]}) then {
TRACE_1("Player Change (showHUD false)",_unit);
showHUD false;
} else {
TRACE_1("Player Change (showHUD true)",_unit);
showHUD true;
};
};

View File

@ -0,0 +1,58 @@
/*
* Author: PabstMirror
* Module Function to make a unit surrender (can be called from editor, or placed with zeus)
*
* Arguments:
* 0: The Module Logic Object <OBJECT>
* 1: synced objects <ARRAY>
* 2: Activated <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* Called from module
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_3(_logic,_units,_activated);
if (!_activated) exitWith {};
if (local _logic) then {
if ((!isnull curatorcamera) && {((count curatorMouseOver) == 2) && {(curatorMouseOver select 1) == _logic}}) then {//in zeus interface and we placed the module
_bisMouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver", []];//bis caches the previous curatorMouseOver
if ((count _bisMouseOver) == 2) then {//check what mouse was over before the module was placed
_mouseOverObject = _bisMouseOver select 1;
if ((_mouseOverObject isKindOf "CAManBase") && {(vehicle _mouseOverObject) == _mouseOverObject}) then {
TRACE_2("Debug - module surrendering %1",_mouseOverObject,(name _mouseOverObject));
if (alive _mouseOverObject) then {
if (!(_mouseOverObject getVariable [QGVAR(isSurrendering), false])) then {
["SetSurrendered", [_mouseOverObject], [_mouseOverObject, true]] call EFUNC(common,targetEvent);
} else {
["SetSurrendered", [_mouseOverObject], [_mouseOverObject, false]] call EFUNC(common,targetEvent);
};
} else {
["STR_ACE_Captives_Zeus_OnlyAlive"] call EFUNC(common,displayTextStructured);
};
} else {
["STR_ACE_Captives_Zeus_OnlyInfentry"] call EFUNC(common,displayTextStructured);
};
} else {
["STR_ACE_Captives_Zeus_NothingSelected"] call EFUNC(common,displayTextStructured);
};
} else {
//an editor module
//Modules run before postInit can instal the event handler, so we need to wait a little bit
[{
PARAMS_1(_units);
{
["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent);
} forEach _units;
}, [_units], 0.05, 0.05]call EFUNC(common,waitAndExecute);
};
deleteVehicle _logic;
};

View File

@ -0,0 +1,86 @@
/*
* Author: Nic547, commy2
* Handcuffs a unit.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: True to take captive, false to release captive <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* [bob, true] call ACE_captives_fnc_setHandcuffed;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_state);
if (!local _unit) exitwith {
ERROR("running setHandcuffed on remote unit");
};
if ((_unit getVariable [QGVAR(isHandcuffed), false]) isEqualTo _state) exitWith {
ERROR("setHandcuffed: current state same as new");
};
if (_state) then {
_unit setVariable [QGVAR(isHandcuffed), true, true];
[_unit, QGVAR(Handcuffed), true] call EFUNC(common,setCaptivityStatus);
if (_unit getVariable [QGVAR(isSurrendering), false]) then { //If surrendering, stop
[_unit, false] call FUNC(setSurrendered);
};
//Set unit cargoIndex (will be -1 if dismounted)
_unit setVariable [QGVAR(CargoIndex), ((vehicle _unit) getCargoIndex _unit), true];
if (_unit == ACE_player) then {
showHUD false;
};
// fix anim on mission start (should work on dedicated servers)
[{
PARAMS_1(_unit);
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
[_unit, "ACE_AmovPercMstpScapWnonDnon", 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)
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
PARAMS_2(_unit,_newAnimation);
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && (_newAnimation != "Unconscious")) then {
ERROR("Handcuff animation interrupted");
systemChat format ["debug %2: new %1", _newAnimation, time];
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
};
}];
_unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID];
};
}, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute);
} else {
_unit setVariable [QGVAR(isHandcuffed), false, true];
[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus);
//remove AnimChanged EH
_animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
_unit setVariable [QGVAR(handcuffAnimEHID), -1];
if ((vehicle _unit) == _unit) then {
//Break out of hands up animation loop (doAnimation handles Unconscious prioity)
[_unit, "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
};
if (_unit getVariable [QGVAR(CargoIndex), -1] != -1) then {
_unit setVariable [QGVAR(CargoIndex), -1, true];
};
if (_unit == ACE_player) then {
showHUD true;
};
};

View File

@ -0,0 +1,101 @@
/*
* Author: commy2 PabstMirror
* Lets a unit surrender
*
* Arguments:
* 0: Unit <OBJECT>
* 1: True to surrender, false to un-surrender <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* [Pierre, true] call ACE_captives_fnc_setSurrendered;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_state);
if (!local _unit) exitwith {
ERROR("running surrender on remote unit");
};
if ((_unit getVariable [QGVAR(isSurrendering), false]) isEqualTo _state) exitWith {
ERROR("Surrender: current state same as new");
};
if (_state) then {
if ((vehicle _unit) != _unit) exitWith {ERROR("Cannot surrender while mounted");};
if (_unit getVariable [QGVAR(isHandcuffed), false]) exitWith {ERROR("Cannot surrender while handcuffed");};
_unit setVariable [QGVAR(isSurrendering), true, true];
[_unit, QGVAR(Surrendered), true] call EFUNC(common,setCaptivityStatus);
if (_unit == ACE_player) then {
showHUD false;
};
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
[_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation);
// fix anim on mission start (should work on dedicated servers)
[{
PARAMS_1(_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)
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
PARAMS_2(_unit,_newAnimation);
if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && (_newAnimation != "Unconscious")) then {
ERROR("Surrender animation interrupted");
systemChat format ["debug %2: new %1", _newAnimation, time];
[_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation);
};
}];
_unit setVariable [QGVAR(surrenderAnimEHID), _animChangedEHID];
};
}, [_unit], 0.01, 0] call EFUNC(common,waitAndExecute);
} else {
_unit setVariable [QGVAR(isSurrendering), false, true];
[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
//remove AnimChanged EH
_animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
_unit setVariable [QGVAR(surrenderAnimEHID), -1];
if (_unit == ACE_player) then {
//only re-enable HUD if not handcuffed
if (!(_unit getVariable [QGVAR(isHandcuffed), false])) then {
showHUD true;
};
};
if (_unit getVariable ["ACE_isUnconscious", false]) exitWith {}; //don't touch animations if unconscious
//if we are in "hands up" animationState, crack it now
if (((vehicle _unit) == _unit) && {(animationState _unit) == "ACE_AmovPercMstpSsurWnonDnon"}) then {
[_unit, "ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
} else {
//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);
//If waited long enough or they re-surrendered or they are unconscious, exit loop
if ((time > _maxTime) || {_unit getVariable [QGVAR(isSurrendering), false]} || {_unit getVariable ["ACE_isUnconscious", false]}) exitWith {
[_pfID] call CBA_fnc_removePerFrameHandler;
};
//Only break animation if they are actualy the "hands up" animation (because we are using switchmove there won't be an transition)
if (((vehicle _unit) == _unit) && {(animationState _unit) == "ACE_AmovPercMstpSsurWnonDnon"}) exitWith {
[_pfID] call CBA_fnc_removePerFrameHandler;
//Break out of hands up animation loop
[_unit, "ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
};
}, 0, [_unit, (time + 20)]] call CBA_fnc_addPerFrameHandler;
};
};

View File

@ -0,0 +1,26 @@
/*
* Author: PabstMirror
* Loads a captive into a vehicle
*
* Arguments:
* 0: The Captive <OBJECT>
* 1: The Vehicle <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [bob, car1] call ACE_captives_fnc_vehicleCaptiveMoveIn;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_target,_vehicle);
private ["_cargoIndex"];
_target moveInCargo _vehicle;
_target assignAsCargo _vehicle;
_cargoIndex = _vehicle getCargoIndex _target;
_target setVariable [QGVAR(CargoIndex), _cargoIndex, true];

View File

@ -0,0 +1,24 @@
/*
* Author: PabstMirror
* Unloads a captive from a vehicle.
*
* Arguments:
* 0: Captive Unit being unloaded <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [bob] call ACE_captives_fnc_vehicleCaptiveMoveOut;
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_unit);
_unit setVariable [QGVAR(CargoIndex), -1, true];
moveOut _unit;
[_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation);
unassignVehicle _unit;

View File

@ -0,0 +1 @@
#include "\z\ace\addons\captives\script_component.hpp"

Binary file not shown.

View File

@ -0,0 +1,79 @@
ambient[]={1,1,1,1};
diffuse[]={1,1,1,1};
forcedDiffuse[]={0,0,0,0};
emmisive[]={0,0,0,1};
specular[]={0.01,0.01,0.01,1}; //amount of glossiness - the higher the number, the higher the glossiness
specularPower=500; //area of glossiness - the higher the number, the smaller the area
PixelShaderID="Super";
VertexShaderID="Super";
class Stage1 {
texture="#(rgb,1,1,1)color(0.5,0.5,1,1)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage2 {
texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage3 {
texture="#(argb,8,8,3)color(0,0,0,0,mc)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage4 {
texture="#(argb,8,8,3)color(1,1,1,1,as)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,1};
};
};
class Stage5 {
texture="#(rgb,1,1,1)color(0.2,0.2,1,1)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,0};
pos[]={0,0,0};
};
};
class Stage6 {
texture="#(ai,64,64,1)fresnel(4.7,1.2)";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,0};
};
};
class Stage7 {
texture="a3\data_f\env_land_ca.paa";
uvSource="tex";
class uvTransform {
aside[]={1,0,0};
up[]={0,1,0};
dir[]={0,0,1};
pos[]={0,0,0};
};
};

View File

@ -0,0 +1,12 @@
#define COMPONENT captives
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_CAPTIVES
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_CAPTIVES
#define DEBUG_SETTINGS DEBUG_SETTINGS_CAPTIVES
#endif
#include "\z\ace\addons\main\script_macros.hpp"

Binary file not shown.

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-16 -->
<Project name="AGM">
<!-- Edited with tabler - 2015-02-24 -->
<Project name="ACE">
<Package name="Captives">
<Key ID="STR_AGM_Captives_SetCaptive">
<Key ID="STR_ACE_Captives_SetCaptive">
<English>Take Prisoner</English>
<German>Gefangen nehmen</German>
<Spanish>Tomar prisionero</Spanish>
@ -14,7 +14,7 @@
<Hungarian>Foglyul ejtés</Hungarian>
<Russian>Взять в плен</Russian>
</Key>
<Key ID="STR_AGM_Captives_ReleaseCaptive">
<Key ID="STR_ACE_Captives_ReleaseCaptive">
<English>Free Prisoner</English>
<German>Gefangenen freilassen</German>
<Spanish>Liberar prisionero</Spanish>
@ -26,7 +26,7 @@
<Hungarian>Fogoly szabadon elengedése</Hungarian>
<Russian>Освободить пленника</Russian>
</Key>
<Key ID="STR_AGM_Captives_EscortCaptive">
<Key ID="STR_ACE_Captives_EscortCaptive">
<English>Escort Prisoner</English>
<German>Gefangenen eskortieren</German>
<Spanish>Escoltar prisionero</Spanish>
@ -38,7 +38,7 @@
<Hungarian>Fogoly kísérése</Hungarian>
<Russian>Конвоировать пленника</Russian>
</Key>
<Key ID="STR_AGM_Captives_StopEscorting">
<Key ID="STR_ACE_Captives_StopEscorting">
<English>Release Prisoner</English>
<German>Gefangenen loslassen</German>
<Spanish>Soltar prisionero</Spanish>
@ -50,7 +50,7 @@
<Hungarian>Fogoly elengedése</Hungarian>
<Russian>Прекратить конвоирование</Russian>
</Key>
<Key ID="STR_AGM_Captives_NoCaptive">
<Key ID="STR_ACE_Captives_NoCaptive">
<English>You need to take him as prisoner first!</English>
<German>Du must ihn zuerst gefangen nehmen.</German>
<Spanish>Necesitas hacerle prisionero primero!</Spanish>
@ -62,7 +62,7 @@
<Hungarian>Először foglyul kell ejtened!</Hungarian>
<Russian>Вы должны сначала взять его в плен!</Russian>
</Key>
<Key ID="STR_AGM_Captives_LoadCaptive">
<Key ID="STR_ACE_Captives_LoadCaptive">
<English>Load Captive</English>
<German>Gefangenen einladen</German>
<Spanish>Cargar prisionero</Spanish>
@ -71,8 +71,9 @@
<Czech>Naložit zajatce</Czech>
<Hungarian>Fogoly berakása</Hungarian>
<Russian>Загрузить пленного</Russian>
<Portuguese>Embarcar Prisioneiro</Portuguese>
</Key>
<Key ID="STR_AGM_Captives_UnloadCaptive">
<Key ID="STR_ACE_Captives_UnloadCaptive">
<English>Unload Captive</English>
<German>Gefangenen ausladen</German>
<Spanish>Descargar prisionero</Spanish>
@ -81,8 +82,9 @@
<Czech>Vyložit zajatce</Czech>
<Hungarian>Fogoly kivevése</Hungarian>
<Russian>Выгрузить пленного</Russian>
<Portuguese>Desembarcar Prisioneiro</Portuguese>
</Key>
<Key ID="STR_AGM_Captives_CableTie">
<Key ID="STR_ACE_Captives_CableTie">
<English>Cable Tie</English>
<German>Kabelbinder</German>
<Polish>Opaska zaciskowa</Polish>
@ -94,7 +96,7 @@
<Hungarian>Gyorskötöző</Hungarian>
<Russian>Кабельная стяжка</Russian>
</Key>
<Key ID="STR_AGM_Captives_CableTieDescription">
<Key ID="STR_ACE_Captives_CableTieDescription">
<English>Cable ties that allow you to restrain prisoners.</English>
<German>Kabelbinder ermöglichen es, Gefangene zu fesseln.</German>
<Polish>Opaska zaciskowa pozwala na skrępowanie dłoni u więźnia.</Polish>
@ -106,7 +108,7 @@
<Hungarian>Gyorskötöző emberek fogjulejtéséhez.</Hungarian>
<Russian>Кабельные стяжки позволяют связывать пленников.</Russian>
</Key>
<Key ID="STR_AGM_Captives_FriskMenuHeader">
<Key ID="STR_ACE_Captives_FriskMenuHeader">
<English>Inventory of frisked person</English>
<German>Inventar der durchsuchten Person</German>
<French>Inventaire de la fouille</French>
@ -115,8 +117,9 @@
<Czech>Inventář prohledávané osoby</Czech>
<Polish>Ekwipunek rewidowanej osoby</Polish>
<Russian>Инвентарь обысканных лиц</Russian>
<Portuguese>Inventário da pessoa revistada</Portuguese>
</Key>
<Key ID="STR_AGM_Captives_FriskPerson">
<Key ID="STR_ACE_Captives_FriskPerson">
<English>Frisk person</English>
<German>Person durchsuchen</German>
<French>Fouiller</French>
@ -125,6 +128,22 @@
<Polish>Rewiduj osobę</Polish>
<Hungarian>Motozás</Hungarian>
<Russian>Обыскать человека</Russian>
<Portuguese>Revistar</Portuguese>
</Key>
<Key ID="STR_ACE_Captives_StartSurrendering">
<English>Surrender</English>
</Key>
<Key ID="STR_ACE_Captives_StopSurrendering">
<English>Stop Surrendering</English>
</Key>
<Key ID="STR_ACE_Captives_Zeus_OnlyAlive">
<English>Only use on alive units</English>
</Key>
<Key ID="STR_ACE_Captives_Zeus_OnlyInfentry">
<English>Only use on dismounted inf</English>
</Key>
<Key ID="STR_ACE_Captives_Zeus_NothingSelected">
<English>Nothing under mouse</English>
</Key>
</Package>
</Project>

View File

@ -38,7 +38,7 @@ class Extended_Respawn_EventHandlers {
respawn = QUOTE(_this call FUNC(setName));
};
class GVAR(RESETDefaults) {
respawn = QUOTE(_this call FUNC(resetAllDefaults_F));
respawn = QUOTE(_this call FUNC(resetAllDefaults));
};
};
};

View File

@ -17,14 +17,15 @@ class RscTitles {
class HintBox: RscStructuredText {
idc = 1;
text = "";
size = "1 / 40 / (getResolution select 5)";
sizeEx = 1;
//size = "1 / 40 / (getResolution select 5)";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0, 0, 0, 0.5};
x = safeZoneW + safeZoneX - 0 * safezoneW; //safeZoneW + safeZoneX - 0.2 * safezoneW;
y = safeZoneY + 0.2 * safezoneH;
w = 0.2 * safeZoneW;
h = 0.1 * SafeZoneH;
font = "PuristaMedium";
};
};
};
@ -36,13 +37,12 @@ class RscTitles {
fadeIn = 0.2;
fadeOut = 0.2;
name = "ACE_RscErrorHint";
class controls {
class HintBox: RscStructuredText {
idc = 1;
text = "";
size = "1 / 40 / (getResolution select 5)";
sizeEx = 1;
//size = "1 / 40 / (getResolution select 5)";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0.8, 0, 0, 0.5};
x = 0.3 * safeZoneW + safeZoneX;
@ -52,6 +52,7 @@ class RscTitles {
};
};
};
class ACE_EventHandlerHelper: ACE_Rsc_Display_Base {
idd = -1;
class controls {

View File

@ -1,6 +1,3 @@
class ACE_gui_RscProgress;
class ACE_gui_staticBase;
class GVAR(ProgressBar_Dialog) {
idd = -1;
@ -20,7 +17,7 @@ class GVAR(ProgressBar_Dialog) {
type = 0;
style = 0;
size = 1;
colorBackground[] = {0, 0, 0, 0.1};
colorBackground[] = {0, 0, 0, 0.0};
colorText[] = {0, 0, 0, 0};
x = "safezoneX";
y = "safezoneY";
@ -34,7 +31,7 @@ class GVAR(ProgressBar_Dialog) {
y = "0.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = ".8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
colorFrame[] = {0,0,0,0.025};
colorFrame[] = {0,0,0,0.0};
colorBar[] = {0.27,0.5,0.31,0.8};
texture = "#(argb,8,8,3)color(1,1,1,0.7)";
};

View File

@ -26,5 +26,5 @@ class RscDisplayInventory {
};
class RscDisplayChannel {
onLoad = QUOTE(_this call GVAR(onLoadRscDisplayChannel));
onLoad = QUOTE(_this call FUNC(onLoadRscDisplayChannel));
};

View File

@ -82,7 +82,7 @@ enableCamShake true;
}] call FUNC(addEventhandler);
GVAR(OldPlayerInventory) = ACE_player call FUNC(getAllGear);
GVAR(OldPlayerInventory) = [ACE_player] call FUNC(getAllGear);
GVAR(OldPlayerVisionMode) = currentVisionMode ACE_player;
GVAR(OldZeusDisplayIsOpen) = !(isNull findDisplay 312);
GVAR(OldCameraView) = cameraView;
@ -93,7 +93,7 @@ GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex);
[{
// "playerInventoryChanged" event
_newPlayerInventory = ACE_player call FUNC(getAllGear);
_newPlayerInventory = [ACE_player] call FUNC(getAllGear);
if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then {
// Raise ACE event locally
GVAR(OldPlayerInventory) = _newPlayerInventory;
@ -158,3 +158,6 @@ GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex);
PARAMS_2(_vehicle,_fuelLevel);
_vehicle setFuel _fuelLevel;
}] call FUNC(addEventhandler);
["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler);
["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler);

View File

@ -15,12 +15,17 @@ PREP(addSetting);
PREP(adminKick);
PREP(ambientBrightness);
PREP(applyForceWalkStatus);
PREP(beingCarried);
PREP(binarizeNumber);
PREP(blurScreen);
PREP(callCustomEventHandlers);
PREP(callCustomEventHandlersGlobal);
PREP(canGetInPosition);
PREP(canInteract);
PREP(canInteractWith);
PREP(canUseWeapon);
PREP(carriedByObj);
PREP(carryObj);
PREP(changeProjectileDirection);
PREP(checkPBOs);
PREP(claim);
@ -30,7 +35,12 @@ PREP(codeToString);
PREP(convertKeyCode);
PREP(createOrthonormalReference);
PREP(currentChannel);
PREP(debug);
PREP(debugModule);
PREP(defineVariable);
PREP(disableAI);
PREP(disableUserInput);
PREP(displayIcon);
PREP(displayText);
PREP(displayTextPicture);
PREP(displayTextStructured);
@ -42,12 +52,21 @@ PREP(execRemoteFnc);
PREP(executePersistent);
PREP(filter);
PREP(fixLoweredRifleAnimation);
PREP(getAllDefinedSetVariables);
PREP(getAllGear);
PREP(getCaptivityStatus);
PREP(getCarriedBy);
PREP(getCarriedObj);
PREP(getConfigCommander);
PREP(getConfigGunner);
PREP(getDeathAnim);
PREP(getDefaultAnim);
PREP(getDefinedVariable);
PREP(getDefinedVariableDefault);
PREP(getDefinedVariableInfo);
PREP(getDoorTurrets);
PREP(getFirstObjectIntersection);
PREP(getFirstTerrainIntersection);
PREP(getForceWalkStatus);
PREP(getGunner);
PREP(getHitPoints);
@ -56,6 +75,7 @@ PREP(getInPosition);
PREP(getMarkerType);
PREP(getName);
PREP(getNumberFromMissionSQM);
PREP(getNumberMagazinesIn);
PREP(getPitchBankYaw);
PREP(getSettingData);
PREP(getStringFromMissionSQM);
@ -74,28 +94,43 @@ PREP(getUavControlPosition);
PREP(getVehicleCargo);
PREP(getVehicleCodriver);
PREP(getVehicleCrew);
PREP(getVersion);
PREP(getWeaponAzimuthAndInclination);
PREP(getWeaponIndex);
PREP(getWeaponType);
PREP(getWindDirection);
PREP(goKneeling);
PREP(hadamardProduct);
PREP(hasItem);
PREP(hasMagazine);
PREP(inheritsFrom);
PREP(insertionSort);
PREP(interpolateFromArray);
PREP(inTransitionAnim);
PREP(inWater);
PREP(isArrested);
PREP(isAutoWind);
PREP(isAwake);
PREP(isEngineer);
PREP(isEOD);
PREP(isInBuilding);
PREP(isModLoaded);
PREP(isPlayer);
PREP(isTurnedOut);
PREP(letterToCode);
PREP(limitMovementSpeed);
PREP(loadPerson);
PREP(loadPersonLocal);
PREP(loadSettingsFromProfile);
PREP(loadSettingsOnServer);
PREP(map);
PREP(moduleCheckPBOs);
PREP(moduleLSDVehicles);
PREP(moveToTempGroup);
PREP(muteUnit);
PREP(numberToDigits);
PREP(numberToDigitsString);
PREP(onAnswerRequest);
PREP(onLoadRscDisplayChannel);
PREP(owned);
PREP(player);
@ -103,31 +138,53 @@ PREP(playerSide);
PREP(progressBar);
PREP(queueAnimation);
PREP(readSettingFromModule);
PREP(receiveRequest);
PREP(removeActionEventHandler);
PREP(removeActionMenuEventHandler);
PREP(removeCameraEventHandler);
PREP(removeCustomEventHandler);
PREP(removeMapMarkerCreatedEventHandler);
PREP(removeScrollWheelEventHandler);
PREP(requestCallback);
PREP(resetAllDefaults);
PREP(restoreVariablesJIP);
PREP(revertKeyCodeLocalized);
PREP(sanitizeString);
PREP(sendRequest);
PREP(serverLog);
PREP(setArrestState);
PREP(setCanInteract);
PREP(setCaptivityStatus);
PREP(setCarriedBy);
PREP(setDefinedVariable);
PREP(setDisableUserInputStatus);
PREP(setForceWalkStatus);
PREP(setHearingCapability);
PREP(setName);
PREP(setParameter);
PREP(setPitchBankYaw);
PREP(setVariableJIP);
PREP(setProne);
PREP(setSetting);
PREP(setSettingFromConfig);
PREP(setVariableJIP);
PREP(setVariablePublic);
PREP(setVolume);
PREP(sortAlphabeticallyBy);
PREP(stringCompare);
PREP(stringToColoredText);
PREP(stringRemoveWhiteSpace);
PREP(subString);
PREP(switchToGroupSide);
PREP(throttledPublicVariable);
PREP(toBin);
PREP(toBitmask);
PREP(toHex);
PREP(toNumber);
PREP(uniqueElementsOnly);
PREP(unloadPerson);
PREP(unmuteUnit);
PREP(useItem);
PREP(useMagazine);
PREP(waitAndExecute);
// ACE_Debug
@ -192,74 +249,6 @@ if (hasInterface) then {
}, 0, []] call cba_fnc_addPerFrameHandler;
};
PREP(stringCompare);
PREP(string_removeWhiteSpace);
PREP(isHC);
PREP(sendRequest_f);
PREP(requestCallback);
PREP(receiveRequest);
PREP(onAnswerRequest);
PREP(debug);
PREP(debugModule);
PREP(defineVariable);
PREP(setDefinedVariable);
PREP(getDefinedVariable);
PREP(getAllDefinedSetVariables);
PREP(getDefinedVariableInfo);
PREP(getDefinedVariableDefault);
PREP(getDeathAnim);
PREP(insertionSort);
PREP(uniqueElementsOnly);
PREP(sortAlphabeticallyBy);
PREP(hasMagazine);
PREP(useMagazine);
PREP(findMagazine);
PREP(hasItem);
PREP(useItem);
PREP(findItem);
PREP(getNumberMagazinesIn);
PREP(setCanInteract);
PREP(getCanInteract);
PREP(canInteract);
PREP(resetAllDefaults_f);
PREP(broadcastSound3D_f);
PREP(isAwake);
PREP(setProne);
PREP(setDisableUserInputStatus);
PREP(dropWeapon_f);
PREP(inWater_f);
PREP(setVolume_f);
PREP(closeAllDialogs_f);
PREP(disableAI_f);
PREP(switchToGroupSide_f);
PREP(getFirstObjectIntersection);
PREP(getFirstTerrainIntersection);
PREP(setHearingCapability);
PREP(revealObject_f);
PREP(getWeaponItems_f);
PREP(isModLoaded_f);
PREP(inheritsFrom);
PREP(getVersion);
PREP(carryObj);
PREP(carriedByObj);
PREP(getCarriedObj);
PREP(getCarriedBy);
PREP(beingCarried);
PREP(setCarriedBy);
PREP(moveToTempGroup);
PREP(limitMovementSpeed);
PREP(setArrestState);
PREP(isArrested);
PREP(loadPerson_F);
PREP(loadPersonLocal_F);
PREP(unloadPerson_F);
ADDON = true;
isHC = !(hasInterface || isDedicated);

View File

@ -94,8 +94,41 @@ class ACE_Settings {
isClientSetable = 1;
displayName = "$STR_ACE_Common_EnableNumberHotkeys";
};
class GVAR(settingFeedbackIcons) {
value = 1;
typeName = "SCALAR";
force = 0;
isClientSetable = 1;
displayName = "$STR_ACE_Common_SettingFeedbackIconsName";
description = "$STR_ACE_Common_SettingFeedbackIconsDesc";
values[] = {"Hide", "Top right, downwards", "Top right, to the left", "Top left, downwards", "Top left, to the right"};
};
class GVAR(SettingProgressBarLocation) {
value = 0;
typeName = "SCALAR";
force = 0;
isClientSetable = 1;
displayName = "$STR_ACE_Common_SettingProgressbarLocationName";
description = "$STR_ACE_Common_SettingProgressbarLocationDesc";
values[] = {"Top", "Bottom"};
};
class GVAR(displayTextColor) {
value[] = {0,0,0,0.1};
typeName = "COLOR";
isClientSetable = 1;
displayName = "$STR_ACE_Common_SettingDisplayTextColorName";
description = "$STR_ACE_Common_SettingDisplayTextColorDesc";
};
class GVAR(displayTextFontColor) {
value[] = {1,1,1,1};
typeName = "COLOR";
isClientSetable = 1;
displayName = "$STR_ACE_Common_SettingDisplayTextFontColorName";
description = "$STR_ACE_Common_SettingDisplayTextFontColorDesc";
};
};
#include "define.hpp"
#include <ProgressScreen.hpp>
#include <HintConfig.hpp>
#include <RscInfoType.hpp>
@ -103,3 +136,23 @@ class ACE_Settings {
#include <FixAnimations.hpp>
#include <NoVoice.hpp>
class CfgUIGrids {
class IGUI {
class Presets {
class Arma3 {
class Variables {
grid_ACE_displayText[] = {{((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40)),safeZoneY + 0.175 * safezoneH, (10 *(((safezoneW / safezoneH) min 1.2) / 40)), (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))}, "(((safezoneW / safezoneH) min 1.2) / 40)","((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"};
};
};
};
class Variables {
class grid_ACE_displayText {
displayName = "ACE Hint";
description = "Textual in game feedback to the player.";
preview = "\a3\Ui_f\data\GUI\Cfg\UIGrids\grid_hint_ca.paa";
saveToProfile[] = {0,1};
};
};
};
};

View File

@ -182,12 +182,12 @@ class ACE_gui_buttonBase {
bottom = 0.00;
};
textureNoShortcut = "";
animTextureNormal = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa) );
animTextureDisabled = QUOTE( PATHTOF(data\buttonDisabled_gradient.paa));
animTextureOver = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa));
animTextureFocused = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa));
animTexturePressed = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa));
animTextureDefault = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa));
animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)";
animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)";
animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
period = 0.5;
font = FontCSE;
soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};

View File

@ -39,4 +39,4 @@ if (_show) then {
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = nil;
};
};
};
};

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