mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
commit
04e6acfc6a
addons
apl/data
sandbag
$PBOPREFIX$CfgEventHandlers.hppCfgVehicles.hppCfgWeapons.hppREADME.md
UI
XEH_postInit.sqfXEH_preInit.sqfconfig.cppdata
ace_sandbag_build.p3dace_sandbag_m.p3dace_sandbag_nogeo.p3dbag.rvmatbag_co.paabag_destruct.rvmatbag_nohq.paabag_smdi.paam_sandbag_ca.paamodel.cfg
functions
fnc_canDeploy.sqffnc_carry.sqffnc_deploy.sqffnc_deployCancel.sqffnc_deployConfirm.sqffnc_drop.sqffnc_handleScrollWheel.sqffnc_pickup.sqfscript_component.hpp
script_component.hppstringtable.xml
BIN
addons/apl/data/vehicle_destr1024_1024_mc.paa
Normal file
BIN
addons/apl/data/vehicle_destr1024_1024_mc.paa
Normal file
Binary file not shown.
BIN
addons/apl/data/vehicle_destr1024_1024_smdi.paa
Normal file
BIN
addons/apl/data/vehicle_destr1024_1024_smdi.paa
Normal file
Binary file not shown.
1
addons/sandbag/$PBOPREFIX$
Normal file
1
addons/sandbag/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\sandbag
|
19
addons/sandbag/CfgEventHandlers.hpp
Normal file
19
addons/sandbag/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
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_SandbagObject {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DEFUNC(dragging,initObject));
|
||||
};
|
||||
};
|
||||
};
|
113
addons/sandbag/CfgVehicles.hpp
Normal file
113
addons/sandbag/CfgVehicles.hpp
Normal file
@ -0,0 +1,113 @@
|
||||
class CfgVehicles {
|
||||
class Man;
|
||||
class CAManBase: Man {
|
||||
class ACE_SelfActions {
|
||||
class ACE_Sandbags {
|
||||
displayName = $STR_ACE_AC_BUILD;
|
||||
condition = QUOTE(call FUNC(canDeploy));
|
||||
statement = QUOTE(call FUNC(deploy));
|
||||
exceptions[] = {"isNotSwimming", "isNotInside"};
|
||||
showDisabled = 1;
|
||||
priority = 4;
|
||||
icon = PATHTOF(UI\icon_sandbag_ca.paa);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Item_Base_F;
|
||||
class ACE_Item_Sandbag_empty: Item_Base_F {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
scope = 2;
|
||||
scopeCurator = 2;
|
||||
displayName = "$STR_ACE_M_SBEMPTY";
|
||||
vehicleClass = "Items";
|
||||
class TransportItems {
|
||||
class ACE_Sandbag_empty {
|
||||
name = "ACE_Sandbag_empty";
|
||||
count = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
/*
|
||||
class ACE_Item_Sandbag: Item_Base_F {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
scope = 2;
|
||||
scopeCurator = 2;
|
||||
displayName = "$STR_ACE_Sandbag";
|
||||
vehicleClass = "Items";
|
||||
class TransportItems {
|
||||
class ACE_Sandbag {
|
||||
name = "ACE_Sandbag";
|
||||
count = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
*/
|
||||
class thingX;
|
||||
class ACE_SandbagObject: thingX {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
XEH_ENABLED;
|
||||
scope = 1;
|
||||
side = -1;
|
||||
model = PATHTOF(data\ace_sandbag_build.p3d);
|
||||
displayName = $STR_ACE_Sandbag;
|
||||
typicalCargo[] = {};
|
||||
armor = 12000; // Withstand 200 5.56 bullets before sandbag hull is cheese
|
||||
mapSize = 0.4;
|
||||
nameSound = "Bunker";
|
||||
icon = PATHTOF(UI\icon_sandbag_ca.paa);
|
||||
accuracy = 1000;
|
||||
|
||||
destrType = "DestructDefault";
|
||||
|
||||
class DestructionEffects {};
|
||||
class Damage {
|
||||
tex[] = {};
|
||||
mat[] = {
|
||||
"z\ace\addons\sandbag\data\bag_destruct.rvmat",
|
||||
"z\ace\addons\sandbag\data\bag_destruct.rvmat",
|
||||
"z\ace\addons\sandbag\data\bag_destruct.rvmat"
|
||||
};
|
||||
};
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
selection = "";
|
||||
distance = 5;
|
||||
condition = "true";
|
||||
class ACE_PickUp {
|
||||
selection = "";
|
||||
displayName = "$STR_ACE_AC_PICKUPSB";
|
||||
distance = 4;
|
||||
condition = QUOTE(!(_player getVariable [ARR_2('ace_sandbag_usingSandbag',false)]));
|
||||
statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickup));
|
||||
showDisabled = 0;
|
||||
exceptions[] = {};
|
||||
priority = 5;
|
||||
icon = PATHTOF(UI\icon_sandbag_ca.paa);
|
||||
};
|
||||
class ACE_Carry {
|
||||
selection = "";
|
||||
displayName = "$STR_ACE_AC_CARRYSB";
|
||||
distance = 4;
|
||||
condition = QUOTE(!(_player getVariable [ARR_2('ace_sandbag_usingSandbag',false)]));
|
||||
statement = QUOTE([ARR_2(_target,_player)] call FUNC(carry));
|
||||
showDisabled = 0;
|
||||
exceptions[] = {};
|
||||
priority = 5;
|
||||
icon = PATHTOF(UI\icon_sandbag_ca.paa);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
class ACE_SandbagObject_NoGeo: ACE_SandbagObject {
|
||||
scope = 1;
|
||||
model = PATHTOF(data\ace_sandbag_nogeo.p3d);
|
||||
};
|
||||
|
||||
class Box_NATO_Support_F;
|
||||
class ACE_Box_Misc: Box_NATO_Support_F {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(ACE_Sandbag_empty,50);
|
||||
};
|
||||
};
|
||||
};
|
30
addons/sandbag/CfgWeapons.hpp
Normal file
30
addons/sandbag/CfgWeapons.hpp
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
class CfgWeapons {
|
||||
class ACE_ItemCore;
|
||||
class InventoryItem_Base_F;
|
||||
|
||||
class ACE_Sandbag_empty: ACE_ItemCore {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
scope = 2;
|
||||
displayName = "$STR_ACE_M_SBEMPTY";
|
||||
model = PATHTOF(data\ace_sandbag_m.p3d);
|
||||
picture = PATHTOF(data\m_sandbag_ca.paa);
|
||||
|
||||
class ItemInfo: InventoryItem_Base_F {
|
||||
mass = 8;
|
||||
};
|
||||
};
|
||||
/*
|
||||
class ACE_Sandbag: ACE_ItemCore {
|
||||
author = "$STR_ACE_Common_ACETeam";
|
||||
scope = 2;
|
||||
displayName = "$STR_ACE_Sandbag";
|
||||
model = PATHTOF(data\ace_sandbag_build.p3d);
|
||||
picture = PATHTOF(data\m_sandbag_ca.paa);
|
||||
|
||||
class ItemInfo: InventoryItem_Base_F {
|
||||
mass = 160;
|
||||
};
|
||||
};
|
||||
*/
|
||||
};
|
10
addons/sandbag/README.md
Normal file
10
addons/sandbag/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
ace_sandbag
|
||||
===============
|
||||
|
||||
Stackable sandbags.
|
||||
|
||||
## Maintainers
|
||||
|
||||
The people responsible for merging changes to this component or answering potential questions.
|
||||
|
||||
- [Ruthberg] (http://github.com/Ulteq)
|
BIN
addons/sandbag/UI/icon_sandbag_ca.paa
Normal file
BIN
addons/sandbag/UI/icon_sandbag_ca.paa
Normal file
Binary file not shown.
15
addons/sandbag/XEH_postInit.sqf
Normal file
15
addons/sandbag/XEH_postInit.sqf
Normal file
@ -0,0 +1,15 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
GVAR(placer) = objNull;
|
||||
GVAR(sandBag) = objNull;
|
||||
GVAR(deployPFH) = -1;
|
||||
GVAR(deployDirection) = 0;
|
||||
|
||||
// Cancel deploy sandbag if interact menu opened
|
||||
["interactMenuOpened", {
|
||||
if (GVAR(deployPFH) != -1 && {!isNull (GVAR(sandBag))}) then {
|
||||
call FUNC(deployCancel);
|
||||
};
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
||||
[{_this call DFUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler);
|
14
addons/sandbag/XEH_preInit.sqf
Normal file
14
addons/sandbag/XEH_preInit.sqf
Normal file
@ -0,0 +1,14 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(canDeploy);
|
||||
PREP(carry);
|
||||
PREP(deploy);
|
||||
PREP(deployCancel);
|
||||
PREP(deployConfirm);
|
||||
PREP(drop);
|
||||
PREP(handleScrollWheel);
|
||||
PREP(pickup);
|
||||
|
||||
ADDON = true;
|
16
addons/sandbag/config.cpp
Normal file
16
addons/sandbag/config.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {"ACE_Item_Sandbag", "ACE_Item_Sandbag_empty"};
|
||||
weapons[] = {"ACE_Sandbag", "ACE_Sandbag_empty"};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_interaction"};
|
||||
author[] = {"Rocko", "Ruthberg"};
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgWeapons.hpp"
|
BIN
addons/sandbag/data/ace_sandbag_build.p3d
Normal file
BIN
addons/sandbag/data/ace_sandbag_build.p3d
Normal file
Binary file not shown.
BIN
addons/sandbag/data/ace_sandbag_m.p3d
Normal file
BIN
addons/sandbag/data/ace_sandbag_m.p3d
Normal file
Binary file not shown.
BIN
addons/sandbag/data/ace_sandbag_nogeo.p3d
Normal file
BIN
addons/sandbag/data/ace_sandbag_nogeo.p3d
Normal file
Binary file not shown.
132
addons/sandbag/data/bag.rvmat
Normal file
132
addons/sandbag/data/bag.rvmat
Normal file
@ -0,0 +1,132 @@
|
||||
/*
|
||||
ambient[]={0.992157,0.992157,0.992157,1.000000};
|
||||
diffuse[]={0.992157,0.992157,0.992157,1.000000};
|
||||
forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000};
|
||||
emmisive[]={0.000000,0.000000,0.000000,1.000000};
|
||||
specular[]={0.000000,0.000000,0.000000,1.000000};
|
||||
specularPower=40.000000;
|
||||
*/
|
||||
|
||||
ambient[]={1.000000,1.000000,1.000000,1.000000};
|
||||
diffuse[]={1.000000,1.000000,1.000000,1.000000};
|
||||
forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000};
|
||||
emmisive[]={0.000000,0.000000,0.000000,1.000000};
|
||||
specular[]={0.250000,0.250000,0.250000,0.250000};
|
||||
specularPower=30.000000;
|
||||
PixelShaderID="NormalMapSpecularDIMap";
|
||||
VertexShaderID="NormalMap";
|
||||
class Stage1 {
|
||||
texture="z\ace\addons\sandbag\data\bag_nohq.paa";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage2 {
|
||||
texture="z\ace\addons\sandbag\data\bag_smdi.paa";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
ambient[]={1.0, 1.0, 1.0, 1.0};
|
||||
diffuse[]={1.0, 1.0, 1.0, 1.0};
|
||||
forcedDiffuse[]={0.0, 0.0, 0.0, 0.0};
|
||||
emmisive[]={0.0, 0.0, 0.0, 0.0};
|
||||
specular[]={0.93, 0.93, 0.93, 0.0};
|
||||
specularPower=400.0;
|
||||
PixelShaderID="Super";
|
||||
VertexShaderID="Super";
|
||||
|
||||
class Stage1 {
|
||||
texture="z\ace\addons\sandbag\data\bag_nohq.paa";
|
||||
uvSource="tex";
|
||||
|
||||
class uvTransform {
|
||||
aside[]={1.0, 0.0, 0.0};
|
||||
up[]={0.0, 1.0, 0.0};
|
||||
dir[]={0.0, 0.0, 0.0};
|
||||
pos[]={0.0, 0.0, 0.0};
|
||||
};
|
||||
};
|
||||
|
||||
class Stage2 {
|
||||
texture="a3\weapons_f\data\detailmaps\metal_detail_dt.paa";
|
||||
uvSource="tex";
|
||||
|
||||
class uvTransform {
|
||||
aside[]={6.0, 0.0, 0.0};
|
||||
up[]={0.0, 3.0, 0.0};
|
||||
dir[]={0.0, 0.0, 0.0};
|
||||
pos[]={0.0, 0.0, 0.0};
|
||||
};
|
||||
};
|
||||
|
||||
class Stage3 {
|
||||
texture="#(argb,8,8,3)color(0,0,0,0,MC)";
|
||||
uvSource="tex";
|
||||
|
||||
class uvTransform {
|
||||
aside[]={1.0, 0.0, 0.0};
|
||||
up[]={0.0, 1.0, 0.0};
|
||||
dir[]={0.0, 0.0, 0.0};
|
||||
pos[]={0.0, 0.0, 0.0};
|
||||
};
|
||||
};
|
||||
|
||||
class Stage4 {
|
||||
texture="#(argb,8,8,3)color(0.8,0,0,1,AS)";
|
||||
uvSource="tex";
|
||||
|
||||
class uvTransform {
|
||||
aside[]={1.0, 0.0, 0.0};
|
||||
up[]={0.0, 1.0, 0.0};
|
||||
dir[]={0.0, 0.0, 0.0};
|
||||
pos[]={0.0, 0.0, 0.0};
|
||||
};
|
||||
};
|
||||
|
||||
class Stage5 {
|
||||
texture="z\ace\addons\sandbag\data\bag_smdi.paa";
|
||||
uvSource="tex";
|
||||
|
||||
class uvTransform {
|
||||
aside[]={1.0, 0.0, 0.0};
|
||||
up[]={0.0, 1.0, 0.0};
|
||||
dir[]={0.0, 0.0, 0.0};
|
||||
pos[]={0.0, 0.0, 0.0};
|
||||
};
|
||||
};
|
||||
|
||||
class Stage6 {
|
||||
texture="#(ai,64,64,1)fresnel(1.29,0.5)";
|
||||
uvSource="tex";
|
||||
|
||||
class uvTransform {
|
||||
aside[]={1.0, 0.0, 0.0};
|
||||
up[]={0.0, 1.0, 0.0};
|
||||
dir[]={0.0, 0.0, 0.0};
|
||||
pos[]={0.0, 0.0, 0.0};
|
||||
};
|
||||
};
|
||||
|
||||
class Stage7 {
|
||||
texture="a3\data_f\env_land_co.paa";
|
||||
uvSource="tex";
|
||||
|
||||
class uvTransform {
|
||||
aside[]={1.0, 0.0, 0.0};
|
||||
up[]={0.0, 1.0, 0.0};
|
||||
dir[]={0.0, 0.0, 0.0};
|
||||
pos[]={0.0, 0.0, 0.0};
|
||||
};
|
||||
};
|
||||
*/
|
BIN
addons/sandbag/data/bag_co.paa
Normal file
BIN
addons/sandbag/data/bag_co.paa
Normal file
Binary file not shown.
48
addons/sandbag/data/bag_destruct.rvmat
Normal file
48
addons/sandbag/data/bag_destruct.rvmat
Normal file
@ -0,0 +1,48 @@
|
||||
ambient[]={1.000000,1.000000,1.000000,1.000000};
|
||||
diffuse[]={1.000000,1.000000,1.000000,1.000000};
|
||||
forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000};
|
||||
emmisive[]={0.000000,0.000000,0.000000,1.000000};
|
||||
specular[]={0.250000,0.250000,0.250000,0.250000};
|
||||
specularPower=30.000000;
|
||||
PixelShaderID="NormalMapSpecularDIMap";
|
||||
VertexShaderID="NormalMap";
|
||||
class Stage1 {
|
||||
texture="z\ace\addons\sandbag\data\bag_nohq.paa";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage2 {
|
||||
texture="z\ace\addons\apl\data\vehicle_destr1024_1024_mc.paa";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.200000,0.000000,0.000000};
|
||||
pos[]={0.200000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage3 {
|
||||
texture="#(argb,8,8,3)color(1,1,1,0.3)";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage4 {
|
||||
texture="z\ace\addons\apl\data\vehicle_destr1024_1024_smdi.paa";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
BIN
addons/sandbag/data/bag_nohq.paa
Normal file
BIN
addons/sandbag/data/bag_nohq.paa
Normal file
Binary file not shown.
BIN
addons/sandbag/data/bag_smdi.paa
Normal file
BIN
addons/sandbag/data/bag_smdi.paa
Normal file
Binary file not shown.
BIN
addons/sandbag/data/m_sandbag_ca.paa
Normal file
BIN
addons/sandbag/data/m_sandbag_ca.paa
Normal file
Binary file not shown.
21
addons/sandbag/data/model.cfg
Normal file
21
addons/sandbag/data/model.cfg
Normal file
@ -0,0 +1,21 @@
|
||||
class CfgSkeletons {
|
||||
class Default {
|
||||
isDiscrete = 1;
|
||||
skeletonInherit = "";
|
||||
skeletonBones[] = {};
|
||||
};
|
||||
class ACE_SB_Skeleton: Default {};
|
||||
};
|
||||
|
||||
class CfgModels {
|
||||
class Default {
|
||||
sectionsInherit="";
|
||||
sections[] = {""};
|
||||
skeletonName = "";
|
||||
};
|
||||
class ace_sandbag_build {
|
||||
sectionsInherit = "Default";
|
||||
sections[] = {"zbytek"};
|
||||
skeletonName = "ACE_SB_Skeleton";
|
||||
};
|
||||
};
|
28
addons/sandbag/functions/fnc_canDeploy.sqf
Normal file
28
addons/sandbag/functions/fnc_canDeploy.sqf
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
* Checks if the player can deploy a sandbag
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* can deploy? <BOOLEAN>
|
||||
*
|
||||
* Example:
|
||||
* call ace_sandbag_fnc_canDeploy;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define SURFACE_BLACKLIST ["water", "concrete", "tarmac", "wood", "metal", "roof_tin", "roof_tiles", "wood_int", "concrete_int", "tiles_int", "metal_int", "stony", "rock", "int_concrete", "int_tiles", "int_wood", "tiling", "wavymetal", "int_metal"]
|
||||
|
||||
if !([ACE_player, "ACE_Sandbag_empty"] call EFUNC(common,hasItem)) exitWith { false };
|
||||
if (ACE_player getVariable [QGVAR(usingSandbag), false]) exitWith { false };
|
||||
if ((getPosATL ACE_player select 2) - (getPos ACE_player select 2) > 1E-5) exitWith { false };
|
||||
|
||||
private ["_surfaceClass", "_surfaceType"];
|
||||
_surfaceClass = ([surfaceType (position ACE_player), "#"] call CBA_fnc_split) select 1;
|
||||
_surfaceType = getText (configfile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron");
|
||||
|
||||
!(_surfaceType in SURFACE_BLACKLIST)
|
56
addons/sandbag/functions/fnc_carry.sqf
Normal file
56
addons/sandbag/functions/fnc_carry.sqf
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
* Carry sandbag
|
||||
*
|
||||
* Arguments:
|
||||
* 0: sandbag <OBJECT>
|
||||
* 1: unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [_sandbag, _unit] call ace_sandbag_fnc_carry;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_sandbag,_unit);
|
||||
|
||||
_unit playActionNow "PutDown";
|
||||
|
||||
_unit setVariable [QGVAR(usingSandbag), true];
|
||||
[{
|
||||
PARAMS_2(_sandbag,_unit);
|
||||
|
||||
GVAR(carrier) = ACE_player;
|
||||
|
||||
[GVAR(carrier), "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus);
|
||||
|
||||
deleteVehicle _sandbag;
|
||||
|
||||
GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0,0,0], [], 0, "NONE"];
|
||||
GVAR(sandBag) enableSimulationGlobal false;
|
||||
|
||||
// Force physx update
|
||||
{
|
||||
_x setPosASL (getPosASL _x);
|
||||
} forEach (GVAR(carrier) nearObjects ["ACE_SandbagObject", 5]);
|
||||
|
||||
GVAR(carryPFH) = [{
|
||||
if (GVAR(carrier) != ACE_player) exitWith {
|
||||
call FUNC(drop);
|
||||
};
|
||||
GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]));
|
||||
GVAR(sandBag) setDir (GVAR(deployDirection) + getDir ACE_player);
|
||||
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
[localize "STR_ACE_AC_DROP", "", ""] call EFUNC(interaction,showMouseHint);
|
||||
|
||||
GVAR(carrier) setVariable [QGVAR(drop),
|
||||
[GVAR(carrier), "DefaultAction",
|
||||
{GVAR(carryPFH) != -1 && !isNull (GVAR(sandBag))},
|
||||
{call FUNC(drop);}
|
||||
] call EFUNC(common,AddActionEventHandler)];
|
||||
}, [_sandbag, _unit], 1, 0.5] call EFUNC(common,waitAndExecute);
|
47
addons/sandbag/functions/fnc_deploy.sqf
Normal file
47
addons/sandbag/functions/fnc_deploy.sqf
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Author: Garth 'L-H' de Wet, Ruthberg
|
||||
* Starts the deploy process for sandbags.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_sandbag_fnc_deploy;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
closeDialog 0;
|
||||
|
||||
GVAR(placer) = ACE_player;
|
||||
|
||||
[GVAR(placer), "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus);
|
||||
|
||||
GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0,0,0], [], 0, "NONE"];
|
||||
GVAR(sandBag) enableSimulationGlobal false;
|
||||
|
||||
GVAR(deployPFH) = [{
|
||||
if (GVAR(placer) != ACE_player) exitWith {
|
||||
call FUNC(deployCancel);
|
||||
};
|
||||
GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]));
|
||||
GVAR(sandBag) setDir (GVAR(deployDirection) + getDir ACE_player);
|
||||
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
[localize "STR_ACE_AC_CONF", localize "STR_ACE_AC_CANCEL", localize "STR_ACE_Sandbag_ScrollAction"] call EFUNC(interaction,showMouseHint);
|
||||
|
||||
GVAR(placer) setVariable [QGVAR(Deploy),
|
||||
[GVAR(placer), "DefaultAction",
|
||||
{GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))},
|
||||
{call FUNC(deployConfirm);}
|
||||
] call EFUNC(common,AddActionEventHandler)];
|
||||
|
||||
GVAR(placer) setVariable [QGVAR(Cancel),
|
||||
[GVAR(placer), "zoomtemp",
|
||||
{GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))},
|
||||
{call FUNC(deployCancel);}
|
||||
] call EFUNC(common,AddActionEventHandler)];
|
35
addons/sandbag/functions/fnc_deployCancel.sqf
Normal file
35
addons/sandbag/functions/fnc_deployCancel.sqf
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Author: Garth 'L-H' de Wet, Ruthberg
|
||||
* Cancels sandbag deployment
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_sandbag_fnc_deployCancel;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (isNull GVAR(placer)) exitWith {};
|
||||
|
||||
[GVAR(deployPFH)] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
if (!isNull (GVAR(sandBag))) then {
|
||||
deleteVehicle GVAR(sandBag);
|
||||
};
|
||||
|
||||
[GVAR(placer), "ACE_Sandbag", false] call EFUNC(Common,setForceWalkStatus);
|
||||
|
||||
call EFUNC(interaction,hideMouseHint);
|
||||
[GVAR(placer), "DefaultAction", GVAR(placer) getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
[GVAR(placer), "zoomtemp", GVAR(placer) getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
|
||||
GVAR(placer) addItem "ACE_Sandbag_empty";
|
||||
|
||||
GVAR(sandBag) = objNull;
|
||||
GVAR(placer) = objNull;
|
51
addons/sandbag/functions/fnc_deployConfirm.sqf
Normal file
51
addons/sandbag/functions/fnc_deployConfirm.sqf
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Author: Garth 'L-H' de Wet, Ruthberg
|
||||
* Confirms sandbag deployment
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_sandbag_fnc_deployConfirm;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (isNull GVAR(sandBag) || isNull GVAR(placer)) exitWith {};
|
||||
|
||||
[GVAR(deployPFH)] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
[GVAR(placer), "ACE_Sandbag", false] call EFUNC(Common,setForceWalkStatus);
|
||||
[GVAR(placer), "DefaultAction", GVAR(placer) getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
[GVAR(placer), "zoomtemp", GVAR(placer) getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
|
||||
call EFUNC(interaction,hideMouseHint);
|
||||
|
||||
GVAR(placer) playActionNow "PutDown";
|
||||
|
||||
GVAR(placer) setVariable [QGVAR(usingSandbag), true];
|
||||
[{
|
||||
_this setVariable [QGVAR(usingSandbag), false];
|
||||
}, GVAR(placer), 1.5, 0.5] call EFUNC(common,waitAndExecute);
|
||||
|
||||
[{
|
||||
private ["_sandBag", "_position", "_direction"];
|
||||
_position = getPosASL GVAR(sandBag);
|
||||
_direction = getDir GVAR(sandBag);
|
||||
|
||||
deleteVehicle GVAR(sandBag);
|
||||
|
||||
_sandBag = createVehicle ["ACE_SandbagObject", [0,0,0], [], 0, "NONE"];
|
||||
_sandBag enableSimulationGlobal true;
|
||||
_sandBag setPosASL _position;
|
||||
_sandBag setDir _direction;
|
||||
|
||||
GVAR(placer) removeItem "ACE_Sandbag_empty";
|
||||
|
||||
GVAR(sandBag) = objNull;
|
||||
GVAR(placer) = objNull;
|
||||
}, [], 1.0, 0.5] call EFUNC(common,waitAndExecute);
|
47
addons/sandbag/functions/fnc_drop.sqf
Normal file
47
addons/sandbag/functions/fnc_drop.sqf
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Author: Garth 'L-H' de Wet, Ruthberg
|
||||
* Drop sandbag
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_sandbag_fnc_deployCancel;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (isNull GVAR(sandBag) || isNull GVAR(carrier)) exitWith {};
|
||||
|
||||
[GVAR(carryPFH)] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
[GVAR(carrier), "ACE_Sandbag", false] call EFUNC(Common,setForceWalkStatus);
|
||||
[GVAR(carrier), "DefaultAction", GVAR(carrier) getVariable [QGVAR(drop), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
|
||||
call EFUNC(interaction,hideMouseHint);
|
||||
|
||||
GVAR(carrier) playActionNow "PutDown";
|
||||
|
||||
[{
|
||||
_this setVariable [QGVAR(usingSandbag), false];
|
||||
}, GVAR(carrier), 1.5, 0.5] call EFUNC(common,waitAndExecute);
|
||||
|
||||
[{
|
||||
private ["_sandBag", "_position", "_direction"];
|
||||
_position = getPosASL GVAR(sandBag);
|
||||
_direction = getDir GVAR(sandBag);
|
||||
|
||||
deleteVehicle GVAR(sandBag);
|
||||
|
||||
_sandBag = createVehicle ["ACE_SandbagObject", [0,0,0], [], 0, "NONE"];
|
||||
_sandBag enableSimulationGlobal true;
|
||||
_sandBag setPosASL _position;
|
||||
_sandBag setDir _direction;
|
||||
|
||||
GVAR(sandBag) = objNull;
|
||||
GVAR(carrier) = objNull;
|
||||
}, [], 1.0, 0.5] call EFUNC(common,waitAndExecute);
|
24
addons/sandbag/functions/fnc_handleScrollWheel.sqf
Normal file
24
addons/sandbag/functions/fnc_handleScrollWheel.sqf
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Author: Garth 'L-H' de Wet, Ruthberg
|
||||
* Handles sandbag rotation
|
||||
*
|
||||
* Arguments:
|
||||
* 0: scroll amount <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* handled <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* 1.2 call ace_sandbag_fnc_handleScrollWheel;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_scroll);
|
||||
|
||||
if (GETMVAR(ACE_Modifier,0) == 0 || GVAR(deployPFH) == -1) exitWith { false };
|
||||
|
||||
GVAR(deployDirection) = GVAR(deployDirection) + (_scroll * 5);
|
||||
|
||||
true
|
35
addons/sandbag/functions/fnc_pickup.sqf
Normal file
35
addons/sandbag/functions/fnc_pickup.sqf
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
* Pick up sandbag
|
||||
*
|
||||
* Arguments:
|
||||
* 0: sandbag <OBJECT>
|
||||
* 1: unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [_sandbag, _unit] call ace_sandbag_fnc_pickup;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_sandbag,_unit);
|
||||
|
||||
_unit playActionNow "PutDown";
|
||||
|
||||
_unit setVariable [QGVAR(usingSandbag), true];
|
||||
[{
|
||||
PARAMS_2(_sandbag,_unit);
|
||||
_unit setVariable [QGVAR(usingSandbag), false];
|
||||
deletevehicle _sandbag;
|
||||
|
||||
// Force physx update
|
||||
{
|
||||
_x setPosASL (getPosASL _x);
|
||||
} forEach (_unit nearObjects ["ACE_SandbagObject", 5]);
|
||||
|
||||
[_unit, "ACE_Sandbag_empty"] call EFUNC(common,addToInventory);
|
||||
}, [_sandbag, _unit], 1.5, 0.5] call EFUNC(common,waitAndExecute);
|
1
addons/sandbag/functions/script_component.hpp
Normal file
1
addons/sandbag/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\sandbag\script_component.hpp"
|
12
addons/sandbag/script_component.hpp
Normal file
12
addons/sandbag/script_component.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#define COMPONENT sandbag
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_SANDBAG
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_SANDBAG
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_SANDBAG
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
149
addons/sandbag/stringtable.xml
Normal file
149
addons/sandbag/stringtable.xml
Normal file
@ -0,0 +1,149 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="sandbag">
|
||||
<Key ID="STR_ACE_Sandbag">
|
||||
<English>Sandbag</English>
|
||||
<German>Sandsack</German>
|
||||
<Russian>Мешок с песком</Russian>
|
||||
<Polish>Worek z piaskiem</Polish>
|
||||
<Spanish>Sandbag</Spanish>
|
||||
<French>Sac de sable</French>
|
||||
<Czech>Pytel s pískem</Czech>
|
||||
<Italian>Sacco di Sabbia</Italian>
|
||||
<Hungarian>Homokzsák</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_M_SBEMPTY">
|
||||
<English>Sandbag (empty)</English>
|
||||
<German>Sandsack (leer)</German>
|
||||
<Russian>Мешок с песком (пустой)</Russian>
|
||||
<Polish>Worek na piasek</Polish>
|
||||
<Spanish>Sandbag (empty)</Spanish>
|
||||
<French>Sac de sable (vide)</French>
|
||||
<Czech>Pytel na písek (prázdný)</Czech>
|
||||
<Italian>Sacco di Sabbia (Vuoto)</Italian>
|
||||
<Hungarian>Homokzsák (üres)</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_CANNOTSB">
|
||||
<English>Cannot build here</English>
|
||||
<German>Nicht möglich</German>
|
||||
<Russian>Установка на этом месте невозможна</Russian>
|
||||
<Polish>Nie można tu budować</Polish>
|
||||
<Spanish>Cannot build here</Spanish>
|
||||
<French>Impossible de construire ici</French>
|
||||
<Czech>Zde nelze postavit</Czech>
|
||||
<Italian>Impossibile costruire qui</Italian>
|
||||
<Hungarian>Nem teheted ide</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AC_PICKUPSB">
|
||||
<English>Pick up Sandbag</English>
|
||||
<German>Sandsack abbauen</German>
|
||||
<Russian>Взять мешок с песком</Russian>
|
||||
<Polish>Zabierz worek</Polish>
|
||||
<Spanish>Pick up sandbag</Spanish>
|
||||
<French>Prendre sac de sable</French>
|
||||
<Czech>Zvednout pytel</Czech>
|
||||
<Italian>Prendi Sacco di Sabbia</Italian>
|
||||
<Hungarian>Homokzsák felvétele</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AC_CARRYSB">
|
||||
<English>Carry Sandbag</English>
|
||||
<German>Sandsack tragen</German>
|
||||
<Russian>Нести мешок с песком</Russian>
|
||||
<Polish>Przenieś worek</Polish>
|
||||
<Spanish>Carry sandbag</Spanish>
|
||||
<French>Porter sac de sable</French>
|
||||
<Czech>Nést pytel</Czech>
|
||||
<Italian>Trasporta Sacco di Sabbia</Italian>
|
||||
<Hungarian>Homokzsák cipelése</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AC_ENDCARRYSB">
|
||||
<English>End Carrying</English>
|
||||
<German>Tragen beenden</German>
|
||||
<Russian>Завершить переноску</Russian>
|
||||
<Polish>Zostaw worek</Polish>
|
||||
<Spanish>End carrying</Spanish>
|
||||
<French>Arreter de porter</French>
|
||||
<Czech>Položit</Czech>
|
||||
<Italian>Fine Trasporto</Italian>
|
||||
<Hungarian>Cipelés abbahagyása</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AC_DROP">
|
||||
<English>Drop Sandbag</English>
|
||||
<German>Sandsack ablegen</German>
|
||||
<Russian>Положить мешок</Russian>
|
||||
<Polish>Upuść worek</Polish>
|
||||
<Spanish>Drop sandbag</Spanish>
|
||||
<French>Lacher sac de sable</French>
|
||||
<Czech>Odložit pytel</Czech>
|
||||
<Italian>Lascia Sacco di Sabbia</Italian>
|
||||
<Hungarian>Homokzsák eldobása</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AC_CONF">
|
||||
<English>Confirm Deployment</English>
|
||||
<German>Aufbauen</German>
|
||||
<Russian>Подтвердить установку</Russian>
|
||||
<Polish>Potwierdź rozłożenie</Polish>
|
||||
<Spanish>Confirm Deployment</Spanish>
|
||||
<French>Confirmer Déploiement</French>
|
||||
<Czech>Potvrdit Položení</Czech>
|
||||
<Italian>Conferma Posizionamento</Italian>
|
||||
<Hungarian>Lerak</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AC_CANCEL">
|
||||
<English>Cancel Deployment</English>
|
||||
<German>Abbrechen</German>
|
||||
<Russian>Отменить установку</Russian>
|
||||
<Polish>Anuluj rozłożenie</Polish>
|
||||
<Spanish>Cancel Deployment</Spanish>
|
||||
<French>Annuler Déploiement</French>
|
||||
<Czech>Zrušit Položení</Czech>
|
||||
<Italian>Cancella Posizionamento</Italian>
|
||||
<Hungarian>Visszavonás</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_AC_BUILD">
|
||||
<English>Deploy Sandbag</English>
|
||||
<German>Sandsack aufbauen</German>
|
||||
<Russian>Установить мешок с песком</Russian>
|
||||
<Polish>Rozłóż worek z piaskiem</Polish>
|
||||
<Spanish>Deploy sandbag</Spanish>
|
||||
<French>Deployer sac de sable</French>
|
||||
<Czech>Umístit pytel</Czech>
|
||||
<Italian>Posiziona Sacco di Sabbia</Italian>
|
||||
<Hungarian>Homokzsák lerakása</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_V_SANDBOX">
|
||||
<English>Sandbag Box</English>
|
||||
<German>Sandsack Kiste</German>
|
||||
<Russian>Ящик мешков с песком</Russian>
|
||||
<Polish>Skrzynia worków na piasek</Polish>
|
||||
<Spanish>Sandbag box</Spanish>
|
||||
<French>Caisse de sacs de sable</French>
|
||||
<Czech>Bedna na pytle s pískem</Czech>
|
||||
<Italian>Contenitore Sacchi di Sabbia</Italian>
|
||||
<Hungarian>Homokzsákos láda</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_NOSAND">
|
||||
<English>Here is no sand</English>
|
||||
<German>Hier gibt es keinen Sand</German>
|
||||
<Russian>Здесь нет песка</Russian>
|
||||
<Polish>Tu nie ma piasku</Polish>
|
||||
<Spanish>Here is no sand</Spanish>
|
||||
<French>Pas de sable ici</French>
|
||||
<Czech>Tady není písek</Czech>
|
||||
<Italian>Qui non cè Sabbia</Italian>
|
||||
<Hungarian>Itt nincs homok</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Sandbag_ScrollAction">
|
||||
<English>+ Modifier, rotates</English>
|
||||
<German>+ Modifikator, drehen</German>
|
||||
<Spanish>+ Modificador, girar</Spanish>
|
||||
<French>+ Modificateur, tourner</French>
|
||||
<Italian>+ Modificatore, rotazione</Italian>
|
||||
<Czech>+ Modifikátor, otočit</Czech>
|
||||
<Hungarian>+ Változtatás, forgatás</Hungarian>
|
||||
<Polish>+ Modyfikator, obrót</Polish>
|
||||
<Portuguese>+ Modificador, rotaciona</Portuguese>
|
||||
<Russian>+ Bращать</Russian>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
Loading…
x
Reference in New Issue
Block a user