Merge branch 'master' into lasers

This commit is contained in:
jaynus 2015-02-25 11:38:02 -08:00
commit ad1e8fdb21
1298 changed files with 40842 additions and 18397 deletions

13
.editorconfig Normal file
View File

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

View File

@ -10,8 +10,8 @@ commy2
esteldunedain <nicolas.d.badano@gmail.com>
Felix Wiegand <koffeinflummi@gmail.com>
Garth "L-H" de Wet <garthofhearts@gmail.com>
Jo David
PabstMirror
bux578 <github@jonathandavid.de>
PabstMirror <pabstmirror@gmail.com>
# CONTRIBUTORS
11RDP-LoupVert <loupvert@11rdp.fr>

View File

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

View File

@ -0,0 +1,44 @@
/////////////////////////////////////////////////////////////////////////////////
# #
# ADVANCED COMBAT ENVIRONMENT FILE #
# #
/////////////////////////////////////////////////////////////////////////////////
#===========#
| Component |
#===========#
ace_sys_crewserved
#================#
| Main author(s) |
#================#
rocko - Maintenance, Configs, Dialogs
#=================#
| Contact details |
#=================#
Mail: rocko@dev-heaven.net
Page: http://dev-heaven.net/projects/show/ace-mod2
/////////////////////////////////////////////////////////////////////////////////
# #
# ADVANCED COMBAT ENVIRONMENT FILE #
# #
/////////////////////////////////////////////////////////////////////////////////
// //
# Copyright 2009 A.C.E MOD, ALL RIGHTS RESERVED #
// //
// This product is licensed for personal use only. Commercial distribution //
// prohibited. Military use prohibited. Use prohibited if any component //
// of this distribution removed or modified without express written consent //
// of the developer. For further licensing details please refer to the //
// End User License Agreement provided within this PBO file. //
// Any questions or comments, please contact contact@acemod.net //
// //
/////////////////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,27 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
class Extended_Killed_EventHandlers {
class AllVehicles {
class ADDON {
killed = QUOTE(_this call FUNC(clearCargo));
exclude[] = {"Man"}; //Exclude Animals and Humans
};
};
};
class Extended_InitPost_EventHandlers {
class AllVehicles {
class ADDON {
Init = QUOTE(if (alive (_this select 0)) then {_this call FUNC(init)});
exclude[] = {"Man"}; //Exclude Animals and Humans
};
};
};

View File

@ -0,0 +1,31 @@
// -----------------------------------------------------------------------------
// Automatically generated by 'functions_config.rb'
// DO NOT MANUALLY EDIT THIS FILE!
// -----------------------------------------------------------------------------
class CfgFunctions {
class ACE {
class Cargo {
// ACE_fnc_canLoadCargo
class canLoadCargo {
description = "Checks if vehicle is able to load cargo";
file = "\z\ace\Addons\sys_cargo\fnc_canLoadCargo.sqf";
};
// ACE_fnc_listCargo
class listCargo {
description = "Lists cargo of a vehicle.";
file = "\z\ace\Addons\sys_cargo\fnc_listCargo.sqf";
};
// ACE_fnc_loadCargo
class loadCargo {
description = "Load cargo into vehicles.";
file = "\z\ace\Addons\sys_cargo\fnc_loadCargo.sqf";
};
// ACE_fnc_unloadCargo
class unloadCargo {
description = "Unloads cargo from a vehicle.";
file = "\z\ace\Addons\sys_cargo\fnc_unloadCargo.sqf";
};
};
};
};

View File

@ -0,0 +1,89 @@
class CfgVehicles {
// TODO: add more cases ?
class All;
class Land;
class Man: Land { ACE_NOCARGOLOAD; };
class LandVehicle: Land { ACE_LOAD_ONLY; };
class Tank: LandVehicle { ACE_GEAR_ONLY; }; // Tank must be also ACE_LOAD_ONLY, because some obvious APCs like Bradley are inherited from class Tank instead of Tracked_APC
// TODO: Add exceptions for real class Tank !!
//class T72_Base: Tank
//class ZSU_Base: Tank
//class M1A1: Tank
//class T34: Tank
//class MLRS: Tank
//class 2S6M_Tunguska: Tank
//class M113_Base: Tank { ACE_LOAD_ONLY; };
//class M2A2_Base: Tank { ACE_LOAD_ONLY; };
//class T55_Base: Tank
//class BAF_FV510_D: Tank { ACE_LOAD_ONLY; };
class Tracked_APC: Tank { ACE_LOAD_ONLY; };
class Car: LandVehicle { ACE_LOAD_ONLY; };
//class BIS_alice_emptydoor: Car { ACE_NOCARGOLOAD; }; // FU DOOR
class PaperCar: Car { ACE_NOCARGOLOAD; };
class Wheeled_APC: Car { ACE_LOAD_ONLY; };
class Motorcycle: Landvehicle { ACE_CARGO_ONLY; };
class StaticWeapon: LandVehicle { ACE_CARGO_ONLY; };
//class StaticCanon: StaticWeapon { ACE_NOCARGOLOAD; };
class Air;
class Helicopter: Air { ACE_LOAD_ONLY; };
class ParachuteBase: Helicopter { ACE_NOCARGOLOAD; };
class Plane: Air { ACE_LOAD_ONLY; };
class Ship;
class SmallShip: Ship { ACE_LOAD_ONLY; };
class BigShip: Ship { ACE_LOAD_ONLY; };
class Ship_F;
class Boat_F: Ship_F { ACE_LOAD_ONLY; };
class Rubber_duck_base_F: Boat_F {
ACE_CARGO_ONLY;
ACE_Weight = 260;
};
class Boat_Armed_01_base_F: Boat_F { ACE_LOAD_ONLY; };
class Static: All { ACE_NOCARGOLOAD; };
class Strategic;
class ReammoBox: Strategic { ACE_CARGO_ONLY; };
class Library_WeaponHolder: Strategic { ACE_NOCARGOLOAD; };
class WeaponHolder: ReammoBox { ACE_NOCARGOLOAD; };
class Thing: All { ACE_NOCARGOLOAD; };
class Wreck: Thing { ACE_NOCARGOLOAD; };
class ACE_Object: Thing { ACE_NOCARGOLOAD; };
// TODO: Move to another hpp file
class thingX: Thing { ACE_NOCARGOLOAD; };
class RoadCone_F: thingX { ACE_CARGO_ONLY; ACE_Weight = 1; };
class FloatingStructure_F;
class RoadCone_L_F: FloatingStructure_F { ACE_CARGO_ONLY; ACE_Weight = 1; };
class ReammoBox_F: thingX { ACE_CARGO_ONLY; };
/*class FoldChair: Thing {
ACE_CARGO_ONLY;
ACE_Weight = 1;
class Useractions {
class Sit {
displayname = "Sit";
radius = 2;
position = "Component1";
onlyforPlayer = 1;
condition = "alive this";
statement= "player setPosASL getPosASL this; player setDir ((getDir this)+90); player switchMove 'ACE_CoolSit'; player call ace_sys_cargo_fnc_standup";
};
};
};*/
// TODO: Add more stuff, like RoadCones, BarbedWire, Other small items to be carried
// Stuff that is to be CARRIED:
/*
- Arty Shells - done
- Fuel Can - done
- RoadCone -done
- Signs (TODO: Need to specify which ones)
- Barbed wire (TODO: Need rolled model to be unrolles for sys_razorwire or so)
- Sparewheel for small cars
- Suitcase
-
- Anything that comes to mind then
*/
};

View File

@ -0,0 +1,318 @@
#define CT_STATIC 0
#define CT_BUTTON 1
#define CT_EDIT 2
#define CT_SLIDER 3
#define CT_COMBO 4
#define CT_LISTBOX 5
#define CT_TOOLBOX 6
#define CT_CHECKBOXES 7
#define CT_PROGRESS 8
#define CT_HTML 9
#define CT_STATIC_SKEW 10
#define CT_ACTIVETEXT 11
#define CT_TREE 12
#define CT_STRUCTURED_TEXT 13
#define CT_CONTEXT_MENU 14
#define CT_CONTROLS_GROUP 15
#define CT_XKEYDESC 40
#define CT_XBUTTON 41
#define CT_XLISTBOX 42
#define CT_XSLIDER 43
#define CT_XCOMBO 44
#define CT_ANIMATED_TEXTURE 45
#define CT_OBJECT 80
#define CT_OBJECT_ZOOM 81
#define CT_OBJECT_CONTAINER 82
#define CT_OBJECT_CONT_ANIM 83
#define CT_LINEBREAK 98
#define CT_USER 99
#define CT_MAP 100
#define CT_MAP_MAIN 101
#define ST_POS 0x0F
#define ST_HPOS 0x03
#define ST_VPOS 0x0C
#define ST_LEFT 0x00
#define ST_RIGHT 0x01
#define ST_CENTER 0x02
#define ST_DOWN 0x04
#define ST_UP 0x08
#define ST_VCENTER 0x0c
#define ST_TYPE 0xF0
#define ST_SINGLE 0
#define ST_MULTI 16
#define ST_TITLE_BAR 32
#define ST_PICTURE 48
#define ST_FRAME 64
#define ST_BACKGROUND 80
#define ST_GROUP_BOX 96
#define ST_GROUP_BOX2 112
#define ST_HUD_BACKGROUND 128
#define ST_TILE_PICTURE 144
#define ST_WITH_RECT 160
#define ST_LINE 176
#define ST_SHADOW 0x100
#define ST_NO_RECT 0x200
#define ST_KEEP_ASPECT_RATIO 0x800
#define ST_TITLE ST_TITLE_BAR + ST_CENTER
#define SL_DIR 0x400
#define SL_VERT 0
#define SL_HORZ 0x400
#define SL_TEXTURES 0x10
#define LB_TEXTURES 0x10
#define LB_MULTI 0x20
#define FontM "PuristaMedium"
#define FontHTML "PuristaMedium"
class ACE_CARGO_RscBgFrame {
type=CT_STATIC;
idc=-1;
style=ST_FRAME;
colorBackground[]={0.4, 0.4, 0.4, 0.75};
colorText[]={0, 0, 0, 1};
font=FontM;
SizeEX=0.025;
text="";
};
class ACE_CARGO_RscBackground {
colorBackground[]={0.4, 0.4, 0.4, 0.75};
text="";
type=CT_STATIC;
idc=-1;
style=ST_LEFT;
colorText[]={1, 1, 1, 1};
font=FontM;
sizeEx=0.04;
};
class ACE_CARGO_RscPicture {
type=CT_STATIC;
idc=-1;
style=ST_PICTURE;
colorBackground[]={0, 0, 0, 0};
colorText[]={1, 1, 1, 1};
font=FontM;
sizeEx=0.02;
text="";
};
class ACE_CARGO_RscButton {
type=CT_BUTTON;
idc=-1;
style=ST_CENTER;
colorText[]={0, 0, 0, 1};
font=FontHTML;
sizeEx=0.025;
soundPush[]={"", 0.2, 1};
soundClick[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundClick",0.09,1};
soundEscape[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEscape",0.09,1};
default=false;
text="";
action="";
colorActive[]={0, 0, 0, 0};
colorDisabled[]={0, 0, 0, 0.1};
colorBackground[]={0,0,0,0.3};
colorBackgroundActive[]={0,0,0,0.4};
colorBackgroundDisabled[]={0,0,0,0.3};
colorFocused[]={0.84,1,0.55,1};
colorShadow[]={1, 1, 1, 0.1};
colorBorder[]={0, 0, 0, 0.1};
offsetX=0;
offsetY=0;
offsetPressedX=0;
offsetPressedY=0;
borderSize=0;
soundEnter[]={"", 0.15, 1};
};
class ACE_CARGO_RscButton2:ACE_CARGO_RscButton {
x=-1.0;
y=-1.0;
idc=-1;
w=0.01;
h=0.01;
default=true;
};
class ACE_CARGO_RscShortcutButton {
type = 16;
idc = -1;
style = 0;
default = 0;
w = 0.183825;
h = 0.104575;
color[] = {0.543,0.5742,0.4102,1};
color2[] = {0.95,0.95,0.95,1};
colorBackground[] = {1,1,1,1};
colorbackground2[] = {1,1,1,0.4};
colorDisabled[] = {1,1,1,0.25};
periodFocus = 1.2;
periodOver = 0.8;
class HitZone {
left = 0.004;
top = 0.029;
right = 0.004;
bottom = 0.029;
};
class ShortcutPos {
left = 0.0145;
top = 0.026;
w = 0.0392157;
h = 0.0522876;
};
class TextPos {
left = 0.05;
top = 0.034;
right = 0.005;
bottom = 0.005;
};
animTextureNormal = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\normal_ca.paa";
animTextureDisabled = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\disabled_ca.paa";
animTextureOver = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\over_ca.paa";
animTextureFocused = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\focus_ca.paa";
animTexturePressed = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\down_ca.paa";
animTextureDefault = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\normal_ca.paa";
period = 0.4;
font = "PuristaMedium";
size = 0.03921;
sizeEx = 0.03921;
text = "";
soundEnter[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEnter",0.09,1};
soundPush[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundPush",0.09,1};
soundClick[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundClick",0.09,1};
soundEscape[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEscape",0.09,1};
action = "";
class Attributes {
font = "PuristaMedium";
color = "#E5E5E5";
align = "left";
shadow = "true";
};
class AttributesImage {
font = "PuristaMedium";
color = "#E5E5E5";
align = "left";
};
textureNoShortcut = "#(argb,8,8,3)color(0,0,0,0)";
};
class ACE_CARGO_RscShortcutButtonMain: ACE_CARGO_RscShortcutButton {
type = 16;
idc = -1;
style = 0;
default = 0;
w = 0.313726;
h = 0.104575;
color[] = {0.543,0.5742,0.4102,1};
colorDisabled[] = {1,1,1,0.25};
colorFocused[] = {1, 1, 1, 0};//Check
colorBackgroundFocused[] = {1, 1, 1, 0};//Check
class HitZone {
left = 0;
top = 0;
right = 0;
bottom = 0;
};
class ShortcutPos {
left = 0.0204;
top = 0.026;
w = 0.0392157;
h = 0.0522876;
};
class TextPos {
left = 0.08;
top = 0.034;
right = 0.005;
bottom = 0.005;
};
animTextureNormal = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\normal_ca.paa";
animTextureDisabled = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\disabled_ca.paa";
animTextureOver = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\over_ca.paa";
animTextureFocused = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\focus_ca.paa";
animTexturePressed = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\down_ca.paa";
animTextureDefault = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButtonMain\normal_ca.paa";
period = 0.5;
font = "PuristaMedium";
size = 0.03921;
sizeEx = 0.03921;
text = "";
soundEnter[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEnter",0.09,1};
soundPush[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundPush",0.09,1};
soundClick[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundClick",0.09,1};
soundEscape[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEscape",0.09,1};
action = "";
class Attributes {
font = "PuristaMedium";
color = "#E5E5E5";
align = "left";
shadow = "false";
};
class AttributesImage {
font = "PuristaMedium";
color = "#E5E5E5";
align = "false";
};
};
class ACE_CARGO_RscEdit {
type=CT_EDIT;
idc=-1;
style=ST_LEFT;
font=FontHTML;
sizeEx=0.02;
colorText[]={0, 0, 0, 1};
colorSelection[]={0.5, 0.5, 0.5, 1};
autocomplete=false;
text="";
};
class ACE_CARGO_RscLB_C {
style=ST_LEFT;
idc=-1;
colorSelect[]={0.4, 0.4, 0.4, 1};
colorSelectBackground[]={0.2, 0.2, 0.2, 1};
colorText[]={0.2, 0.2, 0.2, 1};
colorBackground[]={0.4, 0.4, 0.4, 1};
font=FontHTML;
sizeEx=0.025;
rowHeight=0.04;
};
class ACE_CARGO_RscListBox:ACE_CARGO_RscLB_C {
soundSelect[]={"", 0.1, 1};
type=CT_LISTBOX;
};
class ACE_CARGO_RscCombo: ACE_CARGO_RscLB_C {
sizeEx=0.02;
type=CT_COMBO;
wholeHeight=0.3;
soundSelect[]={"", 0.15, 1};
soundExpand[]={"", 0.15, 1};
soundCollapse[]={"", 0.15, 1};
maxHistoryDelay = 1;
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
class ScrollBar {
color[] = {1,1,1,0.6};
colorActive[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.3};
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
};
color[] ={0,0,0,0.6};
colorActive[] ={0,0,0,1};
colorDisabled[] ={0,0,0,0.3};
colorSelectBackground[] ={0.543,0.5742,0.4102,1};
};
class ACE_CARGO_RscSliderH {
access=0;
type=CT_SLIDER;
idc=-1;
sizeEx=0.025;
style=1024;
color[]={0.2, 0.2, 0.2, 1};
colorActive[]={1, 1, 1, 1};
};
class ACE_CARGO_RscSliderV {
access=0;
type=CT_SLIDER;
idc=-1;
sizeEx=0.025;
style=0;
color[]={0.2, 0.2, 0.2, 1};
colorActive[]={1, 1, 1, 1};
};

View File

@ -0,0 +1,178 @@
/* ace_sys_cargo | (c) 2013 by rocko */
#include "Defines.hpp"
#define __X SafeZoneX
#define __Y SafeZoneY
#define __W SafeZoneW
#define __H SafeZoneH
#define UICOMBO 5 // LISTBOX
class ACE_CARGOUIList {
w = 0.275;
h = 0.04;
colorSelect[] = {0.023529,0,0.0313725,1};
colorText[] = {0.023529,0,0.0313725,1};
colorBackground[] = {0.95,0.95,0.95,1};
colorSelectBackground[] = {0.543,0.5742,0.4102,1};
colorScrollbar[] = {0.023529,0,0.0313725,1};
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
wholeHeight = 0.45;
color[] = {0,0,0,0.6};
colorActive[] = {0,0,0,1};
colorDisabled[] = {0,0,0,0.3};
font = "PuristaMedium";
sizeEx = 0.029;
soundSelect[] = {"",0.1,1};
soundExpand[] = {"",0.1,1};
soundCollapse[] = {"",0.1,1};
maxHistoryDelay = 1;
class listScrollBar {
color[] = {1, 1, 1, 0.6};
colorActive[] = {1, 1, 1, 1};
colorDisabled[] = {1, 1, 1, 0.3};
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
};
};
class ACE_CARGOUIComboBox: ACE_CARGOUIList {
type = UICOMBO;
style = 0;
idc = -1;
sizeEx = 0.025;
wholeHeight = 0.3;
};
class ACE_CARGO_RscText {
type = CT_STATIC;
idc = -1;
style = ST_LEFT;
x = 0.0;
y = 0.0;
w = 0.3;
h = 0.03;
sizeEx = 0.023;
colorBackground[] = {0.5, 0.5, 0.5, 0.75};
colorText[] = { 0, 0, 0, 1 };
font = "PuristaMedium";
text = "";
};
class ACE_Cargo_List {
name="ACE_Cargo_List";
idd=-1;
movingEnable=0;
objects[]={};
onLoad = "uiNamespace setVariable ['ACE_Cargo_List', _this select 0];['back'] call ace_sys_cargo_fnc_onload";
onUnload = "[ace_sys_cargo_vehicle,objnull,0,0] call ace_sys_cargo_fnc_cbusy;";
class controlsBackground {
class BG: ACE_CARGO_RscText {
idc = -1;
type = 0;
style = 48;
x = 0.270792 * safezoneW + safezoneX;
y = 0.224911 * safezoneH + safezoneY;
w = 0.455752 * safezoneW;
h = 0.547272 * safezoneH;
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0,0,0,0};
text = "z\ace\addons\sys_cargo\data\rsc\ace_ui_background_ca.paa";
font = "PuristaMedium";
sizeEx = 0.032;
};
};
class controls {
class Title: ACE_CARGO_RscText {
idc = 30;
x = 0.289755 * safezoneW + safezoneX;
y = 0.231139 * safezoneH + safezoneY;
w = 0.0458417 * safezoneW;
h = 0.0550178 * safezoneH;
sizeEx = 0.05;
colorBackground[] = {1, 1, 1, 0.0};
colorText[] = {0.643, 0.5742, 0.4102, 1.0};
text = "";
};
class Content: ACE_CARGOUIComboBox {
idc = 99;
text = "";
x = 0.277061 * safezoneW + safezoneX;
y = 0.283526 * safezoneH + safezoneY;
w = 0.416083 * safezoneW;
h = 0.322891 * safezoneH;
colorSelect[] = {1, 1, 1, 1};
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0.8,0.8,0.8,1};
colorSelectBackground[] = {0, 0, 0, 1};
colorScrollbar[] = {0.2, 0.2, 0.2, 1};
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
wholeHeight = 0.45;
rowHeight = 0.06;
color[] = {0.8, 0.8, 0.8, 1};
colorActive[] = {0,0,0,1};
colorDisabled[] = {0,0,0,0.3};
font = "PuristaMedium";
sizeEx = 0.035;
soundSelect[] = {"",0.1,1};
soundExpand[] = {"",0.1,1};
soundCollapse[] = {"",0.1,1};
maxHistoryDelay = 1;
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
class listScrollBar {
color[] = {1, 1, 1, 0.6};
colorActive[] = {1, 1, 1, 1};
colorDisabled[] = {1, 1, 1, 0.3};
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
};
//onLBSelChanged = QUOTE([_this,'back'] call FUNC(lbselchanged));
onLBSelChanged = "[_this,'back'] call ace_sys_cargo_fnc_lbselchanged";
};
class Apply_B: ACE_CARGO_RscShortcutButtonMain {
idc=10;
x = 0.451603 * safezoneW + safezoneX;
y = 0.618615 * safezoneH + safezoneY;
w = 0.103494 * safezoneW;
h = 0.0451332 * safezoneH;
size = 0.02;
sizeEx = 0.02;
text = $STR_DIAG_ACE_CARGO_UNLOAD;
//action = QUOTE([GVAR(vehicle),'back'] call FUNC(unload));
action = "[ace_sys_cargo_vehicle,'back'] call ace_sys_cargo_fnc_unload";
};
class Quit_B: Apply_B {
idc = 20;
x = 0.566379 * safezoneW + safezoneX;
text = $STR_DIAG_ACE_CARGO_CANCEL;
action = "closeDialog 0;";
};
};
};
class ACE_CargoFront_List: ACE_Cargo_List {
name="ACE_CargoFront_List";
onLoad = "uiNamespace setVariable ['ACE_CargoFront_List', _this select 0];['front'] call ace_sys_cargo_fnc_onload";
class controls: controls {
class Title: Title {};
class Content: Content {
onLBSelChanged = "[_this,'front'] call ace_sys_cargo_fnc_lbselchanged";
};
class Apply_B: Apply_B {
action = "[ace_sys_cargo_vehicle,'front'] call ace_sys_cargo_fnc_unload";
};
class Quit_B: Quit_B {};
};
};

View File

@ -0,0 +1,9 @@
/* ace_sys_cargo | (c) 2010,2011 by rocko */
#include "script_component.hpp"
ADDON = false;
//["All", [ace_sys_interaction_key], 2, [QPATHTO_F(fnc_menuDef), "main"]] call CBA_ui_fnc_add;
ADDON = true;

View File

@ -0,0 +1,295 @@
/* ace_sys_cargo | (c) 2010,2011 by rocko */
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
#define __CONF_MAGAZINES configFile >> "CfgMagazines"
#define __CONF_WEAPONS configFile >> "CfgWeapons"
ADDON = false;
if (!isDedicated) then {
["All", [ace_sys_interaction_key], 2, [QPATHTO_F(fnc_menuDef), "main"]] call CBA_ui_fnc_add;
};
PREP(carry);
PREP(carry2);
PREP(drag);
PREP(push);
PREP(load);
PREP(loadCargo); // Workaround
PREP(unloadCargo); // Workaround
PREP(listCargo); // Workaround
PREP(unload);
PREP(onload);
PREP(view);
PREP(init);
[QGVAR(setvel), {(_this select 0) setVelocity (_this select 1)}] call ACE_fnc_addReceiverOnlyEventhandler;
// TODO: Complete rewrite needed:
/*
Function should determine wether an object can be dragged or carried or carried in pairs
Push option ONLY for boat type vehicles (to drop them back into water)
Carrying objects should be 0 - 30 kg (Carring above 20 kilo slows you down)
Dragging should be 30 - 80 kg
Carrying in pairs should be 80 - 180 kg
An object that can be dragged should also be able to be carried in pairs
Everything > 180 kg, needs to be loaded and transported by another vehicle or lifted by air
*/
FUNC(determineCargo) = {
// TODO: Make easier....
// Immobile: 0
// Carry: 1 Light objects weight exceeds no more than 20 kg!!!
// Drag: 2 Heavy objects that could not be CARRIED, weight > 15 kg < 100kg
// Push: 3 Heavy objects that could not be CARRIED or DRAGGED, weight > 100 kg!
// Carry with 2 people: 4 Heavy objects (if _type is ((2 && > 80) || (3 && < 200) && _helper) but a second player (_helper) is close ~5 meters)
// Rev. 2:
// Carry: 1 (0-30 kg)
// Drag: 2 (30-80kg)
// Carry 2 4 (80-145kg)
// Drag OR Carry 2 5 (30-145kg and because its cool) // One override comes from CSW direct, other entities should get a special config entry (e.g ammoboxes etc)
private ["_weight","_volume","_canDrag","_canCarry","_canPush","_type"];
// Calculate volume of cargo to determine weight.
PARAMS_2(_target,_method);
_volume = 0;
_weight = 0;
_canDrag = false;
_canPush = false;
_canCarry = false;
if (getNumber (configFile >> "CfgVehicles" >> typeOf _target >> "ACE_canBeCargo") == 1) then {
_weight = [_target] call FUNC(weight);
_canCarry = (_weight < __MAXCARRYWEIGHT);
_canDrag = (!_canCarry && {(_weight + __MAXCARRYWEIGHT) <= __MAXDRAGWEIGHT});
TRACE_2("DC",_volume,_weight);
switch (true) do {
// PUSH for Boats
case (_target isKindOf "Zodiac" || {_target isKindOf "PBX"}): { _canDrag = false; _canPush = true; _canCarry = false; };
case (_target isKindOf "ACE_Stretcher"): { _canDrag = false; _canPush = false; _canCarry = false; };
};
// Check sys_crewserved override
if (getNumber(configFile >> "CfgVehicles" >> typeOf _target >> "ACE" >>"ACE_CREWSERVED" >> "canDrag") == 1) then {
_canDrag = true; _canPush = false; _canCarry = false;
};
if (getNumber(configFile >> "CfgVehicles" >> typeOf _target >> "ACE" >>"ACE_CREWSERVED" >> "canCarry") == 1) then {
_canDrag = true; _canPush = false; _canCarry = true;
};
// Check if a shot mortar
if (_target getVariable ["ace_sys_arty_shoton",false]) then {
_canDrag = false; _canCarry = false;
};
};
if (_canCarry && {!_canDrag} && {!_canPush}) then { _type = 1; };
if (!_canCarry && {_canDrag} && {!_canPush}) then { _type = 2; };
if (_canPush && {!_canDrag} && {!_canCarry}) then { _type = 3; };
if (!_canPush && {!_canDrag} && {!_canCarry}) then { _type = 0; };
if (!_canCarry && {!_canDrag} && {!_canPush} && {_weight <= __MAXCARRYWEIGHTBY2}) then { _type = 4; };
if (_canCarry && {_canDrag} && {!_canPush} && {_weight <= __MAXCARRYWEIGHTBY2}) then { _type = 5; };
if (_method == "set") then {
_target setVariable [QGVAR(type),_type,true];
};
TRACE_1("DC Carrying method",_type);
_type
};
FUNC(clearCargo) = {
private ["_cargolist","_cargofrontlist"];
PARAMS_1(_vehicle);
_cargolist = [_vehicle] call ACE_fnc_listCargo;
_cargofrontlist = _vehicle getVariable [QGVAR(content_front),[]];
if (count _cargolist < 1 && {count _cargofrontlist < 1}) exitWith {};
{
deleteVehicle _x;
} foreach _cargolist + _cargofrontlist;
// TODO: Determine explosives loaded? Create Secondaries for loaded shells, ammoboxes, ammocans etc
// Perhaps should be called from external with explosions, sys_destruction ...
_vehicle setVariable [QGVAR(content),[],true];
_vehicle setVariable [QGVAR(content_front),[],true];
};
FUNC(determineFrontCargo) = {
PARAMS_1(_vehicle);
private ["_frontLoadingCapability","_l1","_l2","_pl1","_pl2","_pos","_chksum","_max","_cur","_capacity_full"];
_frontLoadingCapability = true;
if !((typeOf _vehicle) isKindOf "Car") exitWith { // Only on class Car for now...
[false,true,[0,0,0]]
};
// TODO: Get class ACE value
// Find position between frontlights
_l1 = getText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "Reflectors" >> "Left" >> "selection");
_l2 = getText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "Reflectors" >> "Right" >> "selection");
_pl1 = _vehicle selectionPosition _l1;
_pl2 = _vehicle selectionPosition _l2;
_pos = [0,(_pl1 select 1)+0.1,(_pl2 select 2)-0.4];
_chksum = (_pos select 0)+(_pos select 1)+(_pos select 2);
// TODO: Error if model not conform or has no lights
// Return position to attach and bool value for 2 in 1 function
if (_chksum == 0.1) then {
_frontLoadingCapability = false;
};
//_max = getNumber(configFile >> "CfgVehicles" >> typeOf _vehicle >> "ACE" >> "ACE_CARGO" >> "FrontLoadingCapacity");
_max = 1;
_cur = _vehicle getVariable [QGVAR(content_front),[]];
_cur = count _cur;
_capacity_free = if (_max - _cur == 0) then {false} else {true};
[_frontLoadingCapability,_capacity_free,_pos]
};
FUNC(attachToFront) = {
PARAMS_2(_cargo,_vehicle);
private ["_currentFrontCargo","_pos"];
_pos = (_vehicle call FUNC(determineFrontCargo)) select 2;
[_cargo,"set"] call FUNC(determineCargo);
["","","",["stop",player getVariable QGVAR(carried_object)]] call FUNC(carry);
_cargo attachTo [_vehicle,_pos,""];
_cargo setVariable [QGVAR(attached_front),true,true];
_currentFrontCargo = _vehicle getVariable [QGVAR(content_front),[]];
_currentFrontCargo set [count _currentFrontCargo,_cargo];
_vehicle setVariable [QGVAR(content_front),_currentFrontCargo];
};
FUNC(detachFront) = {
PARAMS_1(_cargo);
//private "_currentFrontCargo";
detach _cargo;
_cargo setVariable [QGVAR(attached_front),false,true];
//_currentFrontCargo = _vehicle getVariable [QGVAR(content_front),[]];
//if (count _currentFrontCargo < 1) exitWith {};
//_currentFrontCargo - [_cargo];
//_vehicle setVariable [QGVAR(content_front),_currentFrontCargo];
};
// TODO: Outsource funcs to external
// Busy func
FUNC(busy) = {
PARAMS_2(_v,_s);
if (_s == 1) then {
_v setVariable [QGVAR(busy), true, true];
} else {
_v setVariable [QGVAR(busy), false, true];
};
};
// Easy set/reset busy states
FUNC(cbusy) = {
PARAMS_4(_v,_c,_sv,_sc);
if (_sv == 1) then { [_v,1] call FUNC(busy); } else { [_v,0] call FUNC(busy); };
if (_sc == 1) then { [_c,1] call FUNC(busy); } else { [_c,0] call FUNC(busy); };
};
// Volume stuff
FUNC(volume) = {
PARAMS_1(_target);
_bbox = boundingBox _target;
_bc = abs((_bbox select 0) select 0) + abs((_bbox select 1) select 0);
_lc = abs((_bbox select 0) select 1) + abs((_bbox select 1) select 1);
_hc = abs((_bbox select 0) select 2) + abs((_bbox select 1) select 2);
_volume = (_lc * _bc * _hc);
TRACE_1("V Volume",_volume);
_volume;
};
// Weight stuff
FUNC(weight) = {
PARAMS_1(_cargo);
private ["_content_weight","_w1","_w2","_volume","_baseweight","_weight"];
_content_weight = {
PARAMS_2(_items,_type);
private ["_cargo_weight","_item"];
_cargo_weight = 0;
_item = _items select 0;
if (count _item > 0) then {
_count = _items select 1;
for "_i" from 0 to (count _item - 1) do {
_item_x = _item select _i;
_count_x = _count select _i;
_ItemWeight = switch _type do {
case "m": { 0.075 * getNumber(__CONF_MAGAZINES >> _item_x >> "mass") };
default { 0.075* getNumber(__CONF_WEAPONS >> _item_x >> "mass") };
};
_ItemWeight = _ItemWeight * _count_x;
_cargo_weight = _cargo_weight + _ItemWeight;
};
//_cargo_weight = _cargo_weight + _cargo_weight;
};
_cargo_weight;
};
_w1 = [getMagazineCargo _cargo, "m"] call _content_weight;
_w2 = [getWeaponCargo _cargo, "w"] call _content_weight;
#ifdef DEBUG_MODE_FULL
diag_log format["Weight of all weapons in box: %1",_w2];
diag_log format["Weight of all magazines in box: %1",_w1];
#endif
_volume = _cargo call FUNC(volume);
// Check if a weight value was defined and use this prior to calculated weight
_baseweight = if (isNumber(configFile >> "CfgVehicles" >> typeOf _cargo >> "mass")) then {
0.075 * getNumber(configFile >> "CfgVehicles" >> typeOf _cargo >> "mass");
} else {
(_volume * 0.5);
};
TRACE_1("W Weight",_baseweight);
_weight = _baseweight + _w1 + _w2;
_weight;
};
GVAR(busy) = {
_this getVariable [QGVAR(busy), false]
};
GVAR(BOXBusy) = {
PARAMS_2(_box,_busy);
_box setVariable [QGVAR(BOXBusy), _busy == 1, true];
};
FUNC(dragkeydown) = {
// Eventhandler to stop "C" key press while dragging
PARAMS_5(_control,_dikCode,_shift,_ctrl,_alt);
_dikCode_check = actionKeys "TactToggle" + actionKeys "stand" + actionKeys "prone" + actionkeys "crouch" + actionkeys "moveup" + actionkeys "movedown"; //stop standing up while dragging
(_dikCode in _dikCode_check)
};
FUNC(lbselchanged) = {
private ["_disp", "_ctrl","_ui"];
PARAMS_2(_data,_location);
_ui = if (_location == "back") then { "ACE_Cargo_List" } else { "ACE_CargoFront_List" };
_disp = uiNamespace getVariable _ui;
_ctrl = _disp displayCtrl 10;
if ((_data select 1) != -1) then {
if (!(ctrlEnabled _ctrl) && !(player in crew GVAR(vehicle) || player getVariable [QGVAR(carrying),false])) then {
_ctrl ctrlEnable true;
_ctrl ctrlCommit 0;
};
} else {
if (ctrlEnabled _ctrl) then {
_ctrl ctrlEnable false;
_ctrl ctrlCommit 0;
};
};
};
//FUNC(respawn) = {
// (findDisplay 46) displayRemoveEventHandler ["KeyDown", GVAR(drag_keyDownEHId)];
//};
//FUNC(standup) = {
// PARAMS_1(_unit);
// _unit addAction ["Stand up", QPATHTO_F(fnc_exec), _unit, 0, false, true, "", "local _target"];
//};
ADDON = true;

View File

@ -0,0 +1 @@
z\ace\addons\sys_cargo\box

View File

@ -0,0 +1,12 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {QUOTE(MAIN_ADDON)};
version = VERSION;
};
};

View File

@ -0,0 +1,79 @@
License (short)
===============
You are free:
- to Share — to copy, distribute and transmit the work
Under the following conditions:
- Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
- Noncommercial — You may not use this work for commercial purposes.
- No Derivative Works — You may not alter, transform, or build upon this work.
With the understanding that:
Waiver — Any of the above conditions can be waived if you get permission from the copyright holder.
Public Domain — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license.
Other Rights — In no way are any of the following rights affected by the license:
- Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations;
- The author's moral rights;
- Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.
Notice — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.
Full license text
=================
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
"Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership.
"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and,
to Distribute and Publicly Perform the Work including as incorporated in Collections.
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d).
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested.
You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
For the avoidance of doubt:
Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b).
Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.

View File

@ -0,0 +1,14 @@
#define COMPONENT sys_cargo_box
#define MAINCOMPONENT sys_cargo
#define SUBCOMPONENT box
#define ADDONS sys_cargo_box
#ifdef MAINCOMPONENT
#ifdef SUBCOMPONENT
#define PATHTO_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\MAINCOMPONENT\SUBCOMPONENT\##var3.sqf
#define PATHTOF_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\MAINCOMPONENT\SUBCOMPONENT\##var3
#define PATHTOF2_SYS(var1,var2,var3) MAINPREFIX\##var1\SUBPREFIX\MAINCOMPONENT\SUBCOMPONENT\##var3
#endif
#endif
#include "\z\ace\addons\main\script_mod.hpp"
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -0,0 +1,21 @@
#include "script_component.hpp"
#include "\z\ace\addons\main\script_config.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = { "ace_common", "ace_c_vehicle", "ace_c_weapon", "ace_sys_interaction" };
version = VERSION;
author[] = {"Rocko"};
};
};
PRELOAD_ADDONS;
#include "CfgVehicles.hpp"
#include "CfgEventHandlers.hpp"
#include "Dialog.hpp"
#include "CfgFunctions.hpp"

View File

@ -0,0 +1,27 @@
/*
Function: ACE_fnc_canLoadCargo
Description:
Checks if vehicle is able to load cargo
Parameters:
_vehicle - Vehicle to load cargo into. [Object]
Returns:
true if _vehicle is able to load cargo, otherwise false.
Example:
(begin example)
_result = [myTruck] call ACE_fnc_canLoadCargo;
(end)
Author:
Xeno
*/
#include "script_component.hpp"
PARAMS_1(_vehicle);
if (isNil "_vehicle" || {isNull _vehicle}) exitWith {false};
(getNumber(configFile >> "CfgVehicles" >> typeOf _vehicle >> "ACE_canBeLoad") == 1)

View File

@ -0,0 +1,153 @@
/* ace_sys_cargo | (c) 2010,2011 by rocko */
#include "script_component.hpp"
#define CARRYOFFSET 0.5
private["_unit","_action","_box","_pos2","_dir","_modelPos","_params","_track"];
if (dialog) then { closeDialog 0; };
if (count _this < 2) then {
_params = ["","","",["start", _this select 0]];
} else {
_params = _this;
};
// TODO: Check other interactions, entering a car while carrying something, ladders, dying
//["","",_action,["stop",_box]] spawn FUNC(carry)
_unit = player;
_action = (_params select 3) select 0;
_box = (_params select 3) select 1; // TODO: should be (_this select 0)
switch _action do {
case "start": {
// Monitor Roadway LOD occlusion
_track = true;
if (_unit getVariable [QGVAR(carrying),false] || {_unit getVariable [QGVAR(dragging),false]}) exitWith {
[localize "STR_ACE_CARGO_ERR_OCC",[1,0,0,1],true,0] spawn ace_fnc_visual;
};
if (_box getVariable [QGVAR(busy),false]) exitWith {
[localize "STR_ACE_CARGO_ERR_OCC",[1,0,0,1],true,0] spawn ace_fnc_visual;
};
if ((_unit distance _box) <= 2.5) then {
[objnull,_box,1,1] call FUNC(cbusy);
detach _box;
_safetyCarryOffset = _box getVariable [QGVAR(carryOffsetInc),0];
_offset = 0.6 + _safetyCarryOffset;
_box attachTo [_unit,[0,_offset,1]]; // Obs: Boxes that have a roadway lod, cause player flying into air. Need to make sure box clips into player to avoid this OR move box that far away so that roadway lod makes no contact with player (0.4 = clipping, 0.7 = outbound)
_unit setVariable [QGVAR(carrying), true, false];
_unit setVariable [QGVAR(carried_object),_box]; // TODO: Probably should be extended to all stuff we attachto player, so it becomes tracked
_box setDir (_dir - (getDir _unit));
_unit selectWeapon (primaryWeapon _unit);
_unit switchMove "amovpercmstpslowwrfldnon"; //"amovpercmstpslowwrfldnon_player_idlesteady03";
_weight = [_box] call FUNC(weight);
[_unit,_weight] call INC_MASS; // TODO: Get Weight
if (_weight > 13) then {
_unit forceWalk true;
};
// TODO: Move to config properties to automatically decide what to do with special items
//Ruckcratechek
if (_box isKindOf "ACE_Rucksack_crate") then {
_box setVectorDirAndUp [[-0.0204803,-0.585819,0.810183],[0.00794978,-0.810423,-0.585792]];
_track = false;
};
//Artyshell
if (_box isKindOf "ACE_Arty_ShellHolder") then {
_box setVariable ["ACE_ARTY_OWNER", _unit, true];
_unit setVariable ["ACE_ARTY_CARRY_SHELL", _box, false];
_box attachTo [_unit,[0.2,0.5,1.15]];
_track = false;
};
#define ACE_TEXT_RED(Text) ("<t color='#FF0000'>" + ##Text + "</t>")
// TODO: Use displayName of carriedObject if it has one....
_carry_action = _unit addAction[ACE_TEXT_RED((localize "STR_ACE_CARGO_CARRYRELASE")),QPATHTO_F(fnc_carry),["stop",_box],-100,false,false,"","_target == player"];
_unit setVariable [QGVAR(carrying_action_index),_carry_action];
//GVAR(drag_keyDownEHId) = (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call ace_sys_cargo_fnc_dragkeydown"]; // Add "C" key down eventhandler
_fired_i = _unit addEventHandler ["fired", {(_this select 0) setVariable ["ace_sys_cargo_forcedrop",true]}];
_getin_i = _unit addEventhandler ["getin",{(_this select 0) setVariable ["ace_sys_cargo_forcedrop",true];}];
_unit setVariable [QGVAR(carryFEH),_fired_i];
_unit setVariable [QGVAR(carryGIH),_getin_i];
_unit setVariable [QGVAR(forcedrop),false];
_box setVariable [QUOTE(GVARMAIN(attachedBy)), QUOTE(COMPONENT), true];
};
// Service Loop
while { _unit getVariable QGVAR(carrying) } do {
_bugflyHeight1 = ((getposasl _box) select 2); //diag_log format ["h1: %1",_bugflyHeight1];
sleep 0.25;
_bugflyHeight2 = ((getposasl _box) select 2); //diag_log format ["h2: %1",_bugflyHeight2];
_animdrop = !(weaponLowered player); // ["aidlpercmstpsraswrfldnon_idlesteady04","aidlpercmstpsraswrfldnon_aiming01","aidlpercmstpsraswrfldnon_idlesteady02","aidlpercmstpsraswrfldnon_idlesteady03","aidlpercmstpsraswrfldnon_idlesteady01","aidlpercmstpsraswrfldnon_aiming02"];
_standing = ((_unit call CBA_fnc_getUnitAnim) select 0) in ["stand"];
_forcedrop = _unit getVariable [QGVAR(forcedrop),false];
// DBG
//player sidechat format ["%1 %2 %3",_animdrop,_standing,_forcedrop];
if (!_standing || {_animdrop} || {_forcedrop}) then { ["","",0,["stop",_box]] spawn FUNC(carry) };
_bugflyRate = (_bugflyHeight2 - _bugflyHeight1) * 4;
//player globalchat format ["%1",_bugflyRate];
if (_track && {speed _unit == 0} && {_bugflyRate > 10}) then {
_curBoxOffset = _box getVariable [QGVAR(carryOffsetInc),0];
_newBoxOffset = _curBoxOffset + 0.2;
_box setVariable [QGVAR(carryOffsetInc),_newBoxOffset,true]; // Set new safety carrying offset to avoid further bugging
player setposATL [(getposATL player select 0), (getposATL player select 1), 0];
["","",0,["stop",_box]] spawn FUNC(carry);
};
sleep 0.25;
};
};
case "stop": {
if (local _unit) then { localize "STR_ACE_CARGO_DROPPED" call ace_fnc_visual; };
_box = (_this select 3) select 1;
_bldg = [_unit,0.1] call ACE_fnc_inBuilding;
_unit setVariable [QGVAR(carried_pos_end), getPosATL _unit, false];
_posZ = if (_bldg) then { ((_unit modelToWorld [0,0,0]) select 2) - 0.05 } else { (getPosATL _unit) select 2 };
_pos_end = _unit getVariable [QGVAR(carried_pos_end),(getPosATL _unit)];
_pos_end set [0,(_pos_end select 0)+(sin (direction _unit) * 1.4)];
_pos_end set [1,(_pos_end select 1)+(cos (direction _unit) * 1.4)];
_pos_end set [2,_posZ];
detach _box;
_box setPosATL _pos_end;
_unit setVariable [QGVAR(carried_pos_end), nil, false];
_unit removeaction (_unit getVariable QGVAR(carrying_action_index));
_unit setVariable [QGVAR(carrying), false, false];
[objnull,_box,0,0] call FUNC(cbusy);
// Ruckcratecheck
if (_box isKindOf "ACE_Rucksack_crate") then {
_box setVectorDirAndUp [[-0.0204803,-0.585819,0.810183],[0.00794978,-0.810423,-0.585792]];
};
//Artyshell
if (_box isKindOf "ACE_Arty_ShellHolder") then {
_box setVariable ["ACE_ARTY_OWNER", nil, true];
_unit setVariable ["ACE_ARTY_CARRY_SHELL", nil, false];
};
_unit forceWalk false;
_weight = [_box] call FUNC(weight);
[_unit,0] call INC_MASS; // TODO: Get Weight
// Remove "C" key down eventhandler
//(findDisplay 46) displayRemoveEventHandler ["KeyDown", GVAR(drag_keyDownEHId)];
_unit removeEventhandler ["fired",(_unit getVariable QGVAR(carryFEH))];
_unit removeEventhandler ["getin",(_unit getVariable QGVAR(carryGIH))];
_unit setVariable [QGVAR(carryFEH),-1];
_unit setVariable [QGVAR(carryGIH),-1];
_unit setVariable [QGVAR(forcedrop),false];
_box setVariable [QUOTE(GVARMAIN(attachedBy)), "", true];
};
};
false

View File

@ -0,0 +1,23 @@
/* ace_sys_cargo | (c) 2010,2011 by rocko */
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
private "_var";
PARAMS_3(_component,_unit,_type);
switch (_type) do {
case "CARRIER": {
if (_component getVariable [QGVAR(busy),false]) then {
[localize "STR_ACE_CARGO_ERR_OCC",[1,0,0,1],true,0] spawn ace_fnc_visual;
} else {
[_component,_unit,0,["front", "grab"]] execVM QPATHTO_C(ua_carry2.sqf);
};
};
case "HELPER": {
[_component,_unit,0,["back", "grab"]] execVM QPATHTO_C(ua_carry2.sqf);
};
};
false

View File

@ -0,0 +1,106 @@
/* ace_sys_cargo | (c) 2010,2011 by rocko */
#include "script_component.hpp"
private["_unit","_action","_box","_pos2","_dir","_modelPos","_drag_action","_params","_modelPosZ"];
if (dialog) then { closeDialog 0; };
if (count _this < 2) then {
_params = ["","","",["start", _this select 0]];
} else {
_params = _this;
};
_unit = player;
_action = (_params select 3) select 0;
_box = (_params select 3) select 1; // TODO: should be (_this select 0)
switch _action do {
case "start": {
if ({alive _x} count (crew _box) > 0) exitWith {};
//if (_box call CBA_fnc_locked) exitWith {};
if ((_unit distance _box) > 2.5) exitWith { [localize "STR_ACE_CARGO_ERR_NOWEP",[1,0,0,1],true,0] spawn ace_fnc_visual; };
if (_unit getVariable [QGVAR(carrying),false] || {_unit getVariable [QGVAR(dragging),false]}) exitWith {
[localize "STR_ACE_CARGO_ERR_OCC",[1,0,0,1],true,0] spawn ace_fnc_visual;
};
if (_box getVariable [QGVAR(busy),false]) exitWith {
[localize "STR_ACE_CARGO_ERR_OCC",[1,0,0,1],true,0] spawn ace_fnc_visual;
};
if ((_unit distance _box) <= 2.5) then {
[objnull,_box,1,1] call FUNC(cbusy);
detach _box;
_unit playActionNow "grabDrag";
_pos2 = getPosATL _box;
_dir = getDir _box;
_modelPos = _unit worldToModel _pos2; //is ATL format
if (_box isKindOf "StaticWeapon") then {
if (typeOf _box in ["ACE_M252","ACE_M224_1","ACE_2b14_82mm","ACE_120Tampella_Baseplate","ACE_120Tampella_Barrel"]) then { _modelPosZ = 0; } else { _modelPosZ = 0.8; };
} else { _modelPosZ = 0; };
//_modelPosZ = if (typeOf _box in ["ACE_M252","ACE_M224_1","ACE_2b14_82mm"]) then { 0 }; // Argh!!1: TODO: Fix ACE mortar axis
_box attachTo [_unit,[_modelPos select 0,_modelPos select 1,_modelPosZ],""];
_unit setVariable [QGVAR(dragging), true, false];
_unit setVariable [QGVAR(dragged_object),_box]; // TODO: Probably should be extended to all stuff we attachto player, so it becomes tracked
_box setDir (_dir - (getDir _unit));
//Ruckcratechek
if (_box isKindOf "ACE_Rucksack_crate") then {
_box setVectorDirAndUp [[-0.0204803,-0.585819,0.810183],[0.00794978,-0.810423,-0.585792]];
};
_box lock true;
#define ACE_TEXT_RED(Text) ("<t color='#FF0000'>" + ##Text + "</t>")
_drag_action = _unit addAction [ACE_TEXT_RED((localize "STR_ACE_CARGO_RELASE")),QPATHTO_F(fnc_drag),["stop",_box],-100,false,false,"","_target == player"];
GVAR(drag_keyDownEHId) = (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call ace_sys_cargo_fnc_dragkeydown"]; // Add "C" key down eventhandler
};
waitUntil { animationState _unit == "ACINPKNLMSTPSRASWRFLDNON" };
_weight = ([_box] call FUNC(weight)) * sin 45;
[_unit,_weight] call INC_MASS;
while { alive _unit && {_unit getVariable QGVAR(dragging)} } do {
sleep 0.5;
if !(animationState _unit in ["acinpknlmstpsraswrfldnon","acinpknlmwlksraswrfldb"]) exitWith {
_unit setVariable [QGVAR(dragging), false, false];
_unit setVariable [QGVAR(dragged_object),objNull];
_unit switchMove "ACINPKNLMSTPSRASWRFLDNON";
["","",_drag_action,["stop",_box]] spawn FUNC(drag);
};
};
};
case "stop": {
// Remove "C" key down eventhandler
(findDisplay 46) displayRemoveEventHandler ["KeyDown", GVAR(drag_keyDownEHId)];
// Dragging in building??
_bldg = [_unit,0.1] call ACE_fnc_inBuilding;
_box = (_this select 3) select 1;
_unit setVariable [QGVAR(dragged_pos_end), getPosATL _box, false];
_box lock false;
_unit playAction "released";
detach _box;
_posZ = if (_bldg) then { ((_unit modelToWorld [0,0,0]) select 2) - 0.05 } else { (getPosATL _unit) select 2 };
_pos_end = _unit getVariable QGVAR(dragged_pos_end);
_box setPosATL [_pos_end select 0, _pos_end select 1, _posZ];
_unit setVariable [QGVAR(dragged_pos_end), nil, false];
_unit removeaction (_this select 2);
_unit setVariable [QGVAR(dragging), false, false];
[objnull,_box,0,0] call FUNC(cbusy);
// Ruckcratecheck
if (_box isKindOf "ACE_Rucksack_crate") then {
_box setVectorDirAndUp [[-0.0204803,-0.585819,0.810183],[0.00794978,-0.810423,-0.585792]];
};
if (_box isKindOf "StaticWeapon") then {
//_box setVariable ["ace_sys_crewserved_pitch",0,true];
[_box] call ace_sys_crewserved_fnc_setPitch_stored; // Screwsup
};
[_unit,0] call INC_MASS;
};
};
false

View File

@ -0,0 +1,22 @@
/* ace_sys_cargo | (c) 2014 by rocko */
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
if (productVersion select 2 <= 110) exitWith {};
PARAMS_1(_vehicle);
_m = getMass _vehicle;
_com = getCenterOfMass _vehicle;
_currentcontent = _vehicle getVariable [QGVAR(content), []];
if (count _currentcontent > 0) then {
_vehicle setVariable [QGVAR(content), []];
_error = format["You cannot bypass the loading function for (%1) - ",_vehicle]; TRACE_1("Content hack detected","");
WARNING(_error);
};
_vehicle setVariable [QGVAR(mass),_m];
_vehicle setVariable [QGVAR(comass),_com];
_vehicle setVariable [QGVAR(ready),true];

View File

@ -0,0 +1,27 @@
/*
Function: ACE_fnc_listCargo
Description:
Lists cargo of a vehicle.
Parameters:
_vehicle - Vehicle to load cargo into. (Must exist) [Object]
Returns:
Array
Example:
(begin example)
["MyTruck"] call ACE_fnc_listCargo;
(end)
Author:
rocko
*/
#include "script_component.hpp"
PARAMS_1(_vehicle);
_currentcargo = _vehicle getVariable [QGVAR(content), []];
TRACE_1("",_currentcargo);
_currentcargo

View File

@ -0,0 +1,105 @@
/* ace_sys_cargo | (c) 2010,2011 by rocko */
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
private["_unit","_action","_box","_pos2","_dir","_modelPos","_drag_action","_params","_process"];
if (dialog) then { closeDialog 0; };
PARAMS_2(_cargo,_vehicle);
private "_dragnet";
// Fix, when a player is dragging an object dragging doesn't stop,
_dragnet = player getVariable [QGVAR(dragging), false];
if (_dragnet) exitWith {
(localize "STR_ACE_DRAGQUEENSTOP") spawn ace_fnc_visual;
};
// Box is in process?
if (_cargo getVariable [QGVAR(busy),false]) exitWith {
[localize "STR_ACE_CARGO_ERR_OCC",[1,0,0,1],true,0] spawn ace_fnc_visual;
};
// Mexican hidden in a box?
if ({alive _x} count (crew _cargo) > 0) exitWith { (localize "STR_ACE_CARGO_ERR_MEXICO") spawn ace_fnc_visual; };
// Store each cargo element loaded into vehicle
_currentcontent = _vehicle getVariable [QGVAR(content), []];
TRACE_1("Current content",_currentcontent);
// Weight managment
// Max capacity and weight limits for the vehicle
_volume_vehicle = [_vehicle] call FUNC(volume);
_size_vehicle = sizeOf (typeOf _vehicle);
_weight_vehicle = floor (_volume_vehicle * _size_vehicle * 4);
_weight_vehicle_maxload = floor (_weight_vehicle / 5);
_weight_vehicle_current = 0;
if (count _currentcontent > 0) then {
{
private ["_w"];
_w = [_x, 0] call FUNC(weight);
_weight_vehicle_current = _weight_vehicle_current + _w;
} foreach _currentcontent;
};
TRACE_5("V S W Wmax Wcur",_volume_vehicle, _size_vehicle, _weight_vehicle, _weight_vehicle_maxload, _weight_vehicle_current);
// Max capacity and weight limits for the cargo
_volume_cargo = [_cargo] call FUNC(volume);
_weight_cargo = [_cargo,0] call FUNC(weight);
TRACE_1("",_weight_cargo);
_loading_allowed = ((_weight_vehicle_maxload - _weight_vehicle_current) >= _weight_cargo);
TRACE_1("",_loading_allowed);
if !(_loading_allowed) exitWith { (localize "STR_ACE_CARGO_ERR_HEAVY") spawn ace_fnc_visual; };
//set busy state for vehicle
[_vehicle,_cargo,1,1] call FUNC(cbusy);
if (local player) then {
#ifndef DEBUG_MODE_FULL
#define __DELAY ((50/145) * _weight_cargo) // 50 seconds to load a 145kg heavy object alone
_potHelper = (position player) nearEntities ["CaManBase",5] - [player];
if (player in _potHelper) then { _potHelper = _potHelper - [player] };
_time = if (count _potHelper > 0) then { __DELAY / 2 } else { __DELAY };
player setVariable ["ACE_PB_Result", 0];
[_time,[localize "STR_ACE_CARGO_LOADING"],true,true] spawn ace_progressbar;
waitUntil { (player getVariable "ACE_PB_Result" != 0) };
_process = (player getVariable "ACE_PB_Result" == 1);
player setVariable ["ACE_PB_Result", 0];
#endif
#ifdef DEBUG_MODE_FULL
_process = true;
#endif
};
if (!_process) exitWith {
// Reset busy state for vehicle
[_vehicle,_cargo,0,0] call FUNC(cbusy);
};
// Load
_newcontent = _currentcontent;
_newcontent set [count _newcontent,_cargo];
TRACE_1("New content", _newcontent);
_vehicle setVariable [QGVAR(content), _newcontent, true]; // Add cargo variables
// Store loading position = unloading cargo will make the cargo appear at the same spot where it was when a player loaded it
// Relative to transporter
_cargo setVariable [QGVAR(Distance), (_cargo distance _vehicle), true];
// Hide _cargo
// Avoid cargo setPosing in water and accidentally killing it
_cargo_pos = getPosATL _cargo;
#ifndef DEBUG_MODE_FULL // TEST MODE TO CHECK WETHER LOADED OBJECTS ARE DELETED
detach _cargo;
//_cargo setPos [_cargo_pos select 0, _cargo_pos select 1, (_cargo_pos select 2) - 20];
// Put stuff to [0,0,0] no matter what
_cargo setPos [0,0,0];
#endif
// SetVariable
[_cargo,"set"] call FUNC(determineCargo); // Using "set", so data is only stored over net if object is loaded only
// Reset busy state for vehicle
[_vehicle,_cargo,0,0] call FUNC(cbusy);

View File

@ -0,0 +1,81 @@
/*
Function: ACE_fnc_loadCargo
Description:
Load cargo into vehicles.
Parameters:
_cargo - Cargo object to load. (Must exist) [Array of one or more objects]
_vehicle - Vehicle to load cargo into. (Must exist) [Object]
Returns:
nothing
Example:
(begin example)
[[myCrate1, myCrate2], myTruck] call ACE_fnc_loadCargo;
(end)
Author:
rocko
*/
#include "script_component.hpp"
PARAMS_2(_cargo,_vehicle);
private "_error";
{
_preloading_allowed = true;
if (isNull _x) then { _error = format["Cargo (%1) does not exist",_x]; _preloading_allowed = false; TRACE_1("Cargo isNull",""); };
if (isNil "_x") then { _error = format["Cargo (%1) does not exist",_x]; _preloading_allowed = false; TRACE_1("Cargo isNil",""); };
if (isNull _vehicle) then { _error = format["Vehicle (%1) does not exist",_vehicle]; _preloading_allowed = false; TRACE_1("Vehicle isNull",""); };
if (_x getVariable [QGVAR(busy),false]) then { _error = format["Cargo (%1) is busy",_x]; _preloading_allowed = false; TRACE_1("Cargo is busy",""); };
if ({alive _x} count (crew _x) > 0) then { _error = format["Cargo (%1) has crew",_x]; _preloading_allowed = false; TRACE_1("Cargo is occupied",""); };
TRACE_1("Current cargo processed",_x);
_currentcontent = _vehicle getVariable [QGVAR(content), []]; TRACE_1("Current content",_currentcontent);
_volume_vehicle = [_vehicle] call FUNC(volume);
_size_vehicle = sizeOf (typeOf _vehicle);
_weight_vehicle = floor (_volume_vehicle * _size_vehicle * 4);
_weight_vehicle_maxload = floor (_weight_vehicle / 5);
_weight_vehicle_current = 0;
if (count _currentcontent > 0) then {
{
private ["_w"];
_w = [_x] call FUNC(weight);
_weight_vehicle_current = _weight_vehicle_current + _w;
} foreach _currentcontent;
};
TRACE_5("VSWWmaxWcur",_volume_vehicle, _size_vehicle, _weight_vehicle, _weight_vehicle_maxload, _weight_vehicle_current);
_volume_cargo = [_x] call FUNC(volume); TRACE_1("",_volume_cargo);
_weight_cargo = [_x] call FUNC(weight); TRACE_1("",_weight_cargo);
_loading_allowed = ((_weight_vehicle_maxload - _weight_vehicle_current) >= _weight_cargo); TRACE_1("",_loading_allowed);
if (!_loading_allowed) then { _error = format["Weight/Volume of cargo (%1) exceeds allowed values for %2",_x,(typeOf _vehicle)]; };
if (_loading_allowed && {_preloading_allowed}) then {
_newcontent = _currentcontent;
_newcontent set [count _newcontent,_x]; TRACE_1("New content", _newcontent);
_vehicle setVariable [QGVAR(content), _newcontent, true]; // Add cargo variables
_cargo_pos = getPosATL _x;
detach _x;
// TODO: Test enableSimulation = false; on loaded object
//_x setPos [_cargo_pos select 0, _cargo_pos select 1, (_cargo_pos select 2) - 20]; TRACE_1("Setpos cargo item",(getPos _x));
// Put stuff to [0,0,0] no matter what
_x setPos [0,0,0];
//_x spawn { // Check if cargo item is below surface
// private "_cargo_item";
// _cargo_item = _this;
// sleep 5;
// if ((getPos _cargo_item select 2) > 0) then {
// TRACE_1("Item hiding below surface failed, setting to [0,0,0]","");
// _cargo_item setPos [0,0,0]; // TODO: allowdamage false while on "hiding pos"??
// };
//};
[_x,"set"] call FUNC(determineCargo);
} else {
WARNING(_error);
};
} foreach _cargo;

View File

@ -0,0 +1,206 @@
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
private ["_menuDef", "_target", "_params", "_menuName", "_menuRsc", "_menus"];
private ["_vehicle", "_displayNameVehicle","_exit","_nearestVehicle"];
private ["_canDrag","_canPush"];
private ["_weight"];
PARAMS_2(_target,_params);
_menuDef = [];
if (typeOf _target == "Weaponholder") exitWith { closeDialog 0; _menuDef };
// Needs to be fixed in CBA if possible, objects that inherit from any class used for interaction, but should not be able to interacted with,
// e.g class Weaponholder, which inherits from Reammobox!
_menuName = "";
_menuRsc = "popup";
if (typeName _params == typeName []) then {
if (count _params < 1) exitWith {diag_log format["Error: Invalid params: %1, %2", _this, __FILE__];};
_menuName = _params select 0;
_menuRsc = if (count _params > 1) then {_params select 1} else {_menuRsc};
} else {
_menuName = _params;
};
//-----------------------------------------------------------------------------
// TODO: Sort functions and scripts!
// Hacked
if (_target isKindOf "ACE_Arty_AimingStakes") exitWith {_menuDef};
// Only allow loading of ammoboxes atm. Later extend to different vehicles (small) or objects
_loadthing = (getNumber (configFile >> "CfgVehicles" >> typeOf _target >> "ACE_canBeLoad") == 1);
_gearthing = (getNumber (configFile >> "CfgVehicles" >> typeOf _target >> "ACE_canGear") == 1);
// Get exceptional vehicle that can only store gear parts (used in sys_eject - weaponcheck)
// This is used to allow players access the cargo space of non-sys_cargo vehicles!
if (_gearthing) then {
_loadthing = true;
};
_cargothing = getNumber (configFile >> "CfgVehicles" >> typeOf _target >> "ACE_canBeCargo") == 1;
_canBeCarried = getNumber (configFile >> "CfgVehicles" >> typeOf _target >> "ACE_canBeCarried") == 1;
_onSling = _target getVariable ["ace_sys_slingload_isLoaded",false];
TRACE_5("",_target,_loadthing,_cargothing,_gearthing,_canBeCarried);
if !(_loadthing || {_cargothing} || {_canBeCarried}) exitWith {_menuDef};
#define __TMW getNumber(configFile >> "CfgVehicles" >> typeOf _vehicle >> "transportMaxWeapons")
#define __TMM getNumber(configFile >> "CfgVehicles" >> typeOf _vehicle >> "transportMaxMagazines")
GVAR(target) = _target;
_displayNameCargo = getText (configFile >> "CfgVehicles" >> typeOf _target >> "displayNameShort");
if (_displayNameCargo == "") then {_displayNameCargo = typeOf _target};
_nearestVehicle = objNull;
if (isNull _target) then {objNull} else {
_ar = nearestObjects [_target, ["Car", "Ship", "Air","Tank"], 8];
_filter_ar = [_ar, {_x isKindOf "ACE_JerryCan"}] call BIS_fnc_conditionalSelect;
if (count _filter_ar > 0) then {
_ar = _ar - _filter_ar;
};
if (count _ar > 0) then { _nearestVehicle = _ar select 0 };
};
_nearestVehicleDistance = _target distance _nearestVehicle; // Loading distance. Should normally be relatively small
_vehicle = if (!isNull _nearestVehicle && {_nearestVehicleDistance < (2 + (_nearestVehicle call BIS_fnc_boundingCircle)/2)}) then {_nearestVehicle} else {objNull};
GVAR(vehicle) = _vehicle; // Set the cargo vehicle to the target, unless a different vehicle was found near
TRACE_2("TARGET & VEHICLE",_target,_vehicle);
_vehicleAvailable = !isNull _vehicle && {alive _vehicle};
if (_vehicleAvailable) then {
_displayNameVehicle = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
if (_displayNameVehicle == "") then {_displayNameVehicle = typeOf _vehicle};
TRACE_2("Found",GVAR(vehicle),_vehicleAvailable);
// Check if found vehicle has cargo capacity
if (getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "ACE_canBeLoad") != 1 || {(__TMW == 0 && {__TMM == 0})} || {_vehicle getVariable [QGVAR(busy),false]}) exitWith {
_vehicleAvailable = false;
TRACE_1("...Vehicle cannot transport anything","");
TRACE_1("...Vehicle has no cargo space","");
};
};
// Check wether player isInFront of vehicle or behind it.
_inFront = if !(isNull GVAR(vehicle)) then { [GVAR(vehicle),player,0.1] call ACE_fnc_inFront; } else { false };
_currentCargo = _target getVariable [QGVAR(content),[]];
_currentCargo_front = _target getVariable [QGVAR(content_front),[]];
_type = [_target,"check"] call FUNC(determineCargo);
private ["_canLoadFront","_frontLoadFree"];
if (!isNull GVAR(vehicle)) then {
_frontLoading = GVAR(vehicle) call FUNC(determineFrontCargo);
_canLoadFront = _frontLoading select 0;
_frontLoadFree = _frontLoading select 1;
} else {
_canLoadFront = false;
_frontLoadFree = false;
};
_isCarryingFrontLoadItem = false;
if (player getVariable [QGVAR(carrying),false]) then {
_frontCargoItem = player getVariable QGVAR(carried_object);
if (getNumber (configFile >> "CfgVehicles" >> typeOf _frontCargoItem >> "ACE_canLoadFront") == 1) then {
_isCarryingFrontLoadItem = true;
};
};
// Carry in pairs stuff
// ----------------------------------
_helperNear = false;
_helper = objNull;
if (_type in [4,5]) then {
_potHelper = (position player) nearEntities ["CaManBase",5] - [player];
if (player in _potHelper) then {
_potHelper = _potHelper - [player];
};
if (count _potHelper > 0) then {
_isPlayer = false;
{
if (isplayer _x) exitWith { _helperNear = true; _helper = _x; }; /// ADD "!" to 'isplayer check' if TESTING in SP !!!!!
} foreach _potHelper;
};
};
// Check if component has a front carrier, so the HELP XX CARRYING option comes alive
_canBeCarriedInPairs = (isNil {_target getVariable [QGVAR(carrier_front), nil]});
// Check if component has a back carrier
_hasCarrierBack = (!isNil {_target getVariable [QGVAR(carrier_back), nil]});
_hasCarrierFront = (!isNil {_target getVariable [QGVAR(carrier_front), nil]});
// Check if component is busy, i.e about to become loaded into something
_nameCarrierFront = if (_hasCarrierFront) then { name (_target getVariable QGVAR(carrier_front)) } else { "" };
TRACE_4("",_canBeCarriedInPairs,_hasCarrierBack,_hasCarrierFront,_nameCarrierFront);
GVAR(helper) = _helper; TRACE_1("",_helper);
_menus = [
[
["main", "", _menuRsc],
[
[format [localize "STR_ACE_CARGO_CARRY",_displayNameCargo], // Carry alone
{ [GVAR(target)] spawn FUNC(carry) },
"", "", "", -1,
//1, ({alive _x} count (crew _target) == 0) && {alive _target} && {_cargothing} && {_type == 1} && {!(_target getVariable [QGVAR(attached_front),false])} && {!(player getVariable [QGVAR(carrying),false])}],
1, _canBeCarried && {ACE_SELFINTERACTION_RESTRICTED} || {({alive _x} count (crew _target) == 0) && {alive _target} && {_cargothing} && {_type == 1} && {!(_target getVariable [QGVAR(attached_front),false])} && {!(player getVariable [QGVAR(carrying),false])} && {!_onSling} && {ACE_SELFINTERACTION_RESTRICTED}}],
[format [localize "STR_ACE_CARGO_CARRY2",_displayNameCargo], // Carry in pairs
{ [GVAR(target),player, "CARRIER"] spawn FUNC(carry2) },
"", "", "", -1,
_helperNear, _canBeCarriedInPairs && {alive _target} && {!_hasCarrierFront} && {_cargothing} && {_type in [2,4,5]} && {!(_target getVariable [QGVAR(attached_front),false])} && {!(player getVariable [QGVAR(carrying),false])} && {!_onSling} && {ACE_SELFINTERACTION_RESTRICTED}],
[format [localize "STR_ACE_CARGO_CARRY2_HELP",_nameCarrierFront], // Carry in pairs Help
{ [GVAR(target),player, "HELPER"] spawn FUNC(carry2) },
"", "", "", -1,
1, _hasCarrierFront && {!_hasCarrierBack} && {alive _target} && {_cargothing} && {_type in [4,5]} && {!(_target getVariable [QGVAR(attached_front),false])} && {!(player getVariable [QGVAR(carrying),false])} && {ACE_SELFINTERACTION_RESTRICTED}],
[localize "STR_ACE_CARGO_DRAG", // Drag
{ [GVAR(target)] spawn FUNC(drag) },
"", "", "", -1,
1, ({alive _x} count (crew _target) == 0) && {alive _target} && {_cargothing} && {(player == vehicle player)} && {_type in [2,5]} && {!_onSling} && {ACE_SELFINTERACTION_RESTRICTED}],
[format [localize "STR_ACE_CARGO_PUSH",_displayNameCargo], // Push
{ [GVAR(target)] spawn FUNC(push) },
"", "", "", -1,
1, alive _target && {_cargothing} && {_type == 3} && {!_onSling} && {ACE_SELFINTERACTION_RESTRICTED}],
[format[localize "STR_ACE_LOADCARGO", _displayNameVehicle], // Loading cargo is now only at the vehicles trunk!
{[GVAR(target),GVAR(vehicle)] spawn FUNC(load) },
"", "", "", -1,
GVAR(vehicle) != GVAR(target) && {_type in [1,2,4,5]}, _vehicleAvailable && {_cargothing} && {alive _target} && {!_inFront} && {!(player getVariable [QGVAR(carrying),false])} && {!_onSling} && {ACE_SELFINTERACTION_RESTRICTED}],
["Attach in front", //TODO: localize // Attaching stuff on the front of the vehicle (looks kool but maybe useless)
{[(player getVariable QGVAR(carried_object)),GVAR(vehicle)] spawn FUNC(attachToFront) },
"", "", "", -1,
GVAR(vehicle) != GVAR(target), _loadthing && {alive _target} && {_inFront} && {_canLoadFront} && {_isCarryingFrontLoadItem} && {_frontLoadFree} && {!_onSling} && {ACE_SELFINTERACTION_RESTRICTED}],
[localize "STR_ACE_SHOWCARGO", // Cargo access is now only at the vehicles trunk!
{ closeDialog 0; createDialog "ACE_Cargo_List" },
"", "", "", -1,
count _currentCargo > 0, alive _target && {_loadthing} && {getPos _target select 2 < 2} && {!_inFront} && {ACE_SELFINTERACTION_RESTRICTED}],
[localize "STR_ACE_SHOWCARGO", // Cargo access for items attached to vehicle front
{ closeDialog 0; createDialog "ACE_CargoFront_List" },
"", "", "", -1,
count _currentCargo_front > 0, alive _target && {_loadthing} && {getPos _target select 2 < 2} && {_inFront} && {ACE_SELFINTERACTION_RESTRICTED}]
]
]
];
//-----------------------------------------------------------------------------
{
if (_x select 0 select 0 == _menuName) exitWith {_menuDef = _x};
} forEach _menus;
if (count _menuDef == 0) then {
hintC format ["Error: Menu not found: %1\n%2\n%3", str _menuName, if (_menuName == "") then {_this} else {""}, __FILE__];
diag_log format ["Error: Menu not found: %1, %2, %3", str _menuName, _this, __FILE__];
};
_menuDef // return value

View File

@ -0,0 +1,11 @@
/* ace_sys_cargo | (c) 2010,2011 by rocko */
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
PARAMS_1(_location);
TRACE_1("Dialog open ... list",_location);
[_location] call FUNC(view);
false

View File

@ -0,0 +1,35 @@
/* ace_sys_cargo | (c) 2010,2011 by rocko */
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
PARAMS_1(_target);
_volume = [_target] call FUNC(volume);
_weight = [_target,_volume] call FUNC(weight);
_push_direction = getDir player;
_acceleration = 0.02 * _weight;
_vel = velocity _target;
_pos = getPos _target;
TRACE_5("",_volume,_weight,_push_direction,_acceleration,_vel);
_new_vel = [(_vel select 0)+(sin _push_direction*_acceleration),(_vel select 1)+(cos _push_direction*_acceleration),_vel select 2];
TRACE_1("",_new_vel);
if (_target isKindOf "Static") then {
_new_pos = [(_pos select 0)+(sin _push_direction*(_acceleration/2)),(_pos select 1)+(cos _push_direction*(_acceleration/2)),_pos select 2];
_target setPos _new_pos;
_target setPosATL _new_pos;
} else {
[QGVAR(setvel), [_target,_new_vel]] call ACE_fnc_receiverOnlyEvent;
};
_target spawn {
_target = _this;
sleep 4;
[QGVAR(setvel), [_target,[0,0,0]]] call ACE_fnc_receiverOnlyEvent;
//_pos = getPos _target;
//_target setPos _pos;
};

View File

@ -0,0 +1,85 @@
/* ace_sys_cargo | (c) 2010,2011 by rocko */
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
PARAMS_2(_vehicle,_location);
private ["_disp", "_ctrl", "_index", "_currentcontent", "_vehicle", "_cargo", "_newcontent", "_hasPlaceholder", "_placeholder", "_pos","_ui","_dir"];
_ui = if (_location == "back") then {"ACE_Cargo_List"} else {"ACE_CargoFront_List"};
_disp = uiNamespace getVariable _ui;
_ctrl = _disp displayCtrl 99;
_index = lbCurSel _ctrl;
if (_index < 0) exitWith { if (dialog) then { closeDialog 0; }; };
if (dialog) then {closeDialog 0};
// Remove cargo item
_currentcontent = if (_location == "back") then { _vehicle getVariable [QGVAR(content), []] } else { _vehicle getVariable [QGVAR(content_front), []] };
if (isNil "_currentcontent") exitWith {};
_cargo = _currentcontent select _index; TRACE_1("Unloading _cargo",_cargo);
if (_cargo in _currentcontent) then {
_newcontent = _currentcontent - [_cargo];
if (_location == "back") then {
TRACE_1("Unloading cargo from trunk","");
_vehicle setVariable [QGVAR(content), _newcontent, true]; // Add cargo variables
} else {
TRACE_1("Unloading cargo from front","");
_vehicle setVariable [QGVAR(content_front), _newcontent, true]; // Add cargo variables
[_cargo] call FUNC(detachFront);
};
if (count _newcontent < 1) then {
_hasPlaceholder = _vehicle getVariable [QGVAR(hasPlaceholder), false];
if (_hasPlaceholder) then {
_vehicle setVariable [QGVAR(hasPlaceholder), false, true]; // Reset placeholder variable
_placeholder = _vehicle getVariable QGVAR(POB);
detach _placeholder;
deleteVehicle _placeholder;
};
};
_at_player = _cargo getVariable [QGVAR(atplayer),false];
_distance = if (_at_player) then { 1.5 } else { _cargo getVariable [QGVAR(Distance),4]; };
if (_location == "back") then {
_dir = if (_at_player) then { getDir player + 180 } else { getDir _vehicle - 180 + (random 20) - (random 20); };
} else {
_dir = if (_at_player) then { getDir player + 180 } else { getDir _vehicle + (random 20) - (random 20); };
};
_posV = if (_at_player) then { getPosATL player; } else { getPosATL _vehicle; };
_unloadPos = [(_posV select 0) + ((sin _dir) * _distance), (_posV select 1) + ((cos _dir) * _distance),_posV select 2];
// TODO: Move to config properties to automatically decide what to do with special items
// Ruckcrate check
if (_cargo isKindOf "ACE_Rucksack_crate") then {
_cargo setVectorDirAndUp [[-0.0204803,-0.585819,0.810183],[0.00794978,-0.810423,-0.585792]];
_cargo_owner = _cargo getVariable "ACE_SYS_CARGO_OWNER";
if (_cargo_owner == name player) then {
_backpack = toArray(typeOf _cargo);
for "_x" from ((count _backpack) - 6) to ((count _backpack) - 1) do {
_backpack set [_x, nil];
};
_backpack = toString(_backpack);
[_cargo,player,nil,_backpack] execVM "\z\ace\addons\sys_ruck\act_TakeRuck.sqf";
};
};
if (_cargo isKindOf "StaticWeapon") then {
_cargo setVariable ["ace_sys_crewserved_pitch",0,true];
};
if ([_cargo,""] call FUNC(determineCargo) == 1) then {
if !(player getVariable [QGVAR(carrying),false]) then {
[_cargo] spawn FUNC(carry);
};
};
if (surfaceIsWater _unloadPos) then {
_unloadPos set [2, (getPosASL player select 2)];
_cargo setposASL _unloadPos;
} else {
_cargo setpos _unloadPos;
};
player reveal _cargo;
};
[_vehicle,objnull,0,0] call FUNC(cbusy);

View File

@ -0,0 +1,46 @@
/*
Function: ACE_fnc_unloadCargo
Description:
Unloads cargo from a vehicle.
Parameters:
_cargo - Cargo object to load. (Must exist) [Array of one or more objects]
_vehicle - Vehicle to load cargo into. (Must exist) [Object]
Returns:
nothing
Example:
(begin example)
[[myCrate1, myCrate2], myTruck] call ACE_fnc_unloadCargo;
(end)
Author:
rocko
*/
#include "script_component.hpp"
PARAMS_2(_cargo,_vehicle);
private ["_index", "_currentcontent", "_vehicle", "_cargo", "_newcontent", "_hasPlaceholder", "_placeholder", "_pos"];
_currentcontent = _vehicle getVariable QGVAR(content);
if (isNil "_currentcontent") exitWith {};
{
if (_x in _currentcontent) then {
_newcontent = _currentcontent - [_x];
_vehicle setVariable [QGVAR(content), _newcontent, true]; // Add cargo variables
_dir = getDir _vehicle - 180 + (random 20) - (random 20);
_posV = getPosATL _vehicle;
_unloadPos = [(_posV select 0) + ((sin _dir) * 4), (_posV select 1) + ((cos _dir) * 4),_posV select 2];
_x setpos _unloadPos;
if (_x isKindOf "ACE_Rucksack_crate") then {
_x setVectorDirAndUp [[-0.0204803,-0.585819,0.810183],[0.00794978,-0.810423,-0.585792]];
};
if (_x isKindOf "StaticWeapon") then {
_x setVariable ["ace_sys_crewserved_pitch",0,true];
};
};
} foreach _cargo;
[_vehicle,objnull,0,0] call FUNC(cbusy);

View File

@ -0,0 +1,65 @@
/* ace_sys_cargo | (c) 2010,2011 by rocko */
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
private ["_disp", "_ctrl", "_currentcargo", "_item", "_typei", "_name", "_pic", "_dummy", "_weight", "_text", "_index","_ui"];
PARAMS_1(_location);
// Prevent viewing of dialog if vehicle is already accessed by other player // TODO: Better not show in interaction menu
if (GVAR(target) getVariable [QGVAR(busy),false]) exitWith {
[] spawn {
sleep 0.1;
if (dialog) then { closeDialog 0 };
[localize "STR_ACE_CARGO_ERR_OCC",[1,0,0,1],true,0] spawn ace_fnc_visual;
};
};
_ui = if (_location == "back") then {"ACE_Cargo_List"} else {"ACE_CargoFront_List"};
_disp = uiNamespace getVariable _ui;
_ctrl = _disp displayCtrl 99;
_tit = _disp displayCtrl 30;
// Set vehicle busy to prevent multi unloading
[GVAR(target),objnull,1,1] call FUNC(cbusy);
_currentcargo = if (_location == "back") then { GVAR(target) getVariable [QGVAR(content), []] } else { GVAR(target) getVariable [QGVAR(content_front), []] };
lbClear _ctrl;
if (count _currentcargo > 0) then {
_dn = getText(configFile >> "CfgVehicles" >> typeOf GVAR(target) >> "displayName");
_tit ctrlSetText format[localize "STR_DIAG_ACE_CARGO_TITLE",_dn];
for "_x" from 0 to (count _currentcargo) - 1 do {
_item = _currentcargo select _x;
_typei = typeOf _item;
_name = _item getVariable "ace_sys_cargo_name";
if (isNil "_name") then {
_name = getText(configFile >> "CfgVehicles" >> _typei >> "displayName");
};
_pic = getText (configFile >> "cfgVehicles" >> _typei >> "icon");
if (_pic == "" || {_pic == "iconThing"}) then {
_pic = "\ca\data\data\Unknown_object.paa";
};
_weight = [_item,1] call FUNC(weight);
// Disable low weight stuff
_text = if (_weight <= 5) then {
_name
} else {
format["%1 %2 kg", _name, round _weight]
};
_index = _ctrl lbAdd _text;
_ctrl lbSetPicture [_index, _pic];
};
_ctrl lbSetCurSel 0;
};
if (player in crew GVAR(vehicle) || {count _currentcargo == 0} || {player getVariable [QGVAR(carrying),false]}) then { (_disp displayCtrl 10) ctrlEnable false; _disp displayCtrl 10 ctrlCommit 0; }; // Cannot unload from inside
[] spawn {
while {dialog} do {
sleep 0.1;
};
[GVAR(target),objnull,0,0] call FUNC(cbusy);
};

View File

@ -0,0 +1,79 @@
License (short)
===============
You are free:
- to Share — to copy, distribute and transmit the work
Under the following conditions:
- Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
- Noncommercial — You may not use this work for commercial purposes.
- No Derivative Works — You may not alter, transform, or build upon this work.
With the understanding that:
Waiver — Any of the above conditions can be waived if you get permission from the copyright holder.
Public Domain — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license.
Other Rights — In no way are any of the following rights affected by the license:
- Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations;
- The author's moral rights;
- Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.
Notice — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.
Full license text
=================
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
"Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership.
"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and,
to Distribute and Publicly Perform the Work including as incorporated in Collections.
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d).
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested.
You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
For the avoidance of doubt:
Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b).
Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.

View File

@ -0,0 +1,29 @@
#define COMPONENT sys_cargo
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_sys_cargo
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_sys_cargo
#define DEBUG_SETTINGS DEBUG_SETTINGS_sys_cargo
#endif
#include "\z\ace\addons\main\script_macros.hpp"
// #define JERRYCAN_M ACE_JerryCan_M_15
#define JERRYCAN_W ACE_JerryCan_Dummy_15
#define JERRYCAN_V ACE_JerryCan_15
#define SPARETYRE_W ACE_Spare_Tyre_Dummy
#define SPARETYRE_V ACE_Spare_Tyre
#define __MAXCARRYVOLUME 0.7
#define __MAXCARRYWEIGHT 30 //20
#define __MAXCARRYWEIGHTBY2 145 //200
#define __MAXDRAGVOLUME 1.5
#define __MAXDRAGWEIGHT 80 //100
#define __MAXPUSHVOLUME 3.2
#define __MAXPUSHWEIGHT 120
#define __MAXLOADVOLUME 1.7 //ccm
#define __MAXLOADWEIGHT 200

View File

@ -0,0 +1 @@
z\ace\addons\sys_cargo\slingload

View File

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

View File

@ -0,0 +1,27 @@
#define __MASS 0.94
class CfgMagazines {
class CA_Magazine;
class ACE_Rope_MRL: CA_Magazine { // Base
scope = 1;
displayName = $STR_DN_ACE_ROPE_MRL;
picture = QPATHTO_T(data\equip\m_rope_ca.paa);
model = QPATHTO_M(m_ace_rope.p3d);
type = "3 * 256";
ammo = "FakeAmmo";
count = 1;
initSpeed = 0;
maxLeadSpeed = 0;
nameSound = "mine";
ACE_Weight = 2; // Diameter: 40 mm , Weight: 94 kg / 100 m
ACE_Size = 400;
ACE_NoPack = 1; // Not packable
ACE_SlingRope = 1;
descriptionShort = "";
};
class ACE_Rope_M5: ACE_Rope_MRL {
scope = 2;
displayName = $STR_DN_ACE_ROPE_M5;
ACE_Size = 64;
ACE_Weight = 14.3256;
};
};

View File

@ -0,0 +1,101 @@
class CfgVehicles {
class Thing;
class ACE_Slingrope_L: Thing {
scope = 1;
animated = 0;
displayName = "";
model=QPATHTO_M(ace_slingrope_L.p3d);
destructype = "Destructno";
cost = 0;
armor = 999999;
ace_slingrope=1;
XEH_DISABLED;
};
class ACE_Slingrope_M: ACE_Slingrope_L {
model=QPATHTO_M(ace_slingrope_M.p3d);
ace_slingrope=1;
};
class ACE_Slingrope_P: ACE_Slingrope_L {
model=QPATHTO_M(ace_slingrope_P.p3d);
ace_slingrope=1;
};
class ACE_Slingrope: ACE_Slingrope_L {
model=QPATHTO_M(ace_slingrope.p3d);
ace_slingrope=1;
};
// GeoLifter points
// Max Load
// Vehicle Weight
// TODO: Correct values
class Air;
class Helicopter: Air { ACE_canLift = 0; };
class Plane: Air { ACE_canLift = 0; };
/*class UH60_Base;
class MH60S: UH60_Base {
ACE_canLift = 1;
ACE_GeoLifterAttachment[] = {{0,1.54,-5.1}};
ACE_MaxLoad = 5886;
ACE_Weight = 5224;
};
class UH60M_US_base_EP1;
class UH60M_EP1: UH60M_US_base_EP1 {
ACE_canLift = 1;
ACE_GeoLifterAttachment[] = {{0,1.25,-5.25}};
ACE_MaxLoad = 5886;
ACE_Weight = 5224;
};
class UH1_Base: Helicopter {
ACE_canLift = 1;
ACE_GeoLifterAttachment[] = {{0,-4.3,-4.9}};
ACE_MaxLoad = 3000;
ACE_Weight = 5370;
};
class UH1H_Base: Helicopter {
ACE_canLift = 1;
ACE_GeoLifterAttachment[] = {{0,1.2,-4.8}};
ACE_MaxLoad = 3000;
ACE_Weight = 5370;
};
class MV22: Plane {
ACE_canLift = 1;
ACE_GeoLifterAttachment[] = {{0,0,-5.9}};
ACE_MaxLoad = 6800;
ACE_Weight = 15000;
};
class Mi24_Base: Helicopter {
ACE_canLift = 1;
ACE_GeoLifterAttachment[] = {{-0.1,2.5,-5.2}};
ACE_MaxLoad = 2600;
ACE_Weight = 11000;
};
class Mi17_base: Helicopter {
ACE_canLift = 1;
ACE_GeoLifterAttachment[] = {{0,1.9,-5.5}};
ACE_MaxLoad = 5900;
ACE_Weight = 7100;
};
class CH47_base_EP1: Helicopter {
ACE_canLift = 1;
ACE_GeoLifterAttachment[] = {{0,0,-5.6}};
ACE_MaxLoad = 10000;
ACE_Weight = 12000;
};
class AH6_Base_EP1;
class MH6J_EP1: AH6_Base_EP1 {
ACE_canLift = 0;
ACE_GeoLifterAttachment[] = {{0,-0.8,0.5}};
ACE_MaxLoad = 1000;
ACE_Weight = 3370;
};
/// BAFF
class BAF_Merlin_HC3_D: Helicopter {
ACE_canLift = 1;
ACE_GeoLifterAttachment[] = {{0.2,2.5,-4.9}};
ACE_MaxLoad = 6000;
ACE_Weight = 11000;
};*/
};

View File

@ -0,0 +1,11 @@
class CfgWeapons {
class Default;
class Put: Default {
class ACE_Dummy_Utility;
class ace_sys_ravlifter: ACE_Dummy_Utility {
magazines[] = {
"ACE_Rope_MRL","ACE_Rope_M5"
};
};
};
};

View File

@ -0,0 +1,13 @@
#include "script_component.hpp"
ADDON = false;
LOG(MSG_INIT);
PREP(addAction);
[QGVAR(wh), {player reveal _this}] call CBA_fnc_addEventHandler;
[QGVAR(action), {_this call FUNC(addaction)}] call CBA_fnc_addEventhandler;
[["LandVehicle","Air","Boat","Thing","StaticWeapon","Reammobox"], [ace_sys_interaction_key], 6, [QPATHTO_F(fnc_menuDef), "main"]] call CBA_ui_fnc_add;
ADDON = true;

View File

@ -0,0 +1,12 @@
#include "script_component.hpp"
ADDON = false;
LOG(MSG_INIT);
PREP(hasropemag);
PREP(attachSlingRopeToHelicopter);
PREP(attachSlingRopeToCargo);
PREP(detachSlingRopeFromCargo);
ADDON = true;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,37 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[]= {
"ACE_Slingrope_L",
"ACE_Slingrope_M",
"ACE_Slingrope_P",
"ACE_Slingrope"
};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {
"ace_common","ace_c_weapon", "ace_sys_interaction"
};
version = VERSION;
author[] = {"Rocko"};
};
// Backwards
class ace_sys_ravlifter {
units[]= {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {QUOTE(MAIN_ADDON)};
version = VERSION;
};
};
PRELOAD_ADDONS;
#include "CfgVehicles.hpp"
#include "CfgEventhandlers.hpp"
#include "CfgMagazines.hpp"
#include "CfgWeapons.hpp"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,14 @@
#include "script_component.hpp"
#define ACE_TEXT_RED(Text) ("<t color='#FF0000'>" + ##Text + "</t>")
private ["_helicopter", "_currentAction"];
_helicopter = _this;
_currentAction = _helicopter getVariable [QGVAR(cutAction), -1];
// Prevent double action
if (_currentAction != -1) then { _helicopter removeAction _currentAction };
_action_cut = _helicopter addaction [ACE_TEXT_RED(localize "STR_UA_ACE_RELEASESLING"), QPATHTO_F(ua_release_cargo),_helicopter,99,true,true,"","(driver _target) in _target"]; // err, driver target should always be in target :P
_helicopter setVariable [QGVAR(cutAction), _action_cut];

View File

@ -0,0 +1,23 @@
#include "script_component.hpp"
PARAMS_1(_cargo);
if (GVAR(disabled)) exitWith {
_cargo spawn {
private "_magHolder";
sleep 2;
_magHolder = "WeaponHolder" createVehicle [0,0,0];
_magholder addMagazineCargoGlobal ["ACE_Rope_M5", 1];
[QGVAR(wh), _magHolder] call CBA_fnc_globalEvent;
_magHolder setPos [((position _this) select 0) + 2, ((position _this) select 1) + 2, 0];
};
};
player playmove "AinvPknlMstpSlayWrflDnon_medic";
sleep 5;
player removeMagazine "ACE_Rope_M5";
_cargo setVariable [QGVAR(hasSlingRope), true, true];
// TODO: Process
// TODO: Visual attached sling rope to cargo, to indicate something is prepared.

View File

@ -0,0 +1,116 @@
#include "script_component.hpp"
PARAMS_2(_cargo,_helicopter);
//TODO: Check if helicopter is already filled with cargo aka soldiers, if so, make sling rope break if speed > 50
// Cargo becomes damaged and slingrope unuseable
// TODO: Cargo limits
// TODO: Move to process.sqf ?
_crew = crew _helicopter;
_passengers = [];
{
if ((assignedVehicleRole _x) select 0 == "CARGO") then {
_passengers set [count _passengers, _x];
};
} foreach _crew;
//_passenger_weight = 80 * count _passengers;
private["_cable","_pp","_reduction","_rel","_slingrope_type"];
_bboxHelicopter = boundingBox _helicopter;
_bh = abs((_bboxHelicopter select 0) select 2) + (abs((_bboxHelicopter select 1) select 2) * 1.2);
_lh = abs((_bboxHelicopter select 0) select 0) + abs((_bboxHelicopter select 1) select 0);
_hh = abs((_bboxHelicopter select 0) select 1) + abs((_bboxHelicopter select 1) select 1);
_volumeH = _lh * _bh * _hh;
_bboxCargo = boundingBox _cargo;
_bc = abs((_bboxCargo select 0) select 0) + abs((_bboxCargo select 1) select 0);
_lc = abs((_bboxCargo select 0) select 1) + abs((_bboxCargo select 1) select 1);
_hc = abs((_bboxCargo select 0) select 2) + abs((_bboxCargo select 1) select 2);
_volumeC = _lc * _bc * _hc;
_tope = 16;
_abort = false;
// Find the correct sling rope model
if (_volumeC > 0.001) then {
_rel = _volumeH / _volumeC;
if (_rel >= _tope) then {
_slingrope_type = switch (true) do {
case(_volumeC < 150): {1};
case (_volumeC < 200): {2};
default {2};
};
if (_rel < 20) then {
_slingrope_type = 1;
_volumeC = (_lc * 100) / _bc;
if (_volumeC > 100) then {_volumeC = _volumeC - 100};
if (_volumeC > 20) then {_slingrope_type = 2};
};
} else { _slingrope_type = 2; };
};
if (_abort) exitWith {
_msg1 = "An error occured with the slingload feature.";
hint _msg1;
#ifdef DEBUG_MODE_FULL
_msg2 = format ["H: %1 C: %2", typeOf _helicopter, typeOf _cargo];
LOG(_msg1); LOG(_msg2);
#endif
};
// Execute the lift
_Obx = 0;
_Oby = 0;
_Obz = 0;
_dist = -(_helicopter distance _cargo);
_cargo attachTo [_helicopter, [0,0, _dist + 0]];
_dir = direction _cargo - direction _helicopter;
if ("Air" counttype [_cargo] > 0) then { _dir = 0; };
if ("Ship" counttype [_cargo] > 0) then { _dir = 0; };
if ("Landvehicle" counttype [_cargo] > 0) then { _dir = 0;_slingrope_type = 1; };
if ("Motorcycle" counttype [_cargo] > 0) then { _slingrope_type = 1; };
_center = getArray(configFile >> "CfgVehicles" >> typeOf _helicopter >> "ACE_GeoLifterAttachment") select 0;
_cx = _center select 0;
_cy = _center select 1;
_cz = _center select 2;
switch (_slingrope_type) do {
case 1: {
_cable = "ACE_Slingrope_L" createvehicle [0,0,0];
_cable attachto [_helicopter, [_cx + 0.02,_cy - 0.1,_cz + 0.4]];
_helicopter setvariable [QGVAR(slingrope), _cable,true];
_pp = _cable selectionposition "Anclaje";
_cargo attachto [_cable, [_pp select 0, _pp select 1, _pp select 2]];
_cargo attachto [_cable, [_Obx+(_pp select 0), _Oby+(_pp select 1), _Obz+(_pp select 2)]];
_cargo setdir _dir; _cargo setpos getpos _cargo;
_reduction = 1.0025;
};
case 2: {
_cable = "ACE_Slingrope_M" createvehicle [0,0,0];
_cable attachto [_helicopter, [_cx,_cy,_cz]];
_helicopter setvariable [QGVAR(slingrope),_cable,true];
_pp = _cable selectionposition "Anclaje";
_cargo attachto [_cable, [_Obx+(_pp select 0), _Oby+(_pp select 1), _Obz+(_pp select 2) + 0.5]];
_cargo setdir _dir; _cargo setpos getpos _cargo;
_reduction = 1.0050;
};
};
// Set variables
_helicopter setVariable [QGVAR(isTransporting),true,true];
_helicopter setVariable [QGVAR(cargoHeight),(_cargo modeltoworld [0,0,0]) select 2,true];
_helicopter setVariable [QGVAR(cargo),_cargo,true];
// Visual for helicopter
localize "STR_UA_ACE_CARGOHELIHOOKED" spawn ace_fnc_visual;
[_helicopter, _reduction, _cargo] spawn COMPILE_FILE(process); // Main process loop // TODO: Evaluate some more events for this
// Add CUT action for driver of helicopter
[QGVAR(action), _helicopter] call CBA_fnc_globalEvent;

View File

@ -0,0 +1,8 @@
#include "script_component.hpp"
PARAMS_1(_cargo);
player playmove "AinvPknlMstpSlayWrflDnon_medic";
sleep 5;
player addMagazine "ACE_Rope_M5";
_cargo setVariable [QGVAR(hasSlingRope), false, true];

View File

@ -0,0 +1,9 @@
private ["_r"];
#include "script_component.hpp"
_r = "";
{
if (getNumber(configFile >> "CfgMagazines" >> _x >> "ACE_SlingRope") == 1) exitWith {_r = _x};
} forEach magazines player;
_r

View File

@ -0,0 +1,117 @@
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
private ["_menuDef", "_target", "_params", "_menuName", "_menuRsc", "_menus"];
PARAMS_2(_target,_params);
if (isNil "_target") exitWith {};
if (isNull _target) exitWith {};
if (typeOf _target == "Weaponholder") exitWith { closeDialog 0 };
// Needs to be fixed in CBA if possible, objects that inherit from any class used for interaction, but should not be able to interacted with,
// e.g class Weaponholder, which inherits from Reammobox!
_menuName = "";
_menuRsc = "popup";
if (typeName _params == typeName []) then {
if (count _params < 1) exitWith {diag_log format["Error: Invalid params: %1, %2", _this, __FILE__];};
_menuName = _params select 0;
_menuRsc = if (count _params > 1) then {_params select 1} else {_menuRsc};
} else {
_menuName = _params;
};
//-----------------------------------------------------------------------------
#define __ADD_SLING (localize "STR_UA_ACE_ATTACHROPECARGO")
#define __REM_SLING (localize "STR_UA_ACE_DETACHROPECARGO")
#define __ADD_SLING_HELI (localize "STR_UA_ACE_ATTACHROPECARGOHELI")
_displayNameCargo = getText (configFile >> "CfgVehicles" >> typeOf _target >> "displayName");
if (_displayNameCargo == "") then { _displayNameCargo = typeOf _target; };
if (_target isKindOf "StaticShip") then {_target = objNull}; // disable LHD, which is a "building"/"strategic"/"StaticShip"
if (isNull _target) exitWith {};
_cargoHasSlingRope = _target getVariable [QGVAR(hasSlingRope), false];
_cargoIsLoaded = _target getVariable [QGVAR(isLoaded), false];
_cargoIsEmpty = ({alive _x} count crew _target == 0);
_cargoIsAttachedToSomethingElse = (_target getVariable ["ace_puller_attached",false]); // || _cargo getVariable ["",false]) // TODO: sys_maintenance_towing // TODO: set a more global var then system specific
_playerHasSlingRope = ("ACE_Rope_M5" in magazines player);
_playerInCargo = vehicle player != player && {player in (vehicle _target)};
TRACE_5("",_cargoHasSlingRope,_cargoIsLoaded,_cargoIsEmpty,_playerHasSlingRope,_playerInCargo);
private["_helicopter"];
_nearestHelicopter = if (isNull _target) then {objNull} else {nearestObject [_target, "Helicopter"]};
_nearestHelicopterDist = _target distance _nearestHelicopter;
_helicopter = if (!(isNull _nearestHelicopter) && {isEngineOn _nearestHelicopter} && {_nearestHelicopterDist < 11}) then { _nearestHelicopter; } else { objNull; }; // If helicopter is flying and distance to cargo < minDist
// TODO: Might get fuzzy with the fucking LHD crap carrier
_helicopterAvailable = (alive _helicopter && {!isNull _helicopter});
TRACE_1("",_helicopterAvailable);
_displayNameHelicopter = "";
_helicopterCanLift = false;
_helicopterIsTransporting = true; // true, Failsafe #1
if (_helicopterAvailable) then {
_displayNameHelicopter = getText (configFile >> "CfgVehicles" >> typeOf _helicopter >> "displayName");
if (_displayNameHelicopter == "") then { _displayNameHelicopter = typeOf _helicopter; };
_helicopterIsTransporting = _helicopter getVariable [QGVAR(isTransporting), false];
_helicopterCanLift = (getNumber(configFile >> "CfgVehicles" >> typeOf _helicopter >> "ACE_canLift") == 1);
TRACE_1("",_displayNameHelicopter);
TRACE_1("",_helicopterIsTransporting);
TRACE_1("",_helicopterCanLift);
};
_disable = _helicopter getVariable [QUOTE(ACE_Slingload_Rule),[]];
if (typeOf _target in _disable) exitWith {
(localize "STR_DN_ACE_HOOKERBLOCKAGE") spawn ACE_fnc_visual;
};
_weight = getNumber(configFile >> "CfgVehicles" >> typeOf _helicopter >> "ACE_MaxLoad") > _target call ace_sys_cargo_fnc_weight; // TODO: Alternative mass and/or ACE_Weight
GVAR(targets) = [_target,_helicopter];
// Attach sling rope to x
_menus =
[
[
["main", _displayNameCargo, _menuRsc],
[
// Attach sling rope to cargo
[__ADD_SLING,
{ [(GVAR(targets) select 0)] spawn FUNC(attachSlingRopeToCargo) },
"", "", "", DIK_N, 1, alive _target && {!_cargoHasSlingRope} && {_playerHasSlingRope} && {!_playerInCargo} && {ACE_SELFINTERACTION_RESTRICTED}],
// Detach sling rope from cargo
[__REM_SLING,
{ [(GVAR(targets) select 0)] spawn FUNC(detachSlingRopeFromCargo) },
"", "", "", DIK_N, 1, alive _target && {_cargoHasSlingRope} && {!_cargoIsLoaded} && {!_playerInCargo} && {ACE_SELFINTERACTION_RESTRICTED}],
// Attach sling rope to helicopter
[format[(__ADD_SLING_HELI+"%1"), (if (_nearestHelicopterDist < 15) then {format[" %1m", (round ((_target distance _nearestHelicopter)*10))/10]} else {""})],
{ GVAR(targets) spawn FUNC(attachSlingRopeToHelicopter) },
"", "", "", DIK_G,
_cargoIsEmpty && {!_cargoIsAttachedToSomethingElse} && {(_helicopterAvailable || {!isNull _nearestHelicopter})} && {!_helicopterIsTransporting} && {_helicopterCanLift} && {_weight},
alive _target && {_cargoHasSlingRope} && {!_cargoIsLoaded} && {!_playerInCargo} && {ACE_SELFINTERACTION_RESTRICTED}]
]
]
];
//-----------------------------------------------------------------------------
_menuDef = [];
{
if (_x select 0 select 0 == _menuName) exitWith {_menuDef = _x};
} forEach _menus;
if (count _menuDef == 0) then {
hintC format ["Error: Menu not found: %1\n%2\n%3", str _menuName, if (_menuName == "") then {_this} else {""}, __FILE__];
diag_log format ["Error: Menu not found: %1, %2, %3", str _menuName, _params, __FILE__];
};
_menuDef // return value

View File

@ -0,0 +1,79 @@
License (short)
===============
You are free:
- to Share — to copy, distribute and transmit the work
Under the following conditions:
- Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
- Noncommercial — You may not use this work for commercial purposes.
- No Derivative Works — You may not alter, transform, or build upon this work.
With the understanding that:
Waiver — Any of the above conditions can be waived if you get permission from the copyright holder.
Public Domain — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license.
Other Rights — In no way are any of the following rights affected by the license:
- Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations;
- The author's moral rights;
- Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.
Notice — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.
Full license text
=================
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
"Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership.
"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and,
to Distribute and Publicly Perform the Work including as incorporated in Collections.
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d).
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested.
You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
For the avoidance of doubt:
Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b).
Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.

Binary file not shown.

View File

@ -0,0 +1,27 @@
#include "script_component.hpp"
PARAMS_3(_helicopter,_reduc,_cargo);
/* Would be nice to have the rope animated in such way, that the slingrope between cargo and helicopter changes in length/look etc.
// Set heliocopter higher to align attached load with ground level
_z_cargo = getPosASL _cargo;
_z_helicopter = getPosASL _helicopter;
_z_diff = (_z_helicopter select 2) - (_z_cargo select 2);
_helicopter setPosASL [(_z_helicopter select 0),(_z_helicopter select 1), (_z_helicopter select 2) + _z_diff];
*/
// TODO: Local ?
if (local driver _helicopter) then {
while {(_helicopter getvariable QGVAR(isTransporting)) && {canmove _helicopter} && {alive _helicopter} && {alive driver _helicopter}} do {
_helicopter setvelocity [
((velocity _helicopter) select 0)/_reduc,
((velocity _helicopter) select 1)/_reduc,
((velocity _helicopter) select 2)
];
// TODO: Track damage of cargo and helicopter = Cargo can be shot from slingload
// TODO: Cargo collision
// TODO: Landing event
sleep 0.05;
};
};

View File

@ -0,0 +1,15 @@
#define MAINCOMPONENT sys_cargo
#define SUBCOMPONENT slingload
#define COMPONENT DOUBLES(MAINCOMPONENT,SUBCOMPONENT)
#define ADDONS COMPONENT
#ifdef MAINCOMPONENT
#ifdef SUBCOMPONENT
#define PATHTO_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\MAINCOMPONENT\SUBCOMPONENT\##var3.sqf
#define PATHTOF_SYS(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\MAINCOMPONENT\SUBCOMPONENT\##var3
#define PATHTOF2_SYS(var1,var2,var3) MAINPREFIX\##var1\SUBPREFIX\MAINCOMPONENT\SUBCOMPONENT\##var3
#endif
#endif
#include "\z\ace\addons\main\script_mod.hpp"
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -0,0 +1,78 @@
#include "script_component.hpp"
_helicopter = _this select 3;
_cargo = _helicopter getvariable QGVAR(cargo);
_altobj = _helicopter getvariable QGVAR(cargoHeight);
_helicopter setvariable [QGVAR(isTransporting), false, true];
_helicopter setvariable [QGVAR(cargoHeight), 0];
_helicopter setvariable [QGVAR(cargo), objnull];
// TODO: playsound >clonk<
// Sling rope is still attached to the cargo
detach (_helicopter getVariable QGVAR(slingrope));
detach _cargo;
deleteVehicle (_helicopter getVariable QGVAR(slingrope)); // Delete physical rope object
_helicopter setVariable [QGVAR(slingrope), objnull];
_helicopter removeAction (_helicopter getvariable QGVAR(cutAction));
_helicopter setVariable [QGVAR(cutAction), -1];
if ((getpos _cargo) select 2 < 2) then {
_altfinal = ((getposASL _cargo) select 2) - ((getpos _cargo) select 2);
_cargo setposASL [getpos _cargo select 0, getpos _cargo select 1, _altfinal];
} else {
_vel = velocity _helicopter;
_retro = _vel select 2;
_altant = (getpos _cargo) select 2;
_cargo setvelocity [_vel select 0, _vel select 1, -1];
_helicopter setvelocity [_vel select 0, _vel select 1, _retro];
_dam = 0.00;
_delay = 0.01;
sleep 0.25;
_static = (_cargo isKindOf "Static");
if (!_static) then {
if ((getpos _cargo select 2) == _altant) then {
_static = true;
};
};
_pos = getPos _cargo;
// TODO: Possible cause for statics staying in the air?
while {(position _cargo select 2) > 0} do {
if (_dam < 1) then {_dam = _dam + _delay};
if (_static) then {_cargo setpos [_pos select 0, _pos select 1, (getpos _cargo select 2) - 0.25]};
sleep _delay;
};
if (_static) then {_cargo setpos [_pos select 0, _pos select 1, 0]};
_cargo setdamage (damage _cargo + _dam);
};
_cargo setVariable [QGVAR(isLoaded),false,true];
// Create slingrope next to cargo object
_cargo spawn {
private ["_magHolder"];
sleep 2;
_magHolder = "WeaponHolder" createVehicle [0,0,0];
_magholder addMagazineCargoGlobal ["ACE_Rope_M5", 1];
[QGVAR(wh), _magHolder] call CBA_fnc_globalEvent;
_magHolder setPos [((position _this) select 0)+2, ((position _this) select 1)+2,0];
};
_cargo setVariable [QGVAR(hasSlingRope), false, true];
// Unlock
if (_cargo call CBA_fnc_locked) then {
_lockedBefore = _cargo getVariable [QGVAR(locked), false];
if !(_lockedBefore) then {
[QGVAR(lock), [_cargo, false]] call CBA_fnc_globalEvent;
};
};

View File

@ -0,0 +1,192 @@
/* ace_sys_cargo | (c) 2010,2011 by rocko */
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
#define ACE_TEXT_RED(Text) ("<t color='#FF0000'>" + ##Text + "</t>")
PARAMS_4(_component,_unit,_id,_ar);
_position = _ar select 0;
_action = _ar select 1;
if (_component == _unit) then {
_component = _ar select 2;
};
TRACE_3("",_position,_action,_component);
if (isNil QUOTE(FUNC(sease))) then {
FUNC(ease) = {
private "_unit";
_unit action ["WeaponOnBack", _unit];
};
};
if (isNil QUOTE(FUNC(sdrop))) then {
FUNC(sdrop) = {
PARAMS_1(_component);
private ["_carrier_front","_carrier_back"];
_carrier_front = _component getVariable QGVAR(carrier_front);
_carrier_front removeAction GVAR(drop_action);
_carrier_back = _component getVariable QGVAR(carrier_back);
detach _carrier_back;
detach _component;
_component setPosATL [getPos _component select 0, getPos _component select 1, 0];
_carrier_front setVariable [QGVAR(monitoring),false,true];
_component setVariable [QGVAR(carrier_front), nil, true];
_component setVariable [QGVAR(carrier_back), nil, true];
TRACE_1("Dropping component","");
_component setVelocity [0,0,0];
{
//_x setVariable ["ace_sys_stamina_mass",0,true]; // The function is bullshit - but why?
[_x,0] call INC_MASS;
_x removeEventhandler ["fired",(_x getVariable QGVAR(carryFEH))];
_x removeEventhandler ["getin",(_x getVariable QGVAR(carryGIH))];
_x setVariable [QGVAR(carryFEH),-1];
_x setVariable [QGVAR(carryGIH),-1];
_x setVariable [QGVAR(forcedrop),false];
_x forceWalk false;
_x forceWalk false;
} foreach [_carrier_front,_carrier_back];
[objnull,_component,0,0] call FUNC(cbusy);
};
};
switch (toLower _action) do {
case "grab": { // GRAB ACTION
switch (toLower _position) do {
case "front": {
_unit setDir direction _component; // Front position is "driver"
_attachPos = if (count getArray(configFile >> "CfgVehicles" >> typeOf _component >> "attachPosFront") > 0) then {
getArray(configFile >> "CfgVehicles" >> typeOf _component >> "attachPosFront")
} else { [0,-0.5,0.5] };
_component attachTo [_unit, _attachPos, ""]; // Attach component to front carrier
_component setVariable [QGVAR(carrier_front), _unit, true]; // SetVariable front carrier onto component
[objnull,_component,1,1] call FUNC(cbusy);
// Add "drop" action, GLOBAL, since we handle player only
GVAR(drop_action) = _unit addAction [
ACE_TEXT_RED((localize "STR_ACE_CARGO_CARRYRELASE")),
"\z\ace\addons\sys_cargo\ua_carry2.sqf",
["", "drop",_component],
-1,false,true,"",""
]; // 0 - target, 1 - caller, 2 - id , 3 - ar=[0 - "", 1 - action]
if (local _unit) then {
_unit setVariable [QGVAR(monitoring), true];
};
//_unit call FUNC(ease); // Put weapon on back while carrying in pairs
// Stamina Boost on taking knee + pushing loaded stretcher up
_weight = ([_component] call FUNC(weight))/2;
[_unit,_weight] call INC_MASS;
//_unit setVariable ["ace_sys_stamina_mass",_weight,false]; // TODO: Fix weight
_fired_i = _unit addEventHandler ["fired", {(_this select 0) setVariable ["ace_sys_cargo_forcedrop",true]}];
_getin_i = _unit addEventhandler ["getin",{(_this select 0) setVariable ["ace_sys_cargo_forcedrop",true];}];
_unit setVariable [QGVAR(carryFEH),_fired_i];
_unit setVariable [QGVAR(carryGIH),_getin_i];
_unit setVariable [QGVAR(forcedrop),false];
};
case "back": { // Back position is following
_attachPos = if (count getArray(configFile >> "CfgVehicles" >> typeOf _component >> "attachPosRear") > 0) then {
getArray(configFile >> "CfgVehicles" >> typeOf _component >> "attachPosRear")
} else { [0,-0.5,0.5] };
_unit attachTo [(_component getVariable QGVAR(carrier_front)),_attachPos,""]; // Attach helper to the front carrier
_component setVariable [QGVAR(carrier_back), _unit, true]; // SetVariable back carrier to component
// Stamina Boost on taking knee + pushing loaded stretcher up
_weight = ([_component] call FUNC(weight))/2;
[_unit,_weight] call INC_MASS;
//_unit setVariable ["ace_sys_stamina_mass",_weight,false];
_fired_i = _unit addEventHandler ["fired", {(_this select 0) setVariable ["ace_sys_cargo_forcedrop",true]}];
_getin_i = _unit addEventhandler ["getin",{(_this select 0) setVariable ["ace_sys_cargo_forcedrop",true];}];
_unit setVariable [QGVAR(carryFEH),_fired_i];
_unit setVariable [QGVAR(carryGIH),_getin_i];
_unit setVariable [QGVAR(forcedrop),false];
};
};
};
case "drop": { // Drop action
_component call FUNC(sdrop);
};
};
TRACE_1("",(_unit getVariable QGVAR(monitoring)));
// Monitoring script for the front carrier
if (_position == "front") then {
_count = 0;
while { _unit getVariable QGVAR(monitoring) } do { // CALLED WHEN USING GRAB ONLY !
TRACE_1("While running","");
_carrier_front = _component getVariable QGVAR(carrier_front);
_carrier_back = _component getVariable QGVAR(carrier_back);
// Check for front carrier, when there is no back carrier within 10 seconds, front carrier drops stretcher again
if (_count > 8 && {isNil "_carrier_back"}) then {
_component call FUNC(sdrop);
//_carrier_front removeAction GVAR(drop_action);
if (local _carrier_front) then { localize "STR_ACE_CARGO_DROPPED" call ace_fnc_visual; };
TRACE_1("Dropping: No helper","");
};
// Check if the front carrier entered a vehicle! TODO
// While none of the carriers is dead or unconscious nothing happens
if !(alive _carrier_front) then {
_component call FUNC(sdrop);
TRACE_1("Frontcarrier dead","");
};
if !(alive _carrier_back) then {
_component call FUNC(sdrop);
TRACE_1("Backcarrier dead","");
};
// Too fast
if ((velocity _carrier_front call ACE_fnc_magnitude) > 5.51) then {
_component call FUNC(sdrop);
if (local _carrier_front) then { localize "STR_ACE_CARGO_DROPPED" call ace_fnc_visual; };
TRACE_1("Too fast","");
};
// TODO: Carrier front and back are unconsciousnes (i.e back carriers is unconscious and would be dragged in stretcher)
// TODO: Wrong animation: Taking out Binocular, Raising weapon (combat ready), taking a knee, going prone
// Allow tacticool movement for carrying CSWs
_dropConditionAnim = if (_component isKindOf "StaticWeapon") then { ["stand","kneel"] } else { ["stand"] };
if !(((_carrier_front call CBA_fnc_getUnitAnim) select 0) in _dropConditionAnim) then {
_component call FUNC(sdrop);
if (local _carrier_front) then { localize "STR_ACE_CARGO_DROPPED" call ace_fnc_visual; };
TRACE_1("Wrong animation","");
};
if !(((_carrier_back call CBA_fnc_getUnitAnim) select 0) in _dropConditionAnim) then {
_component call FUNC(sdrop);
if (local _carrier_back) then { localize "STR_ACE_CARGO_DROPPED" call ace_fnc_visual; };
TRACE_1("Wrong animation Backcarrier","");
};
// TODO: Anything else not allowed, firing, entering vehicles, climbing up ladders
// Ladders
if ((animationState _carrier_front) in ["ladderrifleon","laddercivilon"]) then {
_component call FUNC(sdrop);
if (local _carrier_front) then { localize "STR_ACE_CARGO_DROPPED" call ace_fnc_visual; };
TRACE_1("Wrong animation: LADDER","");
};
//_dropConditionAnim2 = (animationState _unit) in ["aidlpercmstpsraswrfldnon_idlesteady04","aidlpercmstpsraswrfldnon_aiming01","aidlpercmstpsraswrfldnon_idlesteady02","aidlpercmstpsraswrfldnon_idlesteady03","aidlpercmstpsraswrfldnon_idlesteady01","aidlpercmstpsraswrfldnon_aiming02"];
//if ((animationState _carrier_front) in _dropConditionAnim2) then {
// _component call FUNC(sdrop);
// if (local _carrier_front) then { localize "STR_ACE_CARGO_DROPPED" call ace_fnc_visual; };
//};
//if ((animationState _carrier_back) in _dropConditionAnim2) then {
// _component call FUNC(sdrop);
// if (local _carrier_back) then { localize "STR_ACE_CARGO_DROPPED" call ace_fnc_visual; };
//};
sleep 1;
INC(_count);
};
_unit setVariable [QGVAR(monitoring),false];
TRACE_1("Carrying aborted","");
};

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,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,130 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-16 -->
<Project name="AGM">
<Package name="Captives">
<Key ID="STR_AGM_Captives_SetCaptive">
<English>Take Prisoner</English>
<German>Gefangen nehmen</German>
<Spanish>Tomar prisionero</Spanish>
<French>Capturer le prisonnier</French>
<Polish>Weź więźnia</Polish>
<Czech>Zajmout Osobu</Czech>
<Italian>Arresta il Prigioniero</Italian>
<Portuguese>Tomar Prisioneiro</Portuguese>
<Hungarian>Foglyul ejtés</Hungarian>
<Russian>Взять в плен</Russian>
</Key>
<Key ID="STR_AGM_Captives_ReleaseCaptive">
<English>Free Prisoner</English>
<German>Gefangenen freilassen</German>
<Spanish>Liberar prisionero</Spanish>
<Polish>Wypuść więźnia</Polish>
<French>Libérer le prisonnier</French>
<Czech>Osvobodit Zajatce</Czech>
<Italian>Libera il Prigioniero</Italian>
<Portuguese>Libertar Prisioneiro</Portuguese>
<Hungarian>Fogoly szabadon elengedése</Hungarian>
<Russian>Освободить пленника</Russian>
</Key>
<Key ID="STR_AGM_Captives_EscortCaptive">
<English>Escort Prisoner</English>
<German>Gefangenen eskortieren</German>
<Spanish>Escoltar prisionero</Spanish>
<Polish>Eskortuj więźnia</Polish>
<French>Escorter le prisonnier</French>
<Czech>Eskortovat Zajatce</Czech>
<Italian>Scorta il Prigioniero</Italian>
<Portuguese>Escoltar Prisioneiro</Portuguese>
<Hungarian>Fogoly kísérése</Hungarian>
<Russian>Конвоировать пленника</Russian>
</Key>
<Key ID="STR_AGM_Captives_StopEscorting">
<English>Release Prisoner</English>
<German>Gefangenen loslassen</German>
<Spanish>Soltar prisionero</Spanish>
<Polish>Anuluj eskortowanie</Polish>
<French>Relâcher le prisonnier</French>
<Czech>Uvolnit Zajatce</Czech>
<Italian>Rilascia il Prigioniero</Italian>
<Portuguese>Largar Prisioneiro</Portuguese>
<Hungarian>Fogoly elengedése</Hungarian>
<Russian>Прекратить конвоирование</Russian>
</Key>
<Key ID="STR_AGM_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>
<Polish>Najpierw musisz wziąć go jako więźnia!</Polish>
<French>Vous devez d'abord le capturer!</French>
<Czech>Musíš ho nejdříve zajmout!</Czech>
<Italian>Prima devi arrestarlo!</Italian>
<Portuguese>Você deve tomá-lo como prisioneiro primeiro!</Portuguese>
<Hungarian>Először foglyul kell ejtened!</Hungarian>
<Russian>Вы должны сначала взять его в плен!</Russian>
</Key>
<Key ID="STR_AGM_Captives_LoadCaptive">
<English>Load Captive</English>
<German>Gefangenen einladen</German>
<Spanish>Cargar prisionero</Spanish>
<French>Embarquer le prisonnier</French>
<Polish>Załaduj więźnia</Polish>
<Czech>Naložit zajatce</Czech>
<Hungarian>Fogoly berakása</Hungarian>
<Russian>Загрузить пленного</Russian>
</Key>
<Key ID="STR_AGM_Captives_UnloadCaptive">
<English>Unload Captive</English>
<German>Gefangenen ausladen</German>
<Spanish>Descargar prisionero</Spanish>
<French>Débarquer le prisonnier</French>
<Polish>Wyładuj więźnia</Polish>
<Czech>Vyložit zajatce</Czech>
<Hungarian>Fogoly kivevése</Hungarian>
<Russian>Выгрузить пленного</Russian>
</Key>
<Key ID="STR_AGM_Captives_CableTie">
<English>Cable Tie</English>
<German>Kabelbinder</German>
<Polish>Opaska zaciskowa</Polish>
<Spanish>Precinto</Spanish>
<French>Serflex</French>
<Czech>Stahovací Pásek</Czech>
<Portuguese>Algema Plástica</Portuguese>
<Italian>Fascietta</Italian>
<Hungarian>Gyorskötöző</Hungarian>
<Russian>Кабельная стяжка</Russian>
</Key>
<Key ID="STR_AGM_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>
<Spanish>Los precintos permiten maniatar prisioneros</Spanish>
<French>Les Serflex permettent de menotter les prisonniers.</French>
<Czech>Stahovací pásky vám umožní zadržet vězně.</Czech>
<Portuguese>A algema plástica permite que você contenha prisioneiros.</Portuguese>
<Italian>Fascietta che ti consente di arrestare i prigionieri.</Italian>
<Hungarian>Gyorskötöző emberek fogjulejtéséhez.</Hungarian>
<Russian>Кабельные стяжки позволяют связывать пленников.</Russian>
</Key>
<Key ID="STR_AGM_Captives_FriskMenuHeader">
<English>Inventory of frisked person</English>
<German>Inventar der durchsuchten Person</German>
<French>Inventaire de la fouille</French>
<Spanish>Inventario de la persona cacheada</Spanish>
<Hungarian>Motozott személy felszerelése</Hungarian>
<Czech>Inventář prohledávané osoby</Czech>
<Polish>Ekwipunek rewidowanej osoby</Polish>
<Russian>Инвентарь обысканных лиц</Russian>
</Key>
<Key ID="STR_AGM_Captives_FriskPerson">
<English>Frisk person</English>
<German>Person durchsuchen</German>
<French>Fouiller</French>
<Spanish>Cachear</Spanish>
<Czech>Prohledávaná osoba</Czech>
<Polish>Rewiduj osobę</Polish>
<Hungarian>Motozás</Hungarian>
<Russian>Обыскать человека</Russian>
</Key>
</Package>
</Project>

View File

@ -1,51 +0,0 @@
class RscText;
class RscPicture;
class RscTitles {
class AGM_Altimeter {
idd = 9935;
enableSimulation = 1;
movingEnable = 0;
fadeIn=0;
fadeOut=1;
duration = 10e10;
onLoad = "uiNamespace setVariable ['AGM_Altimeter', _this select 0];";
class controls {
class AltimeterImage: RscPicture {
idc = 1200;
text = "AGM_Parachute\UI\watch_altimeter.paa";
x = 0.118437 * safezoneW + safezoneX;
y = 0.621 * safezoneH + safezoneY;
w = 0.20625 * safezoneW;
h = 0.341 * safezoneH;
};
class HeightText: RscText {
idc = 1100;
text = "----";
x = 0.200937 * safezoneW + safezoneX;
y = 0.764 * safezoneH + safezoneY;
w = 0.04125 * safezoneW;
h = 0.033 * safezoneH;
colorBackground[] = {0,0,0,0};
colorText[] = {0,0,0,1};
};
class DecendRate: RscText {
idc = 1000;
text = "--";
x = 0.21125 * safezoneW + safezoneX;
y = 0.742 * safezoneH + safezoneY;
w = 0.020625 * safezoneW;
h = 0.022 * safezoneH;
colorText[] = {0,0,0,1};
};
class TimeText: RscText {
idc = 1001;
text = "00:00";
x = 0.206094 * safezoneW + safezoneX;
y = 0.819 * safezoneH + safezoneY;
w = 0.0309375 * safezoneW;
h = 0.022 * safezoneH;
colorText[] = {0,0,0,1};
};
};
};
};

View File

@ -1,33 +0,0 @@
/*
Name: AGM_Parachute_fnc_init
Author: Garth de Wet (LH)
Description:
Auto called by Arma.
Initialises the parachute system.
Parameters:
Returns:
Nothing
Example:
call AGM_Parachute_fnc_init;
*/
[] spawn {
AGM_Parachuting_PFH = false;
while {true} do {
sleep 1;
// I believe this doesn't work for Zeus.
// vehicle _player
if (!AGM_Parachuting_PFH && {(vehicle AGM_player) isKindOf "ParachuteBase"}) then {
AGM_Parachuting_PFH = true;
["AGM_ParachuteFix", "OnEachFrame", {call AGM_Parachute_fnc_onEachFrame;}] call BIS_fnc_addStackedEventHandler;
};
};
};
// don't show speed and height when in expert mode
["Parachute", {if (!cadetMode) then {_dlg = _this select 0; {(_dlg displayCtrl _x) ctrlShow false} forEach [121, 122, 1004, 1005, 1006, 1014];};}] call AGM_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Parachute"
["Soldier", {if (!cadetMode) then {_dlg = _this select 0; {_ctrl = (_dlg displayCtrl _x); _ctrl ctrlSetPosition [0,0,0,0]; _ctrl ctrlCommit 0;} forEach [380, 382]};}] call AGM_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"

View File

@ -1,90 +0,0 @@
class CfgPatches {
class AGM_Parachute {
units[] = {"AGM_NonSteerableParachute"};
weapons[] = {"AGM_Altimeter"};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"Garth 'LH' de Wet"};
};
};
class CfgFunctions {
class AGM_Parachute {
class AGM_Parachute {
file = "\AGM_Parachute\functions";
class onEachFrame;
class doLanding;
class hideAltimeter;
class showAltimeter;
};
};
};
class Extended_PostInit_EventHandlers {
class AGM_Parachute {
clientInit = "call compile preprocessFileLineNumbers '\AGM_Parachute\clientInit.sqf';";
};
};
class AGM_Core_Default_Keys {
class showAltimeterNew {
displayName = "$STR_AGM_Parachute_showAltimeter";
condition = "'AGM_Altimeter' in assignedItems _player";
statement = "if (isNull (missionNamespace getVariable ['AGM_Parachute_AltimeterFnc', scriptNull])) then {[_player] call AGM_Parachute_fnc_showAltimeter} else {call AGM_Parachute_fnc_hideAltimeter}";
exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Medical_canTreat", "AGM_Interaction_isNotEscorting"};
key = 24;
shift = 0;
control = 0;
alt = 0;
};
};
#include "RscTitles.hpp"
class CfgWeapons {
class ItemWatch;
class AGM_Altimeter:ItemWatch {
author = "$STR_AGM_Core_AGMTeam";
descriptionShort = "$STR_AGM_Parachute_AltimeterDescription";
displayName = "$STR_AGM_Parachute_AltimeterDisplayName";
picture = "\AGM_Parachute\UI\watch_altimeter.paa";
};
};
class CfgVehicles {
class Box_NATO_Support_F;
class AGM_Box_Misc: Box_NATO_Support_F {
class TransportItems {
class _xx_AGM_Altimeter {
name = "AGM_Altimeter";
count = 6;
};
};
class TransportBackpacks {
class _xx_AGM_NonSteerableParachute {
backpack = "AGM_NonSteerableParachute";
count = 4;
};
};
};
class B_Parachute;
class AGM_NonSteerableParachute: B_Parachute {
author = "$STR_AGM_Core_AGMTeam";
scope = 2;
displayName = "$STR_AGM_Parachute_NonSteerableParachute";
//picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo
//model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo
backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable
ParachuteClass = "NonSteerable_Parachute_F";
maximumLoad = 0;
mass = 100;
};
class B_Soldier_05_f; class B_Pilot_F: B_Soldier_05_f {backpack = "AGM_NonSteerableParachute";};
class I_Soldier_04_F; class I_pilot_F: I_Soldier_04_F {backpack = "AGM_NonSteerableParachute";};
class O_helipilot_F; class O_Pilot_F: O_helipilot_F {backpack = "AGM_NonSteerableParachute";};
};

View File

@ -1,25 +0,0 @@
/*
Name: AGM_Parachute_fnc_doLanding
Author: Garth de Wet (LH)
Description:
Performs the landing animation fix
Parameters:
0: OBJECT - unit
Returns:
Nothing
Example:
[player] call AGM_Parachute_fnc_doLanding;
*/
_unit = _this select 0;
["AGM_ParachuteFix", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
AGM_Parachuting_PFH = false;
[_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call AGM_Core_fnc_doAnimation;
[_unit] spawn {
sleep 1;
(_this select 0) playActionNow "Crouch";
};

View File

@ -1,18 +0,0 @@
/*
Name: AGM_Parachute_fnc_hideAltimeter
Author: Garth de Wet (LH)
Description:
Removes the altimeter from the screen.
Parameters:
Returns:
Nothing
Example:
call AGM_Parachute_fnc_hideAltimeter
*/
terminate AGM_Parachute_AltimeterFnc;
(["AGM_Altimeter"] call BIS_fnc_rscLayer) cutText ["","PLAIN",0,true];

View File

@ -1,31 +0,0 @@
/*
Name: AGM_Parachute_fnc_onEachFrame
Author: Garth de Wet (LH)
Description:
Checks if a unit can defuse an explosive
Parameters:
0: OBJECT - unit
Returns:
Nothing
Example:
call AGM_Parachute_fnc_onEachFrame;
*/
private "_player";
_player = AGM_player;
if (isNull _player) exitWith {["AGM_ParachuteFix", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;AGM_Parachuting_PFH = false;};
if !((vehicle _player) isKindOf "ParachuteBase") exitWith {};
if (isTouchingGround _player) exitWith {};
private ["_pos", "_intersects"];
_pos = getPosASL (Vehicle _player);
if ((lineIntersects [_pos, _pos vectorAdd [0,0,-0.5], vehicle _player, _player]) || {((ASLtoATL _pos) select 2) < 0.75}) then {
// I believe this will not work for Zeus units.
deleteVehicle (vehicle _player);
[_player] call AGM_Parachute_fnc_doLanding;
};

View File

@ -1,52 +0,0 @@
/*
Name: AGM_Parachute_fnc_showAltimeter
Author: Garth de Wet (LH)
Description:
Displays the altimeter on screen.
Parameters:
0: OBJECT - unit to track for the altimeter
Returns:
Nothing
Example:
[player] call AGM_Parachute_fnc_showAltimeter
*/
private ["_unit"];
_unit = _this select 0;
(["AGM_Altimeter"] call BIS_fnc_rscLayer) cutRsc ["AGM_Altimeter", "PLAIN",0,true];
if (isNull (uiNamespace getVariable ["AGM_Altimeter", displayNull])) exitWith {};
AGM_Parachute_AltimeterFnc = [uiNamespace getVariable ["AGM_Altimeter", displayNull], _unit] spawn {
private ["_height", "_hour", "_minute", "_descentRate"];
_unit = _this select 1;
_height = floor ((getPosASL _unit) select 2);
_oldHeight = _height;
_descentRate = 0;
_hour = floor daytime;
_minute = floor ((daytime - _hour) * 60);
disableSerialization;
private ["_HeightText", "_DecendRate", "_TimeText", "_prevTime", "_curTime"];
_HeightText = (_this select 0) displayCtrl 1100;
_DecendRate = (_this select 0) displayCtrl 1000;
_TimeText = (_this select 0) displayCtrl 1001;
_curTime = time;
_prevTime = _curTime;
while {true} do {
_TimeText ctrlSetText (format ["%1:%2",[_hour, 2] call AGM_Core_fnc_numberToDigitsString,[_minute, 2] call AGM_Core_fnc_numberToDigitsString]);
_HeightText ctrlSetText (format ["%1", floor(_height)]);
_DecendRate ctrlSetText (format ["%1", _descentRate max 0]);
sleep 0.2;
_height = (getPosASL _unit) select 2;
_curTime = time;
_descentRate = floor ((_oldHeight - _height) / (_curTime - _prevTime));
_oldHeight = _height;
_prevTime = _curTime;
// close altimeter, @todo _unit can change due to team switch, zeus!
if !("AGM_Altimeter" in assignedItems _unit) exitWith {call AGM_Parachute_fnc_hideAltimeter};
};
};

View File

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-11 -->
<Project name="AGM">
<Package name="Parachute">
<Key ID="STR_AGM_Parachute_showAltimeter">
<English>Altimeter</English>
<French>Altimètre</French>
<German>Höhenmesser</German>
<Czech>Výškoměr</Czech>
<Polish>Wysokościomierz</Polish>
<Spanish>Altímetro</Spanish>
<Hungarian>Magasságmérő</Hungarian>
<Russian>Высотомер</Russian>
</Key>
<Key ID="STR_AGM_Parachute_AltimeterDisplayName">
<English>Altimeter Watch</English>
<French>Montre altimètre</French>
<German>Höhenmesser</German>
<Czech>Hodinky s výškoměrem</Czech>
<Polish>Zegarek z wysokościomierzem</Polish>
<Spanish>Reloj altímetro</Spanish>
<Hungarian>Magasságmérő</Hungarian>
<Russian>Часы с высотомером</Russian>
</Key>
<Key ID="STR_AGM_Parachute_AltimeterDescription">
<English>Used to show height, descent rate and the time.</English>
<French>Affiche la hauteur, le taux de descente et l'heure.</French>
<German>Zeigt Höhe, Fallgeschwindigkeit und Uhrzeit.</German>
<Czech>Používané k zjištění výšky, rychlosti sestupu a času.</Czech>
<Polish>Używany przez spadochroniarzy, pokazuje wysokość, prędkość opadania oraz czas.</Polish>
<Spanish>Utilizado para mostrar altura, tasa de descenso y hora.</Spanish>
<Hungarian>Mutatja a magasságot, zuhanás sebességét és az időt.</Hungarian>
<Russian>Используется для определения высоты, скорости снижения и времени.</Russian>
</Key>
<Key ID="STR_AGM_Parachute_NonSteerableParachute">
<English>Non-Steerable Parachute</English>
<German>Ungelenkter Fallschirm</German>
<Spanish>Paracaídas no dirigible</Spanish>
<French>Parachute non manœuvrable</French>
<Polish>Niesterowalny spadochron</Polish>
<Czech>Neříditelný padák</Czech>
<Hungarian>Irányithatatlan ejtőernyő</Hungarian>
<Russian>Неуправляемый парашют</Russian>
</Key>
</Package>
</Project>

View File

@ -1 +0,0 @@
AGM_VehicleLock

View File

@ -1,215 +0,0 @@
class CfgPatches {
class AGM_VehicleLock {
units[] = {};
weapons[] = {};
requiredVersion = 0.6;
requiredAddons[] = {"AGM_Core", "AGM_Interaction"};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"PabstMirror"};
authorUrl = "https://github.com/PabstMirror/";
};
};
class AGM_Parameters_Numeric {
AGM_VehicleLock_DefaultLockpickStrength = 10;
};
class CfgFunctions {
class AGM_VehicleLock {
class AGM_VehicleLock {
file = "AGM_vehicleLock\functions";
class addKeyForVehicle;
class getVehicleSideKey;
class hasKeyForVehicle;
class lockpick;
class moduleInit;
class moduleSync;
class serverSetupCustomKey;
class setVehicleLock;
};
};
};
class CfgMagazines {
class CA_Magazine;
class AGM_magazine_customKey: CA_Magazine {
picture = "\AGM_vehicleLock\ui\keyBlack.paa";
displayName = "AGM Vehicle Key"; //!!!CANNONT be localized!!!, because it is used as part of the magazineDetail string
descriptionShort = "$STR_AGM_Vehicle_Item_Custom_Description";
};
};
class CfgWeapons {
class InventoryItem_Base_F;
class AGM_ItemCore;
class AGM_item_key_master: AGM_ItemCore {
author = "$STR_AGM_Core_AGMTeam";
displayName = "Vehicle Key: Master";
descriptionShort = "$STR_AGM_Vehicle_Item_Master_Description";
model = "\A3\weapons_F\ammo\mag_univ.p3d";
picture = "\AGM_vehicleLock\ui\keyBlack.paa";
scope = 2;
class ItemInfo: InventoryItem_Base_F {
mass = 0.1;
};
};
class AGM_item_key_lockpick: AGM_item_key_master {
displayName = "Lockpick";
descriptionShort = "$STR_AGM_Vehicle_Item_Lockpick_Description";
picture = "\AGM_vehicleLock\ui\lockpick.paa";
};
class AGM_item_key_west: AGM_item_key_master {
displayName = "Vehicle Key: West";
descriptionShort = "$STR_AGM_Vehicle_Item_West_Description";
picture = "\AGM_vehicleLock\ui\keyBlue.paa";
};
class AGM_item_key_east: AGM_item_key_master {
displayName = "Vehicle Key: East";
descriptionShort = "$STR_AGM_Vehicle_Item_East_Description";
picture = "\AGM_vehicleLock\ui\keyRed.paa";
};
class AGM_item_key_indp: AGM_item_key_master {
displayName = "Vehicle Key: Independent";
descriptionShort = "$STR_AGM_Vehicle_Item_Indp_Description";
picture = "\AGM_vehicleLock\ui\keyPurple.paa";
};
class AGM_item_key_civ: AGM_item_key_master {
displayName = "Vehicle Key: Civilian";
descriptionShort = "$STR_AGM_Vehicle_Item_Civ_Description";
picture = "\AGM_vehicleLock\ui\keyGreen.paa";
};
};
#define MACRO_LOCK_ACTIONS \
class AGM_unlockVehicle { \
displayName = "$STR_AGM_Vehicle_Action_UnLock"; \
distance = 4; \
condition = "([_player, AGM_Interaction_Target] call AGM_VehicleLock_fnc_hasKeyForVehicle) && {(locked AGM_Interaction_Target) in [2, 3]}"; \
statement = "[AGM_Interaction_Target, false] call AGM_VehicleLock_fnc_setVehicleLock"; \
showDisabled = 1; \
priority = 0.3; \
icon = "\AGM_vehicleLock\ui\key_menuIcon_ca.paa"; \
}; \
class AGM_lockVehicle { \
displayName = "$STR_AGM_Vehicle_Action_Lock"; \
distance = 4; \
condition = "([_player, AGM_Interaction_Target] call AGM_VehicleLock_fnc_hasKeyForVehicle) && {(locked AGM_Interaction_Target) in [0, 1]}"; \
statement = "[AGM_Interaction_Target, true] call AGM_VehicleLock_fnc_setVehicleLock"; \
showDisabled = 1; \
priority = 0.2; \
icon = "\AGM_vehicleLock\ui\key_menuIcon_ca.paa"; \
}; \
class AGM_lockpickVehicle { \
displayName = "$STR_AGM_Vehicle_Action_Lockpick"; \
distance = 4; \
condition = "[_player, AGM_Interaction_Target, 'canLockpick'] call AGM_VehicleLock_fnc_lockpick"; \
statement = "[_player, AGM_Interaction_Target, 'startLockpick'] call AGM_VehicleLock_fnc_lockpick"; \
showDisabled = 0; \
priority = 0.1; \
};
class CfgVehicles {
class Logic;
class Module_F: Logic {
class ArgumentsBaseUnits {};
class ModuleDescription {};
};
class AGM_VehicleLock_ModuleSetup: Module_F {
author = "$STR_AGM_Core_AGMTeam";
category = "AGM";
displayName = "Vehicle Lock Setup";
function = "AGM_VehicleLock_fnc_moduleInit";
scope = 2;
isGlobal = 1;
icon = "\AGM_VehicleLock\ui\IconLock_ca.paa";
functionPriority = 0;
class Arguments {
class SideKeysAssignment {
displayName = "Players Start Side Keys"; // Argument label
description = "Which players start wtih side keys (e.g.: agm_item_key_west)"; // Tooltip description
typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL"
class values {
class Nobody {
name = "Nobody";
value = 0;
default = 1;
};
class GroupLeads {
name = "Group Leads";
value = 1;
};
class Everyone {
name = "Everyone";
value = 2;
};
};
};
class SetLockState {
displayName = "Set Lock State"; // Argument label
description = "Set lock state for all vehicles on map"; // Tooltip description
typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL"
class values {
class None {
name = "As Is";
value = 0;
default = 1;
};
class Side {
name = "Locked";
value = 1;
};
class Unique {
name = "Unlocked";
value = 2;
};
};
};
class LockpickStrength {
displayName = "Global Lockpick Strength";
description = "Global Time to lockpick (in seconds). Default: 10";
typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL"
defaultValue = "10"; // Default text filled in the input box
};
};
class ModuleDescription: ModuleDescription {
description = "Settings for lockpick strength, auto assigment of keys at start and initial vehicle lock state.";
};
};
class AGM_VehicleLock_ModuleSyncedAssign: Module_F {
author = "$STR_AGM_Core_AGMTeam";
category = "AGM";
displayName = "Vehicle Key Assign";
function = "AGM_VehicleLock_fnc_moduleSync";
scope = 2;
isGlobal = 1;
icon = "\AGM_VehicleLock\ui\IconLock_ca.paa";
functionPriority = 0;
class Arguments {};
class ModuleDescription: ModuleDescription {
description = "Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Only valid for objects present at mission start.";
sync[] = {"AnyPlayer", "AnyVehicle"};
};
};
class LandVehicle;
class Car: LandVehicle {
class AGM_Actions {
MACRO_LOCK_ACTIONS
};
};
class Tank: LandVehicle {
class AGM_Actions {
MACRO_LOCK_ACTIONS
};
};
class Air;
class Helicopter: Air {
class AGM_Actions {
MACRO_LOCK_ACTIONS
};
};
};

View File

@ -1,48 +0,0 @@
/*
Name: AGM_VehicleLock_fnc_addKeyForVehicle
Author: Pabst Mirror
Description:
Adds a key to a unit that will open a vehicle
Parameters:
0: OBJECT - unit
1: OBJECT - vehicle
2: BOOL - custom key (true: custom key - false: side key)
Returns:
Nothing
Example:
[bob, car1, true] call AGM_VehicleLock_fnc_addKeyForVehicle;
*/
#define CUSTOM_KEY_CLASSNAME "AGM_magazine_customKey"
private ["_unit","_veh","_useCustom","_previousMags","_newMags","_keyMagazine","_keyName"];
_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param;
_veh = [_this, 1, objNull, [objNull]] call bis_fnc_param;
_useCustom = [_this, 2, false, [false]] call bis_fnc_param;
if (isNull _unit) exitWith {
["addKeyForVehicleClient: null unit"] call BIS_fnc_error;
};
if (isNull _veh) exitWith {
["addKeyForVehicleClient: null vehicle"] call BIS_fnc_error;
};
if (_useCustom) then {
_previousMags = magazinesDetail _unit;
_unit addMagazine CUSTOM_KEY_CLASSNAME;
_newMags = (magazinesDetail _unit) - _previousMags;
if ((count _newMags) < 1) exitWith {
["AGM_VehicleLock_fnc_addKeyForVehicle: failed to add magazine (inventory full?)"] call BIS_fnc_error;
};
_keyMagazine = _newMags select 0;
[[_veh, _keyMagazine], "AGM_VehicleLock_fnc_serverSetupCustomKey", 1] call AGM_Core_fnc_execRemoteFnc;
} else {
_keyName = [_veh] call AGM_VehicleLock_fnc_getVehicleSideKey;
_unit addItem _keyName;
};

View File

@ -1,36 +0,0 @@
/*
Name: AGM_VehicleLock_fnc_getVehicleSideKey
Author: Pabst Mirror
Description:
Returns the side specifc key for a vehicle
Parameters:
0: OBJECT - vehicle
Returns:
STRING - Key Classname
Example:
[tank1] call AGM_VehicleLock_fnc_getVehicleSideKey;
*/
private ["_veh","_vehConfigSide","_vehSide","_returnValue"];
_veh = [_this, 0, objNull, [objNull]] call bis_fnc_param;
if (isNull _veh) exitWith {["AGM_VehicleLock_fnc_getVehicleSideKey: null vehicle"] call BIS_fnc_error; ""};
_vehConfigSide = [_veh, true] call bis_fnc_objectSide;
_vehSide = _veh getVariable ["agm_lock_side", _vehConfigSide];
_returnValue = "";
switch (_vehSide) do {
case (west): {_returnValue = "AGM_item_key_west"};
case (east): {_returnValue = "AGM_item_key_east"};
case (resistance): {_returnValue = "AGM_item_key_indp"};
case (civilian): {_returnValue = "AGM_item_key_civ"};
};
_returnValue

View File

@ -1,43 +0,0 @@
/*
Name: AGM_VehicleLock_fnc_hasKeyForVehicle
Author: Pabst Mirror
Description:
Returns if user has a valid key for the vehicle
Parameters:
0: OBJECT - unit
1: OBJECT - vehicle
Returns:
BOOL - unit has key for vehicle
Example:
[bob, car] call AGM_VehicleLock_fnc_hasKeyForVehicle;
*/
private ["_unit","_veh","_returnValue","_sideKeyName","_customKeys"];
_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param;
_veh = [_this, 1, objNull, [objNull]] call bis_fnc_param;
if (isNull _unit) exitWith {["AGM_VehicleLock_fnc_hasKeyForVehicle: null unit"] call BIS_fnc_error; false};
if (isNull _veh) exitWith {["AGM_VehicleLock_fnc_hasKeyForVehicle: null vehicle"] call BIS_fnc_error; false};
_returnValue = false;
//Master can open anything "no matter what"
if ("AGM_item_key_master" in (items _unit)) then {_returnValue = true};
//Check side key
_sideKeyName = [_veh] call AGM_VehicleLock_fnc_getVehicleSideKey;
if (_sideKeyName in (items _unit)) then {_returnValue = true};
//Check custom keys
_customKeys = _veh getVariable ["agm_lock_customKeys", []];
{
if (_x in (magazinesDetail _unit)) then {_returnValue = true;};
} forEach _customKeys;
_returnValue

View File

@ -1,71 +0,0 @@
/*
Name: AGM_VehicleLock_fnc_lockpick
Author: Pabst Mirror
Description:
Handles lockpick functionality from action menu.
Parameters:
0: OBJECT - unit
1: OBJECT - vehicle
2: STRING - function type
"canLockpick": returns BOOL if lockpick is possible
"startLockpick": starts the process
"finishLockpick": on completions, opens the lock
Returns:
BOOL
Example:
[AGM_player, AGM_Interaction_Target, 'canLockpick'] call AGM_VehicleLock_fnc_lockpick
*/
private ["_unit","_veh","_funcType","_vehLockpickStrenth","_returnValue"];
_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param;
_veh = [_this, 1, objNull, [objNull]] call bis_fnc_param;
_funcType = [_this, 2, "", [""]] call bis_fnc_param;
if (isNull _unit) exitWith {
["AGM_VehicleLock_fnc_lockpick: null unit"] call BIS_fnc_error;
false
};
if (isNull _veh) exitWith {
["AGM_VehicleLock_fnc_lockpick: null vehicle"] call BIS_fnc_error;
false
};
//need lockpick item
if (!("AGM_item_key_lockpick" in (items _unit))) exitWith {
false
};
_vehLockpickStrenth = _veh getVariable["agm_vehicleLock_pickStr", AGM_VehicleLock_DefaultLockpickStrength];
if (typeName _vehLockpickStrenth != "SCALAR") exitWith {
["AGM_VehicleLock_fnc_lockpick: agm_vehicleLock_pickStr invalid: (%1)", _veh] call BIS_fnc_error;
false
};
//-1 indicates unpickable lock
if (_vehLockpickStrenth < 0) exitWith {
false
};
_returnValue = false;
switch (true) do {
case (_funcType == "canLockpick"): {
_returnValue = true;
};
case (_funcType == "startLockpick"): {
[_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], "AGM_VehicleLock_fnc_lockpick", (localize "STR_AGM_Vehicle_Action_LockpickInUse")] call AGM_Core_fnc_progressBar;
};
case (_funcType == "finishLockpick"): {
[_veh, false] call AGM_VehicleLock_fnc_setVehicleLock;
};
default {
["AGM_VehicleLock_fnc_lockpick: bad function type"] call BIS_fnc_error;
};
};
_returnValue;

View File

@ -1,67 +0,0 @@
/*
Name: AGM_VehicleLock_fnc_moduleInit
Author: Pabst Mirror
Description:
Function for setup module. Sets default lockpick strength, auto handout keys, and default lock state.
Parameters:
0: OBJECT - logic
Returns:
Nothing
Example:
called from module
*/
_this spawn {
private ["_logic", "_sideKeysAssignment", "_setLockState", "_lock", "_giveSideKey", "_keyClassName"];
_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
_sideKeysAssignment = _logic getVariable["SideKeysAssignment", 0];
_setLockState = _logic getVariable["SetLockState", 0];
if (isServer) then {
[_logic, "AGM_VehicleLock_DefaultLockpickStrength", "LockpickStrength"] call AGM_Core_fnc_readNumericParameterFromModule;
{ //set lock state
_lock =
switch (_setLockState) do {
case (0): {(locked _x) in [2, 3]};
case (1):{true};
case (2):{false};
};
[_x, _lock] call AGM_VehicleLock_fnc_setVehicleLock;
}
forEach vehicles;
};
if (hasInterface) then {
waitUntil {player == player};
waitUntil {alive player};
sleep 5; //need to wait for other gear-assign scripts to finish
_giveSideKey =
switch (_sideKeysAssignment) do {
case (0): {false};
case (1): {(leader player) == player};
case (2): {true};
};
if (_giveSideKey) then {
_keyClassName = switch (playerside) do {
case (west): {"AGM_item_key_west"};
case (east): {"AGM_item_key_east"};
case (resistance): {"AGM_item_key_indp"};
case (civilian): {"AGM_item_key_civ"};
default {""};
};
if (_keyClassName != "") then {
player addItem _keyClassName;
};
};
};
};

View File

@ -1,47 +0,0 @@
/*
Name: AGM_VehicleLock_fnc_moduleSync
Author: Pabst Mirror
Description:
Function for sync module. Assigns keys for all synced vehicles to any players that are synced.
Parameters:
0: OBJECT - logic
1: ARRAY - synced objects (only objects at mission start, so JIP without AI won't be present)
Returns:
Nothing
Example:
called from module
*/
_this spawn {
private ["_logic","_syncedObjects","_listOfVehicles"];
_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
_syncedObjects = [_this, 1, [], [[]]] call BIS_fnc_param;
if (hasInterface) then {
waitUntil {player == player};
waitUntil {alive player};
sleep 5; //need to wait for other gear-assign scripts to finish
_listOfVehicles = []; {
if ((_x isKindOf "Car") || (_x isKindOf "Tank") || (_x isKindOf "Helicopter")) then {
_listOfVehicles pushBack _x;
};
} forEach _syncedObjects;
if ((count _listOfVehicles) == 0) exitWith {
["AGM_VehicleLock_fnc_moduleSync: no valid vehicles synced"] call BIS_fnc_error;
};
if (player in _syncedObjects) then {
{
[player, _x, true] call AGM_VehicleLock_fnc_addKeyForVehicle;
} forEach _listOfVehicles;
};
};
};

View File

@ -1,32 +0,0 @@
/*
Name: AGM_VehicleLock_fnc_serverSetupCustomKey
Author: Pabst Mirror
Description:
Adds a key (magazineDetail name) to approved keys for a vehicle
Parameters:
0: OBJECT - vehicle
1: STRING - Magazine Name
Returns:
Nothing
Example:
[tank1, "todo"] call AGM_VehicleLock_fnc_serverSetupCustomKey;
*/
private ["_veh","_key","_currentKeys"];
_veh = [_this, 0, objNull, [objNull]] call bis_fnc_param;
_key = [_this, 1, "", [""]] call bis_fnc_param;
if (!isServer) exitWith {["AGM_VehicleLock_fnc_serverSetupCustomKey: only run on server"] call BIS_fnc_error;};
if (_key == "") exitWith {["AGM_VehicleLock_fnc_serverSetupCustomKey: empty key string"] call BIS_fnc_error;};
//Want this as atomic as possible
_currentKeys = _veh getVariable ["agm_lock_customKeys", []];
_currentKeys pushBack _key;
_veh setVariable ["agm_lock_customKeys", _currentKeys, true];

View File

@ -1,29 +0,0 @@
/*
Name: AGM_VehicleLock_fnc_setVehicleLock
Author: Pabst Mirror
Description:
Sets a vehicle lock state (MP safe)
Parameters:
0: OBJECT - vehicle
1: BOOL - new lock state
Returns:
Nothing
Example:
[tank1, false] call AGM_VehicleLock_fnc_setVehicleLock;
*/
private ["_veh","_isLocked","_lockNumber"];
_veh = [_this, 0, objNull, [objNull]] call bis_fnc_param;
_isLocked = [_this, 1, false, [false]] call bis_fnc_param;
if (isNull _veh) exitWith {["AGM_VehicleLock_fnc_setVehicleLock: null vehicle"] call BIS_fnc_error;};
_lockNumber = if (_isLocked) then {2} else {0};
[[_veh, _lockNumber], "{(_this select 0) lock (_this select 1)}", 2] call AGM_Core_fnc_execRemoteFnc;
_veh setVariable ["AGM_LockedInventory", _isLocked, true];

View File

@ -1,37 +0,0 @@
Adds keys as an item, to lock and unlock vehicles.
Primary target would be role play or TVT, but has uses in all game types, even co-ops (DAC AI will steal unlocked vehicles)
Modules allow fast setup, or can manualy add items and set variables.
Two key modes (can be used together):
Simple Side based keys (e.g. "AGM_item_key_west" works on any hunter)
Custom keys (one key will only open a specific vehicle and nothing else)
Items Added:
AGM_item_key_lockpick
AGM_item_key_master
AGM_item_key_west
AGM_item_key_east
AGM_item_key_indp
AGM_item_key_civ
Magazine added (should never be manualy added, needs to be 'programed' to work on a vehicle):
AGM_magazine_customKey
For Mission Makers:
Modules:
Vehicle Lock Setup - Settings for lockpick strength, auto assigment of keys at start and initial vehicle lock state.
Vehicle Key Assign - Sync with vehicles and players. Will handout custom keys to players for every synced vehicle.
Global Variable:
AGM_VehicleLock_DefaultLockpickStrength - Time in seconds to lock pick globaly, can also set per-vehicle (-1 would disable)
Vehicle setVariables:
agm_lock_side - SIDE: overrides a vehicle's side, allows indfor to use little-bird's with indp keys
agm_vehicleLock_pickStr - NUMBER: secons, determines how long lockpicking with take, overrides AGM_VehicleLock_DefaultLockpickStrength
agm_lock_customKeys - ARRAY: array of strings of magazinesDetails, use the following function to modify
[bob, car1, true] call AGM_VehicleLock_fnc_addKeyForVehicle;
will add a "AGM_magazine_customKey" to bob and program it to work on car1

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