Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attach to vehicles #123

Merged
merged 5 commits into from
Feb 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/attach/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -1 +1 @@
z\ace\Addons\laser
z\ace\Addons\attach
6 changes: 3 additions & 3 deletions addons/attach/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
};
class ADDON {
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
};
};
16 changes: 8 additions & 8 deletions addons/attach/CfgMagazines.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class CfgMagazines {
class CA_Magazine;
class B_IR_Grenade: CA_Magazine {
ACE_Attachable = 1;
};
class SmokeShell;
class Chemlight_green: SmokeShell {
ACE_Attachable = 1;
};
class CA_Magazine;
class B_IR_Grenade: CA_Magazine {
ACE_Attachable = 1;
};
class SmokeShell;
class Chemlight_green: SmokeShell {
ACE_Attachable = 1;
};
};
211 changes: 127 additions & 84 deletions addons/attach/CfgVehicles.hpp
Original file line number Diff line number Diff line change
@@ -1,104 +1,147 @@
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
name = #ITEM; \
count = COUNT; \
};
name = #ITEM; \
count = COUNT; \
};

#define MACRO_ATTACHTOVEHICLE \
class ACE_Actions { \
class GVAR(AttachVehicle) { \
displayName = "$STR_ACE_Attach_AttachDetach"; \
condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \
exceptions[] = {"ACE_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 0; \
icon = PATHTOF(UI\attach_ca.paa); \
distance = 4; \
}; \
class GVAR(DetachVehicle) { \
displayName = "$STR_ACE_Attach_Detach"; \
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \
statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \
exceptions[] = {"ACE_Drag_isNotDragging"}; \
showDisabled = 0; \
priority = 0; \
icon = PATHTOF(UI\detach_ca.paa); \
distance = 4; \
}; \
};

class CfgVehicles {
class Man;
class CAManBase: Man {
class ACE_SelfActions {
class ACE_Equipment {
class GVAR(Attach) {
displayName = "$STR_ACE_Attach_AttachDetach";
condition = QUOTE( [_player, ''] call FUNC(canAttach) );
statement = QUOTE( [_player] call FUNC(openAttachUI); );
exceptions[] = {"ACE_Drag_isNotDragging"};
showDisabled = 0;
priority = 5;
icon = PATHTOF(UI\attach_ca.paa);
hotkey = "T";
};
class GVAR(Detach) {
displayName = "$STR_ACE_Attach_Detach";
condition = QUOTE( [_player] call FUNC(canDetach) );
statement = QUOTE( [_player] call FUNC(detach) );
exceptions[] = {"ACE_Drag_isNotDragging"};
showDisabled = 0;
priority = 5;
icon = PATHTOF(UI\detach_ca.paa);
hotkey = "T";
class LandVehicle;
class Car: LandVehicle {
MACRO_ATTACHTOVEHICLE
};
class Tank: LandVehicle {
MACRO_ATTACHTOVEHICLE
};
class Air;
class Helicopter: Air {
MACRO_ATTACHTOVEHICLE
};
class Plane: Air {
MACRO_ATTACHTOVEHICLE
};
class Ship;
class Ship_F: Ship {
MACRO_ATTACHTOVEHICLE
};

class Man;
class CAManBase: Man {
class ACE_SelfActions {
class ACE_Equipment {
class GVAR(Attach) {
displayName = "$STR_ACE_Attach_AttachDetach";
condition = QUOTE(([ARR_3(_player, _player, '')] call FUNC(canAttach)));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(openAttachUI); );
exceptions[] = {"ACE_Drag_isNotDragging"};
showDisabled = 0;
priority = 5;
icon = PATHTOF(UI\attach_ca.paa);
hotkey = "T";
};
class GVAR(Detach) {
displayName = "$STR_ACE_Attach_Detach";
condition = QUOTE(([ARR_2(_player, _player)] call FUNC(canDetach)));
statement = QUOTE( [ARR_2(_player, _player)] call FUNC(detach) );
exceptions[] = {"ACE_Drag_isNotDragging"};
showDisabled = 0;
priority = 5;
icon = PATHTOF(UI\detach_ca.paa);
hotkey = "T";
};
};
};
};
};
};

class All;
class ACE_IR_Strobe_Effect: All {
scope = 1;
displayName = "IR Strobe";
model = "\A3\Weapons_F\empty.p3d";
simulation = "nvmarker";
class All;
class ACE_IR_Strobe_Effect: All {
scope = 1;
displayName = "IR Strobe";
model = "\A3\Weapons_F\empty.p3d";
simulation = "nvmarker";

class NVGMarker {
diffuse[] = {0,0,0};
ambient[] = {0,0,0};
brightness = 0.004;
name = "pozicni blik";
drawLight = 1;
drawLightSize = 0.005;
drawLightCenterSize = 0.003;
activeLight = 0;
blinking=1;
dayLight = 0;
onlyInNvg = 1;
useFlare = 0;
class NVGMarker {
diffuse[] = {0,0,0};
ambient[] = {0,0,0};
brightness = 0.004;
name = "pozicni blik";
drawLight = 1;
drawLightSize = 0.005;
drawLightCenterSize = 0.003;
activeLight = 0;
blinking=1;
dayLight = 0;
onlyInNvg = 1;
useFlare = 0;
};
side = 7;//-1=NO_SIDE yellow box,3=CIV grey box,4=NEUTRAL yellow box,6=FRIENDLY green box,7=LOGIC no radar signature
accuracy = 1000;
cost = 0;
armor = 500;
threat[] = {0,0,0};
nameSound = "";
type = 0;
weapons[] = {};
magazines[] = {};
nvTarget = 1;
destrType = "DestructNo";
brightness = 20;
};
side = 7;//-1=NO_SIDE yellow box,3=CIV grey box,4=NEUTRAL yellow box,6=FRIENDLY green box,7=LOGIC no radar signature
accuracy = 1000;
cost = 0;
armor = 500;
threat[] = {0,0,0};
nameSound = "";
type = 0;
weapons[] = {};
magazines[] = {};
nvTarget = 1;
destrType = "DestructNo";
brightness = 20;
};

class NATO_Box_Base;
class EAST_Box_Base;
class IND_Box_Base;
class FIA_Box_Base_F;
class NATO_Box_Base;
class EAST_Box_Base;
class IND_Box_Base;
class FIA_Box_Base_F;

class Box_NATO_Support_F: NATO_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
class Box_NATO_Support_F: NATO_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
};
};
};

class Box_East_Support_F: EAST_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
class Box_East_Support_F: EAST_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
};
};
};

class Box_IND_Support_F: IND_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
class Box_IND_Support_F: IND_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
};
};
};

class Box_FIA_Support_F: FIA_Box_Base_F {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
class Box_FIA_Support_F: FIA_Box_Base_F {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
};
};
};

class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(ACE_IR_Strobe_Item,12)
};
};
};
};
24 changes: 12 additions & 12 deletions addons/attach/CfgWeapons.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
class CfgWeapons {
class ACE_ItemCore;
class InventoryItem_Base_F;
class ACE_ItemCore;
class InventoryItem_Base_F;

class ACE_IR_Strobe_Item: ACE_ItemCore {
displayName = "$STR_ACE_IrStrobe_Name";
descriptionShort = "$STR_ACE_IrStrobe_Description";
model = "\A3\weapons_F\ammo\mag_univ.p3d";
picture = PATHTOF(UI\irstrobe_item.paa);
scope = 2;
ACE_attachable = 1;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
class ACE_IR_Strobe_Item: ACE_ItemCore {
displayName = "$STR_ACE_IrStrobe_Name";
descriptionShort = "$STR_ACE_IrStrobe_Description";
model = "\A3\weapons_F\ammo\mag_univ.p3d";
picture = PATHTOF(UI\irstrobe_item.paa);
scope = 2;
ACE_attachable = 1;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
};
};
};
};
4 changes: 3 additions & 1 deletion addons/attach/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
ace_attach
==========

Introducing the ability to attach various throwables to yourself to mark your position and assist in IFF.
Introducing the ability to attach various throwables to yourself or vehicles, to mark your position and assist in IFF.
Adds item `ACE_IR_Strobe_Item`.


## Maintainers
Expand All @@ -11,3 +12,4 @@ The people responsible for merging changes to this component or answering potent
- [esteldunedain](https://github.com/esteldunedain)
- [bux578](https://github.com/bux578)
- [KoffeinFlummi](https://github.com/KoffeinFlummi)
- [PabstMirror](https://github.com/PabstMirror)
2 changes: 2 additions & 0 deletions addons/attach/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ PREP(canAttach);
PREP(canDetach);
PREP(detach);
PREP(openAttachUI);
PREP(placeApprove);
PREP(placeCancel);

ADDON = true;
18 changes: 9 additions & 9 deletions addons/attach/config.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#include "script_component.hpp"

class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {"ACE_IR_Strobe_Item"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common", "ace_interaction"};
author[] = {"KoffeinFlummi", "eRazeri", "CAA-Picard"};
authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG;
};
class ADDON {
units[] = {};
weapons[] = {"ACE_IR_Strobe_Item"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common", "ace_interaction"};
author[] = {"KoffeinFlummi", "eRazeri", "CAA-Picard"};
authorUrl = "https://github.com/KoffeinFlummi/";
VERSION_CONFIG;
};
};

#include "CfgEventHandlers.hpp"
Expand Down
Loading