Ace_Chemlights (Chemlight Enhancements) (#3921)

* Add ace_chemlights.
Make chemlight intensity and dropoff more realistic.
Add orange, white, IR chemlights.
Add chemlight shields.
Make chemlight impact sounds more realistic.

* Moved impact sound changes to a different branch.

* Used QPATHTOF. Fixed scopes. Used initServer. Reduced lifetime duration.
Checked privates.

* Stringtable: 5 minute.

* Blue lifetime. Removed ref to deprecated function

* Use proper magazine macro. Add new chemlights to Misc box.
This commit is contained in:
voiperr 2016-08-27 01:19:39 -07:00 committed by Glowbal
parent 9ef24d25ba
commit fedad7f8f7
46 changed files with 1275 additions and 0 deletions

View File

@ -64,6 +64,12 @@ if (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) then
// Delete attached item after 0.5 seconds
[{deleteVehicle (_this select 0)}, [_attachedObject], 2] call CBA_fnc_waitAndExecute;
} else {
//handle any objects that may be attached to the object
{
detach _x;
deleteVehicle _x;
} forEach (attachedObjects _attachedObject);
// Delete attached item
detach _attachedObject;
deleteVehicle _attachedObject;

View File

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

View File

@ -0,0 +1,84 @@
class CfgAmmo {
class Chemlight_base;
class Chemlight_Blue: Chemlight_base {
timeToLive = 1500;
};
class Chemlight_Red: Chemlight_base {
timeToLive = 1800;
};
class Chemlight_Green: Chemlight_base {
timeToLive = 1800;
};
class Chemlight_Yellow: Chemlight_base {
timeToLive = 1800;
};
class ACE_G_Chemlight_Orange: Chemlight_base {
timeToLive = 1800;
effectsSmoke = "ACE_ChemlightEffect_Orange";
model = "\A3\Weapons_f\chemlight\chemlight_yellow_lit";
};
class ACE_G_Chemlight_Orange_Infinite: ACE_G_Chemlight_Orange {
timeToLive = 1e10;
};
class ACE_G_Chemlight_White: Chemlight_base {
timeToLive = 1500;
effectsSmoke = "ACE_ChemlightEffect_White";
model = "\A3\Weapons_f\chemlight\chemlight_yellow_lit";
};
class ACE_G_Chemlight_White_Infinite: ACE_G_Chemlight_White {
timeToLive = 1e10;
};
class ACE_G_Chemlight_HiRed: Chemlight_Red {
effectsSmoke = "ACE_ChemlightEffect_HiRed";
timeToLive = 300;
};
class ACE_G_Chemlight_HiRed_Infinite: ACE_G_Chemlight_HiRed {
timeToLive = 1e10;
};
class ACE_G_Chemlight_HiYellow: Chemlight_Yellow {
effectsSmoke = "ACE_ChemlightEffect_HiYellow";
timeToLive = 300;
};
class ACE_G_Chemlight_HiYellow_Infinite: ACE_G_Chemlight_HiYellow {
timeToLive = 1e10;
};
class ACE_G_Chemlight_HiOrange: ACE_G_Chemlight_Orange {
effectsSmoke = "ACE_ChemlightEffect_HiOrange";
timeToLive = 300;
};
class ACE_G_Chemlight_HiOrange_Infinite: ACE_G_Chemlight_HiOrange {
timeToLive = 1e10;
};
class ACE_G_Chemlight_HiWhite: ACE_G_Chemlight_White {
effectsSmoke = "ACE_ChemlightEffect_HiWhite";
timeToLive = 300;
};
class ACE_G_Chemlight_HiWhite_Infinite: ACE_G_Chemlight_HiWhite {
timeToLive = 1e10;
};
class ACE_G_Chemlight_IR: Chemlight_base {
ACE_Chemlight_IR = "ACE_Chemlight_IR_Dummy";
effectsSmoke = "ACE_ChemlightEffect_IR";
timeToLive = 1500;
model = "\A3\Weapons_f\chemlight\chemlight_blue_lit";
};
};

View File

@ -0,0 +1,26 @@
class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preStart));
};
};
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
class Extended_Init_EventHandlers {
class ACE_Chemlight_IR_Dummy {
class ADDON {
serverInit = QUOTE(_this call FUNC(initIR));
};
};
};

View File

@ -0,0 +1,92 @@
#define BASE_ATTENUATION \
class Attenuation { \
constant = 0; \
linear = 0; \
quadratic = 200; \
hardLimitStart = 1.75; \
hardLimitEnd = 3; \
};
#define HI_ATTENUATION \
class Attenuation { \
constant = 0; \
linear = 0; \
quadratic = 20; \
hardLimitStart = 3; \
hardLimitEnd = 4; \
};
class CfgLights {
class ChemLight_Green {
ambient[] = {0,0,0,0};
brightness = 1;
color[] = {0.1,1,0.1,1};
diffuse[] = {0.1,1,0.1};
drawLight = 0;
intensity = 4000;
position[] = {0,0,0};
BASE_ATTENUATION
};
class ChemLight_Blue: ChemLight_Green {
color[] = {0,0.6,1,1};
diffuse[] = {0,0.6,1};
BASE_ATTENUATION
};
class ChemLight_Red: ChemLight_Green {
color[] = {1,0.1,0.1,1};
diffuse[] = {1,0.1,0.1};
BASE_ATTENUATION
};
class ChemLight_Yellow: ChemLight_Green {
color[] = {1,1,0.1,1};
diffuse[] = {1,1,0.1};
BASE_ATTENUATION
};
class ACE_ChemlightLight_Orange: ChemLight_Green {
color[] = {1,0.64,0,1};
diffuse[] = {1,0.4,0};
};
class ACE_ChemlightLight_White: ChemLight_Green {
color[] = {1,1,1,1};
diffuse[] = {1,1,1};
};
class ACE_ChemlightLight_HiRed: ChemLight_Red {
intensity = 12000;
HI_ATTENUATION
};
class ACE_ChemlightLight_HiYellow: ChemLight_Yellow {
intensity = 12000;
HI_ATTENUATION
};
class ACE_ChemlightLight_HiOrange: ACE_ChemlightLight_Orange {
intensity = 12000;
HI_ATTENUATION
};
class ACE_ChemlightLight_HiWhite: ACE_ChemlightLight_White {
intensity = 12000;
HI_ATTENUATION
};
class ACE_ChemlightLight_IR: ChemLight_Green {
intensity = 0;
};
};

View File

@ -0,0 +1,100 @@
class CfgMagazines {
class SmokeShell;
class Chemlight_Green: Smokeshell {
ACE_Chemlight_Shield = "ACE_Chemlight_Shield_Green";
};
class Chemlight_Blue: Chemlight_Green {
ACE_Chemlight_Shield = "ACE_Chemlight_Shield_Blue";
};
class Chemlight_Red: Chemlight_Green {
ACE_Chemlight_Shield = "ACE_Chemlight_Shield_Red";
};
class Chemlight_Yellow: Chemlight_Green {
ACE_Chemlight_Shield = "ACE_Chemlight_Shield_Yellow";
};
class ACE_Chemlight_Orange: Chemlight_Green {
ACE_Attachable = "ACE_G_Chemlight_Orange";
ACE_Chemlight_Shield = "ACE_Chemlight_Shield_Orange";
author = ECSTRING(common,ACETeam);
ammo = "ACE_G_Chemlight_Orange";
displayName = CSTRING(Orange_DisplayName);
displayNameShort = CSTRING(Orange_DisplayNameShort);
descriptionShort = CSTRING(Orange_DescriptionShort);
model = "\A3\Weapons_f\chemlight\chemlight_yellow";
picture = QPATHTOF(UI\ace_chemlight_orange_x_ca.paa);
};
class ACE_Chemlight_White: Chemlight_Green {
ACE_Attachable = "ACE_G_Chemlight_White";
ACE_Chemlight_Shield = "ACE_Chemlight_Shield_White";
author = ECSTRING(common,ACETeam);
ammo = "ACE_G_Chemlight_White";
displayName = CSTRING(White_DisplayName);
displayNameShort = CSTRING(White_DisplayNameShort);
descriptionShort = CSTRING(White_DescriptionShort);
model = "\A3\Weapons_f\chemlight\chemlight_yellow";
picture = QPATHTOF(UI\ace_chemlight_white_x_ca.paa);
};
class ACE_Chemlight_HiRed: Chemlight_Red {
ACE_Attachable = "ACE_G_Chemlight_HiRed";
ACE_Chemlight_Shield = "";
author = ECSTRING(common,ACETeam);
ammo = "ACE_G_Chemlight_HiRed";
displayName = CSTRING(HiRed_DisplayName);
displayNameShort = CSTRING(HiRed_DisplayNameShort);
descriptionShort = CSTRING(HiRed_DescriptionShort);
picture = QPATHTOF(UI\ace_chemlight_hired_x_ca.paa);
};
class ACE_Chemlight_HiYellow: Chemlight_Yellow {
ACE_Attachable = "ACE_G_Chemlight_HiYellow";
ACE_Chemlight_Shield = "";
author = ECSTRING(common,ACETeam);
ammo = "ACE_G_Chemlight_HiYellow";
displayName = CSTRING(HiYellow_DisplayName);
displayNameShort = CSTRING(HiYellow_DisplayNameShort);
descriptionShort = CSTRING(HiYellow_DescriptionShort);
picture = QPATHTOF(UI\ace_chemlight_hiyellow_x_ca.paa);
};
class ACE_Chemlight_HiOrange: ACE_Chemlight_Orange {
ACE_Attachable = "ACE_G_Chemlight_HiOrange";
ACE_Chemlight_Shield = "";
author = ECSTRING(common,ACETeam);
ammo = "ACE_G_Chemlight_HiOrange";
displayName = CSTRING(HiOrange_DisplayName);
displayNameShort = CSTRING(HiOrange_DisplayNameShort);
descriptionShort = CSTRING(HiOrange_DescriptionShort);
picture = QPATHTOF(UI\ace_chemlight_hiorange_x_ca.paa);
};
class ACE_Chemlight_HiWhite: ACE_Chemlight_White {
ACE_Attachable = "ACE_G_Chemlight_HiWhite";
ACE_Chemlight_Shield = "";
author = ECSTRING(common,ACETeam);
ammo = "ACE_G_Chemlight_HiWhite";
displayName = CSTRING(HiWhite_DisplayName);
displayNameShort = CSTRING(HiWhite_DisplayNameShort);
descriptionShort = CSTRING(HiWhite_DescriptionShort);
picture = QPATHTOF(UI\ace_chemlight_hiwhite_x_ca.paa);
};
class ACE_Chemlight_IR: Chemlight_Green {
ACE_Attachable = "ACE_Chemlight_IR_Dummy";
ACE_Chemlight_Shield = "";
author = ECSTRING(common,ACETeam);
ammo = "ACE_G_Chemlight_IR";
displayName = CSTRING(IR_DisplayName);
displayNameShort = CSTRING(IR_DisplayNameShort);
descriptionShort = CSTRING(IR_DescriptionShort);
picture = QPATHTOF(UI\ace_chemlight_ir_x_ca.paa);
};
};

View File

@ -0,0 +1,291 @@
class CBA_Extended_EventHandlers;
class CfgVehicles {
class Man;
class CAManBase: Man {
class ACE_SelfActions {
class ACE_Equipment {
class ACE_Chemlights {
displayName = CSTRING(Action_Chemlights);
icon = "\a3\ui_f\data\gui\cfg\Hints\chemlights_ca.paa";
condition = QUOTE(count ([ACE_player] call FUNC(getShieldComponents)) > 0);
statement = "true";
exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"};
insertChildren = QUOTE(_this call DFUNC(compileChemlightMenu));
showDisabled = 0;
priority = 99;
};
};
};
};
class Thing;
class ThingX;
class ACE_Chemlight_IR_Marker: Thing {
author = ECSTRING(common,ACETeam);
displayName = "ACE Chemlight IR Marker";
mapSize = 0.2;
scope = 1;
type = 1;
vehicleClass = "";
simulation = "nvmarker";
nvTarget = 1;
brightness = 0.2;
class NVGMarker {
diffuse[] = {0.1,0.1,0.1};
ambient[] = {0.01,0.01,0.01};
brightness = 0.015;
name = "pozicni blik";
drawLight = 0;
drawLightSize = 0;
drawLightCenterSize = 0;
activeLight = 0;
blinking = 0;
dayLight = 0;
onlyInNvg = 1;
useFlare = 0;
};
};
class ACE_Chemlight_IR_Dummy: ThingX {
ACE_Attachable = "ACE_G_Chemlight_IR";
author = ECSTRING(common,ACETeam);
displayName = "ACE Chemlight IR Phys Dummy";
mass = 0.75;
model = "\A3\Weapons_f\chemlight\chemlight_blue";
scope = 1;
vehicleClass = "";
class EventHandlers {
class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};
};
};
class Item_Base_F;
class ACE_Item_Chemlight_Shield: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = CSTRING(Shield_Empty_DisplayName);
author = ECSTRING(common,ACETeam);
vehicleClass = "WeaponAccessories";
class TransportItems {
class ACE_Chemlight_Shield {
name = "ACE_Chemlight_Shield";
count = 1;
};
};
};
class ACE_Item_Chemlight_Shield_Green: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = CSTRING(Shield_Green_DisplayName);
author = ECSTRING(common,ACETeam);
vehicleClass = "WeaponAccessories";
class TransportItems {
class ACE_Chemlight_Shield_Green {
name = "ACE_Chemlight_Shield_Green";
count = 1;
};
};
};
class ACE_Item_Chemlight_Shield_Red: ACE_Item_Chemlight_Shield_Green {
displayName = CSTRING(Shield_Red_DisplayName);
class TransportItems {
class ACE_Chemlight_Shield_Red {
name = "ACE_Chemlight_Shield_Red";
count = 1;
};
};
};
class ACE_Item_Chemlight_Shield_Blue: ACE_Item_Chemlight_Shield_Green {
displayName = CSTRING(Shield_Blue_DisplayName);
class TransportItems {
class ACE_Chemlight_Shield_Blue {
name = "ACE_Chemlight_Shield_Blue";
count = 1;
};
};
};
class ACE_Item_Chemlight_Shield_Yellow: ACE_Item_Chemlight_Shield_Green {
displayName = CSTRING(Shield_Yellow_DisplayName);
class TransportItems {
class ACE_Chemlight_Shield_Yellow {
name = "ACE_Chemlight_Shield_Yellow";
count = 1;
};
};
};
class ACE_Item_Chemlight_Shield_Orange: ACE_Item_Chemlight_Shield_Green {
displayName = CSTRING(Shield_Orange_DisplayName);
class TransportItems {
class ACE_Chemlight_Shield_Orange {
name = "ACE_Chemlight_Shield_Orange";
count = 1;
};
};
};
class ACE_Item_Chemlight_Shield_White: ACE_Item_Chemlight_Shield_Green {
displayName = CSTRING(Shield_White_DisplayName);
class TransportItems {
class ACE_Chemlight_Shield_White {
name = "ACE_Chemlight_Shield_White";
count = 1;
};
};
};
class NATO_Box_Base;
class EAST_Box_Base;
class IND_Box_Base;
class FIA_Box_Base_F;
class ReammoBox_F;
class Box_NATO_Grenades_F: NATO_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_Chemlight_Shield,12);
};
};
class Box_NATO_Support_F: NATO_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_Chemlight_Shield,12);
};
};
class B_supplyCrate_F: ReammoBox_F {
class TransportItems {
MACRO_ADDITEM(ACE_Chemlight_Shield,12);
};
};
class Box_East_Grenades_F: EAST_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_Chemlight_Shield,12);
};
};
class Box_East_Support_F: EAST_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_Chemlight_Shield,12);
};
};
class O_supplyCrate_F: ReammoBox_F {
class TransportItems {
MACRO_ADDITEM(ACE_Chemlight_Shield,12);
};
};
class Box_IND_Grenades_F: IND_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_Chemlight_Shield,12);
};
};
class Box_IND_Support_F: IND_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_Chemlight_Shield,12);
};
};
class I_supplyCrate_F: ReammoBox_F {
class TransportItems {
MACRO_ADDITEM(ACE_Chemlight_Shield,12);
};
};
class Box_FIA_Ammo_F: FIA_Box_Base_F {
class TransportItems {
MACRO_ADDITEM(ACE_Chemlight_Shield,12);
};
};
class IG_supplyCrate_F: ReammoBox_F {
class TransportItems {
MACRO_ADDITEM(ACE_Chemlight_Shield,12);
};
};
class C_supplyCrate_F: ReammoBox_F {
class TransportItems {
MACRO_ADDITEM(ACE_Chemlight_Shield,12);
};
};
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(ACE_Chemlight_Shield,12);
};
class TransportMagazines {
MACRO_ADDMAGAZINE(ACE_Chemlight_Orange,20);
MACRO_ADDMAGAZINE(ACE_Chemlight_White,20);
MACRO_ADDMAGAZINE(ACE_Chemlight_HiRed,10);
MACRO_ADDMAGAZINE(ACE_Chemlight_HiYellow,10);
MACRO_ADDMAGAZINE(ACE_Chemlight_HiOrange,10);
MACRO_ADDMAGAZINE(ACE_Chemlight_HiWhite,10);
MACRO_ADDMAGAZINE(ACE_Chemlight_IR,20);
};
};
class ACE_Box_Chemlights: NATO_Box_Base {
scope = 2;
accuracy = 1;
author = ECSTRING(common,ACETeam);
displayName = CSTRING(Box_DisplayName);
transportMaxWeapons = 9002;
transportMaxMagazines = 9002;
transportMaxItems = 9002;
maximumload = 9002;
model = "\A3\weapons_F\AmmoBoxes\WpnsBox_large_F";
class TransportItems {
MACRO_ADDITEM(ACE_Chemlight_Shield,20);
};
class TransportMagazines {
MACRO_ADDMAGAZINE(Chemlight_red,20);
MACRO_ADDMAGAZINE(Chemlight_blue,20);
MACRO_ADDMAGAZINE(Chemlight_green,20);
MACRO_ADDMAGAZINE(Chemlight_yellow,20);
MACRO_ADDMAGAZINE(ACE_Chemlight_Orange,20);
MACRO_ADDMAGAZINE(ACE_Chemlight_White,20);
MACRO_ADDMAGAZINE(ACE_Chemlight_HiRed,10);
MACRO_ADDMAGAZINE(ACE_Chemlight_HiYellow,10);
MACRO_ADDMAGAZINE(ACE_Chemlight_HiOrange,10);
MACRO_ADDMAGAZINE(ACE_Chemlight_HiWhite,10);
MACRO_ADDMAGAZINE(ACE_Chemlight_IR,20);
};
class AnimationSources {
class Ammo_source {
source = "user";
animPeriod = 1;
initPhase = 0;
};
class AmmoOrd_source {
source = "user";
animPeriod = 1;
initPhase = 1;
};
class Grenades_source {
source = "user";
animPeriod = 1;
initPhase = 1;
};
class Support_source {
source = "user";
animPeriod = 1;
initPhase = 1;
};
};
};
};

View File

@ -0,0 +1,145 @@
class CfgWeapons {
class GrenadeLauncher;
class Throw: GrenadeLauncher {
muzzles[] += {"ACE_Chemlight_OrangeMuzzle","ACE_Chemlight_WhiteMuzzle","ACE_Chemlight_HiRedMuzzle","ACE_Chemlight_HiYellowMuzzle","ACE_Chemlight_HiOrangeMuzzle","ACE_Chemlight_HiWhiteMuzzle","ACE_Chemlight_IRMuzzle"};
class ThrowMuzzle;
class ACE_Chemlight_OrangeMuzzle: ThrowMuzzle {
magazines[] = {"ACE_Chemlight_Orange"};
};
class ACE_Chemlight_WhiteMuzzle: ThrowMuzzle {
magazines[] = {"ACE_Chemlight_White"};
};
class ACE_Chemlight_HiRedMuzzle: ThrowMuzzle {
magazines[] = {"ACE_Chemlight_HiRed"};
};
class ACE_Chemlight_HiYellowMuzzle: ThrowMuzzle {
magazines[] = {"ACE_Chemlight_HiYellow"};
};
class ACE_Chemlight_HiOrangeMuzzle: ThrowMuzzle {
magazines[] = {"ACE_Chemlight_HiOrange"};
};
class ACE_Chemlight_HiWhiteMuzzle: ThrowMuzzle {
magazines[] = {"ACE_Chemlight_HiWhite"};
};
class ACE_Chemlight_IRMuzzle: ThrowMuzzle {
magazines[] = {"ACE_Chemlight_IR"};
};
};
class ACE_ItemCore;
class InventoryItem_Base_F;
class ACE_Chemlight_Shield: ACE_ItemCore {
author = ECSTRING(common,ACETeam);
displayName = CSTRING(Shield_Empty_DisplayName);
descriptionShort = CSTRING(Shield_Empty_DescriptionShort);
model = "\A3\weapons_F\ammo\mag_univ.p3d";
picture = QPATHTOF(UI\ace_chemlight_shield_x_ca.paa);
scope = 1;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
};
};
class ACE_Chemlight_Shield_Green: ACE_ItemCore {
ACE_Chemlight = "Chemlight_green";
author = ECSTRING(common,ACETeam);
displayName = CSTRING(Shield_Green_DisplayName);
descriptionShort = CSTRING(Shield_Empty_DescriptionShort);
model = "\A3\weapons_F\ammo\mag_univ.p3d";
picture = QPATHTOF(UI\ace_chemlight_shield_green_x_ca.paa);
scope = 1;
class ItemInfo: InventoryItem_Base_F {
mass = 1;
class FlashLight {
ACE_Flashlight_Colour = "green";
ACE_Flashlight_Beam = QPATHTOF(UI\chemlight_shield_beam_green_ca.paa);
ACE_Flashlight_Size = 0.8;
};
};
};
class ACE_Chemlight_Shield_Red: ACE_Chemlight_Shield_Green {
ACE_Chemlight = "Chemlight_red";
displayName = CSTRING(Shield_Red_DisplayName);
descriptionShort = CSTRING(Shield_Green_DescriptionShort);
picture = QPATHTOF(UI\ace_chemlight_shield_red_x_ca.paa);
class ItemInfo: InventoryItem_Base_F {
mass = 1;
class FlashLight {
ACE_Flashlight_Colour = "red";
ACE_Flashlight_Beam = QPATHTOF(UI\chemlight_shield_beam_red_ca.paa);
ACE_Flashlight_Size = 0.8;
};
};
};
class ACE_Chemlight_Shield_Blue: ACE_Chemlight_Shield_Green {
ACE_Chemlight = "Chemlight_blue";
displayName = CSTRING(Shield_Blue_DisplayName);
descriptionShort = CSTRING(Shield_Blue_DescriptionShort);
picture = QPATHTOF(UI\ace_chemlight_shield_blue_x_ca.paa);
class ItemInfo: InventoryItem_Base_F {
mass = 1;
class FlashLight {
ACE_Flashlight_Colour = "blue";
ACE_Flashlight_Beam = QPATHTOF(UI\chemlight_shield_beam_blue_ca.paa);
ACE_Flashlight_Size = 0.8;
};
};
};
class ACE_Chemlight_Shield_Yellow: ACE_Chemlight_Shield_Green {
ACE_Chemlight = "Chemlight_yellow";
displayName = CSTRING(Shield_Yellow_DisplayName);
descriptionShort = CSTRING(Shield_Yellow_DescriptionShort);
picture = QPATHTOF(UI\ace_chemlight_shield_yellow_x_ca.paa);
class ItemInfo: InventoryItem_Base_F {
mass = 1;
class FlashLight {
ACE_Flashlight_Colour = "yellow";
ACE_Flashlight_Beam = QPATHTOF(UI\chemlight_shield_beam_yellow_ca.paa);
ACE_Flashlight_Size = 0.8;
};
};
};
class ACE_Chemlight_Shield_Orange: ACE_Chemlight_Shield_Green {
ACE_Chemlight = "ACE_Chemlight_Orange";
displayName = CSTRING(Shield_Orange_DisplayName);
descriptionShort = CSTRING(Shield_Orange_DescriptionShort);
picture = QPATHTOF(UI\ace_chemlight_shield_orange_x_ca.paa);
class ItemInfo: InventoryItem_Base_F {
mass = 1;
class FlashLight {
ACE_Flashlight_Colour = "orange";
ACE_Flashlight_Beam = QPATHTOF(UI\chemlight_shield_beam_orange_ca.paa);
ACE_Flashlight_Size = 0.8;
};
};
};
class ACE_Chemlight_Shield_White: ACE_Chemlight_Shield_Green {
ACE_Chemlight = "ACE_Chemlight_White";
displayName = CSTRING(Shield_White_DisplayName);
descriptionShort = CSTRING(Shield_White_DescriptionShort);
picture = QPATHTOF(UI\ace_chemlight_shield_white_x_ca.paa);
class ItemInfo: InventoryItem_Base_F {
mass = 1;
class FlashLight {
ACE_Flashlight_Colour = "white";
ACE_Flashlight_Beam = QPATHTOF(UI\chemlight_shield_beam_white_ca.paa);
ACE_Flashlight_Size = 0.8;
};
};
};
};

View File

@ -0,0 +1,49 @@
class ACE_ChemlightEffect_Orange {
class Light1 {
simulation = "light";
type = "ACE_ChemlightLight_Orange";
};
};
class ACE_ChemlightEffect_White {
class Light1 {
simulation = "light";
type = "ACE_ChemlightLight_White";
};
};
class ACE_ChemlightEffect_HiRed {
class Light1 {
simulation = "light";
type = "ACE_ChemlightLight_HiRed";
};
};
class ACE_ChemlightEffect_HiYellow {
class Light1 {
simulation = "light";
type = "ACE_ChemlightLight_HiYellow";
};
};
class ACE_ChemlightEffect_HiOrange {
class Light1 {
simulation = "light";
type = "ACE_ChemlightLight_HiOrange";
};
};
class ACE_ChemlightEffect_HiWhite {
class Light1 {
simulation = "light";
type = "ACE_ChemlightLight_HiWhite";
};
};
class ACE_ChemlightEffect_IR {
class Light1 {
simulation = "light";
type = "ACE_ChemlightLight_IR";
};
};

View File

@ -0,0 +1,11 @@
ace_chemlights
============
Enhances chemlights and makes them more realistic.
## Maintainers
The people responsible for merging changes to this component or answering potential questions.
- [voiper](https://github.com/voiperr)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,9 @@
PREP(compileChemlightMenu);
PREP(getShieldComponents);
PREP(initIR);
PREP(isIRClass);
PREP(prepShield);
PREP(removeIR);
PREP(throwEH);
PREP(throwIR);

View File

@ -0,0 +1,7 @@
#include "script_component.hpp"
if (!hasInterface) exitWith {};
["firedPlayer", DFUNC(throwEH)] call EFUNC(common,addEventHandler);
["firedPlayerNonLocal", DFUNC(throwEH)] call EFUNC(common,addEventHandler);
["firedNonPlayer", DFUNC(throwEH)] call EFUNC(common,addEventHandler);

View File

@ -0,0 +1,8 @@
#include "script_component.hpp"
ADDON = false;
LOG(MSG_INIT);
#include "XEH_PREP.hpp"
ADDON = true;

View File

@ -0,0 +1,3 @@
#include "script_component.hpp"
#include "XEH_PREP.hpp"

View File

@ -0,0 +1,23 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {"ACE_Box_Chemlights","ACE_Item_Chemlight_Shield","ACE_Item_Chemlight_Shield_Green","ACE_Item_Chemlight_Shield_Red","ACE_Item_Chemlight_Shield_Blue","ACE_Item_Chemlight_Shield_Yellow","ACE_Item_Chemlight_Shield_Orange","ACE_Item_Chemlight_Shield_White"};
weapons[] = {"ACE_Chemlight_Shield", "ACE_Chemlight_Shield_Green","ACE_Chemlight_Shield_Red","ACE_Chemlight_Shield_Blue","ACE_Chemlight_Shield_Yellow","ACE_Chemlight_Shield_Orange","ACE_Chemlight_Shield_White"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author = ECSTRING(common,ACETeam);
authors[] = {"voiper"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "CfgMagazines.hpp"
#include "CfgAmmo.hpp"
#include "CfgLights.hpp"
#include "Effects.hpp"

View File

@ -0,0 +1,40 @@
/*
* Author: voiper
* Compile list of chemlight classnames and add to the "Chemlight shield" parent menu.
*
* Arguments:
* 0: Vehicle <OBJECT>
* 1: Player <OBJECT>
* 3: Parameters <ARRAY>
*
* Return value:
* None
*
* Example:
* [_player, _player, []] call ace_chemlights_fnc_compileChemlightMenu;
*
* Public: No
*/
#include "script_component.hpp"
params ["", "_player", "_args"];
private _actions = [];
private _chemlights = [_player] call FUNC(getShieldComponents);
//add all carried chemlight menus
{
private _config = (configFile >> "CfgMagazines" >> _x);
private _icon = getText (_config >> "picture");
private _shieldClass = getText (_config >> "ACE_Chemlight_Shield");
private _displayName = getText (configFile >> "CfgWeapons" >> _shieldClass >> "displayName");
_displayName = format [localize LSTRING(Action_Prepare), _displayName];
private _statement = {_this call FUNC(prepShield)};
private _action = [_x, _displayName, _icon, _statement, {true}, {}, [_x, _shieldClass]] call EFUNC(interact_menu,createAction);
_actions pushBack [_action, [], _player];
} forEach _chemlights;
_actions

View File

@ -0,0 +1,31 @@
/*
* Author: voiper
* Check a unit for whether they're carrying a chemlight shield and a chemlight.
*
* Arguments:
* 0: Unit to check <OBJECT>
*
* Return value:
* List of carried chemlight classnames <ARRAY>
*
* Example:
* [ACE_player] call ace_chemlights_fnc_getShieldComponents;
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit"];
private _components = [];
private _items = itemsWithMagazines _unit;
if !("ACE_Chemlight_Shield" in _items) exitWith {_components};
{
if ((_x isKindOf ["Chemlight_green", configFile >> "CfgMagazines"]) && {getText (configFile >> "CfgMagazines" >> _x >> "ACE_Chemlight_Shield") != ""}) then {
_components pushBackUnique _x;
};
} forEach _items;
_components

View File

@ -0,0 +1,31 @@
/*
* Author: voiper
* Spawn IR marker for dummy IR physX object.
*
* Arguments:
* 1: Dummy IR physX <OBJECT>
*
* Return Value:
* None
*
* Example:
* [_object] call ace_chemlights_fnc_initIR;
*
* Public: No
*/
#include "script_component.hpp"
params ["_dummy"];
private _chemlightClass = getText (configFile >> "CfgVehicles" >> typeOf _dummy >> "ACE_Attachable");
private _config = configFile >> "CfgAmmo" >> _chemlightClass;
private _delay = getNumber (_config >> "explosionTime");
private _lifeTime = getNumber (_config >> "timeToLive");
[{
params ["_dummy", "_lifeTime"];
private _IRMarker = "ACE_Chemlight_IR_Marker" createVehicle [0,0,0];
_IRMarker attachTo [_dummy, [0,0,0]];
[FUNC(removeIR), [_dummy, _IRMarker], _lifeTime] call CBA_fnc_waitAndExecute;
}, [_dummy, _lifeTime], _delay] call CBA_fnc_waitAndExecute;

View File

@ -0,0 +1,23 @@
/*
* Author: voiper
* Check if an ammo classname is an IR chemlight.
*
* Arguments:
* 1: Projectile or ammo classname <OBJECT> or <STRING>
*
* Return Value:
* Is IR chemlight? <BOOL>
*
* Example:
* ["Chemlight_blue"] call ace_chemlights_fnc_isIRClass;
*
* Public: No
*/
#include "script_component.hpp"
params [["_input", "", ["", objNull]]];
private _class = if (typeName _input == "OBJECT") then {typeOf _input} else {_input};
isText (configFile >> "CfgAmmo" >> _class >> "ACE_Chemlight_IR")

View File

@ -0,0 +1,35 @@
/*
* Author: voiper
* Combine a chemlight shield item and a chemlight item into a light.
*
* Arguments:
* 0: Target unit <OBJECT>
* 1: Activator Unit (player) <OBJECT>
* 2: Chemlight class, chemlight shield class <ARRAY>
*
* Return value:
* None
*
* Example:
* [_player, _player, ["Chemlight_Green", "ACE_Chemlight_Shield_Green"]] call ace_chemlights_fnc_prepShield;
*
* Public: No
*/
#include "script_component.hpp"
params ["_target", "_unit", "_args"];
_args params ["_chemlight", "_shieldClass"];
private _cfg = (configFile >> "CfgWeapons" >> _shieldClass);
private _displayName = getText (_cfg >> "displayName");
private _picture = getText (_cfg >> "picture");
private _text = format [localize LSTRING(Action_Prepare_Done), _displayName];
//we don't need to check for space, because it's always 2g -> 1g
_unit removeItem _chemlight;
_unit removeItem "ACE_Chemlight_Shield";
_unit addItem _shieldClass;
[_text, _picture] call EFUNC(common,displayTextPicture);
playSound3D ["A3\sounds_f\weapons\Other\dry4.wss", objNull, false, eyePos _unit, 2, 2, 10];

View File

@ -0,0 +1,28 @@
/*
* Author: voiper
* Kill chemlight and any dummy objects attached to it.
*
* Arguments:
* 1: Chemlight object <OBJECT>
* 2: Light marker vehicle <OBJECT>
*
* Return Value:
* None
*
* Example:
* [_chemlight, _lightMarker] call ace_chemlights_fnc_removeIR;
*
* Public: No
*/
#include "script_component.hpp"
params ["_chemlight", "_lightMarker"];
if (!isNull _lightMarker) then {
detach _lightMarker;
deleteVehicle _lightMarker;
};
if (!isNull _chemlight) then {
deleteVehicle _chemlight;
};

View File

@ -0,0 +1,32 @@
/*
* Author: commy2, voiper
* Fired EH, for handling chemlight ThrowMuzzles.
*
* Arguments:
* None. Parameters inherited from EFUNC(common,firedEH)
*
* Return Value:
* None
*
* Example:
* [clientFiredBIS-XEH] call ace_chemlights_fnc_throwEH;
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
if ((_weapon != "Throw") || {!(_ammo isKindOf ["Chemlight_base", configFile >> "CfgAmmo"])}) exitWith {};
// http://feedback.arma3.com/view.php?id=12340
if (isNull _projectile) then {
_projectile = nearestObject [_unit, _ammo];
};
if (local _unit) then {
if ([_ammo] call FUNC(isIRClass)) then {
[{_this call FUNC(throwIR)}, [_projectile, _ammo]] call CBA_fnc_execNextFrame;
};
};

View File

@ -0,0 +1,31 @@
/*
* Author: voiper
* Create and throw IR chemlight.
*
* Arguments:
* 1: Original throw projectile <OBJECT>
* 2: Class of projectile <STRING>
*
* Return Value:
* None
*
* Example:
* [_projectile, _ammoType] call ace_chemlights_fnc_throwIR;
*
* Public: No
*/
#include "script_component.hpp"
params ["_projectile", "_ammo"];
private _config = configFile >> "CfgAmmo" >> _ammo;
private _dummyClass = getText (_config >> "ACE_Chemlight_IR");
private _pos = getPosATL _projectile;
private _velocity = velocity _projectile;
deleteVehicle _projectile;
private _dummy = _dummyClass createVehicle _pos;
_dummy setPosATL _pos;
[_dummy, 90, 0] call BIS_fnc_setPitchBank;
_dummy setVelocity _velocity;

View File

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

View File

@ -0,0 +1,17 @@
#define COMPONENT chemlights
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_CHEMLIGHTS
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_CHEMLIGHTS
#define DEBUG_SETTINGS DEBUG_SETTINGS_CHEMLIGHTS
#endif
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Chemlights">
<Key ID="STR_ACE_Chemlights_Action_Chemlights">
<English>Chemlights</English>
</Key>
<Key ID="STR_ACE_Chemlights_Action_Prepare">
<English>Prepare %1</English>
</Key>
<Key ID="STR_ACE_Chemlights_Action_Prepare_Done">
<English>%1&lt;br/&gt;Prepared</English>
</Key>
<Key ID="STR_ACE_Chemlights_Inventory_Full">
<English>No inventory space</English>
<German>Kein Platz im Inventar</German>
<Spanish>Sin espacio en inventario</Spanish>
<Polish>Brak miejsca w ekwipunku</Polish>
<French>Pas de place dans l'inventaire</French>
<Czech>Nedostatek místa v inventáři</Czech>
<Portuguese>Sem espaço no inventário</Portuguese>
<Italian>Non hai più spazio</Italian>
<Hungarian>Nincs több hely</Hungarian>
<Russian>В инвентаре нет места</Russian>
</Key>
<Key ID="STR_ACE_Chemlights_Box_DisplayName">
<English>[ACE] Chemlights</English>
</Key>
<Key ID="STR_ACE_Chemlights_Orange_DisplayName">
<English>Chemlight (Orange)</English>
</Key>
<Key ID="STR_ACE_Chemlights_Orange_DisplayNameShort">
<English>Orange Light</English>
</Key>
<Key ID="STR_ACE_Chemlights_Orange_DescriptionShort">
<English>Type: Light - Orange&lt;br /&gt;Rounds: 1&lt;br /&gt;Used in: Hand</English>
</Key>
<Key ID="STR_ACE_Chemlights_White_DisplayName">
<English>Chemlight (White)</English>
</Key>
<Key ID="STR_ACE_Chemlights_White_DisplayNameShort">
<English>White Light</English>
</Key>
<Key ID="STR_ACE_Chemlights_White_DescriptionShort">
<English>Type: Light - White&lt;br /&gt;Rounds: 1&lt;br /&gt;Used in: Hand</English>
</Key>
<Key ID="STR_ACE_Chemlights_HiRed_DisplayName">
<English>Chemlight (Hi Red)</English>
</Key>
<Key ID="STR_ACE_Chemlights_HiRed_DisplayNameShort">
<English>Red Hi Light</English>
</Key>
<Key ID="STR_ACE_Chemlights_HiRed_DescriptionShort">
<English>Type: Light - Red Hi (5 minute)&lt;br /&gt;Rounds: 1&lt;br /&gt;Used in: Hand</English>
</Key>
<Key ID="STR_ACE_Chemlights_HiYellow_DisplayName">
<English>Chemlight (Hi Yellow)</English>
</Key>
<Key ID="STR_ACE_Chemlights_HiYellow_DisplayNameShort">
<English>Yellow Hi Light</English>
</Key>
<Key ID="STR_ACE_Chemlights_HiYellow_DescriptionShort">
<English>Type: Light - Yellow Hi (5 minute)&lt;br /&gt;Rounds: 1&lt;br /&gt;Used in: Hand</English>
</Key>
<Key ID="STR_ACE_Chemlights_HiOrange_DisplayName">
<English>Chemlight (Hi Orange)</English>
</Key>
<Key ID="STR_ACE_Chemlights_HiOrange_DisplayNameShort">
<English>Orange Hi Light</English>
</Key>
<Key ID="STR_ACE_Chemlights_HiOrange_DescriptionShort">
<English>Type: Light - Orange Hi (5 minute)&lt;br /&gt;Rounds: 1&lt;br /&gt;Used in: Hand</English>
</Key>
<Key ID="STR_ACE_Chemlights_HiWhite_DisplayName">
<English>Chemlight (Hi White)</English>
</Key>
<Key ID="STR_ACE_Chemlights_HiWhite_DisplayNameShort">
<English>White Hi Light</English>
</Key>
<Key ID="STR_ACE_Chemlights_HiWhite_DescriptionShort">
<English>Type: Light - White Hi (5 minute)&lt;br /&gt;Rounds: 1&lt;br /&gt;Used in: Hand</English>
</Key>
<Key ID="STR_ACE_Chemlights_IR_DisplayName">
<English>Chemlight (IR)</English>
</Key>
<Key ID="STR_ACE_Chemlights_IR_DisplayNameShort">
<English>IR Light</English>
</Key>
<Key ID="STR_ACE_Chemlights_IR_DescriptionShort">
<English>Type: Light - Infrared&lt;br /&gt;Rounds: 1&lt;br /&gt;Used in: Hand</English>
</Key>
<Key ID="STR_ACE_Chemlights_Shield_Empty_DisplayName">
<English>Chemlight Shield (Empty)</English>
</Key>
<Key ID="STR_ACE_Chemlights_Shield_Empty_DescriptionShort">
<English>Shield for chemlights. Combine with chemlight to prepare reading light.</English>
</Key>
<Key ID="STR_ACE_Chemlights_Shield_Green_DisplayName">
<English>Chemlight Shield (Green)</English>
</Key>
<Key ID="STR_ACE_Chemlights_Shield_Green_DescriptionShort">
<English>Green reading light.</English>
</Key>
<Key ID="STR_ACE_Chemlights_Shield_Red_DisplayName">
<English>Chemlight Shield (Red)</English>
</Key>
<Key ID="STR_ACE_Chemlights_Shield_Red_DescriptionShort">
<English>Red reading light.</English>
</Key>
<Key ID="STR_ACE_Chemlights_Shield_Blue_DisplayName">
<English>Chemlight Shield (Blue)</English>
</Key>
<Key ID="STR_ACE_Chemlights_Shield_Blue_DescriptionShort">
<English>Blue reading light.</English>
</Key>
<Key ID="STR_ACE_Chemlights_Shield_Yellow_DisplayName">
<English>Chemlight Shield (Yellow)</English>
</Key>
<Key ID="STR_ACE_Chemlights_Shield_Yellow_DescriptionShort">
<English>Yellow reading light.</English>
</Key>
<Key ID="STR_ACE_Chemlights_Shield_Orange_DisplayName">
<English>Chemlight Shield (Orange)</English>
</Key>
<Key ID="STR_ACE_Chemlights_Shield_Orange_DescriptionShort">
<English>Orange reading light.</English>
</Key>
<Key ID="STR_ACE_Chemlights_Shield_White_DisplayName">
<English>Chemlight Shield (White)</English>
</Key>
<Key ID="STR_ACE_Chemlights_Shield_White_DescriptionShort">
<English>White reading light.</English>
</Key>
</Package>
</Project>