diff --git a/addons/apl/data/glass_house.rvmat b/addons/apl/data/glass_house.rvmat new file mode 100644 index 0000000000..db033f6cd1 Binary files /dev/null and b/addons/apl/data/glass_house.rvmat differ diff --git a/addons/apl/data/metal4_weapons_vehicles_int_512_dt.paa b/addons/apl/data/metal4_weapons_vehicles_int_512_dt.paa new file mode 100644 index 0000000000..a023628a55 Binary files /dev/null and b/addons/apl/data/metal4_weapons_vehicles_int_512_dt.paa differ diff --git a/addons/apl/data/plastic.rvmat b/addons/apl/data/plastic.rvmat new file mode 100644 index 0000000000..ba54cd9164 Binary files /dev/null and b/addons/apl/data/plastic.rvmat differ diff --git a/addons/apl/data/plastic_512_dt.paa b/addons/apl/data/plastic_512_dt.paa new file mode 100644 index 0000000000..62c48c90a4 Binary files /dev/null and b/addons/apl/data/plastic_512_dt.paa differ diff --git a/addons/spottingscope/$PBOPREFIX$ b/addons/spottingscope/$PBOPREFIX$ new file mode 100644 index 0000000000..abab69909d --- /dev/null +++ b/addons/spottingscope/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\spottingscope \ No newline at end of file diff --git a/addons/spottingscope/CfgEventHandlers.hpp b/addons/spottingscope/CfgEventHandlers.hpp new file mode 100644 index 0000000000..81b3aef30e --- /dev/null +++ b/addons/spottingscope/CfgEventHandlers.hpp @@ -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_SpottingScopeObject { + class ADDON { + init = QUOTE(_this call DEFUNC(dragging,initObject)); + }; + }; +}; diff --git a/addons/spottingscope/CfgVehicles.hpp b/addons/spottingscope/CfgVehicles.hpp new file mode 100644 index 0000000000..5e743622db --- /dev/null +++ b/addons/spottingscope/CfgVehicles.hpp @@ -0,0 +1,129 @@ + +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_Equipment { + class GVAR(place) { + displayName = CSTRING(Placedown); + condition = QUOTE([ARR_2(_player,'ACE_SpottingScope')] call EFUNC(common,hasItem)); + statement = QUOTE([ARR_2(_player,'ACE_SpottingScope')] call FUNC(place)); + showDisabled = 0; + priority = 2; + icon = PATHTOF(UI\w_spottingscope_ca.paa); + exceptions[] = {"isNotInside"}; + }; + }; + }; + }; + + class Item_Base_F; + class ACE_Item_SpottingScope: Item_Base_F { + author[] = {"Rocko", "Scubaman3D"}; + scope = 2; + scopeCurator = 2; + displayName = CSTRING(DisplayName); + vehicleClass = "Items"; + class TransportItems { + class ACE_SpottingScope { + name = "ACE_SpottingScope"; + count = 1; + }; + }; + }; + + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_Item_SpottingScope,2); + }; + }; + + class LandVehicle; + class StaticWeapon: LandVehicle { + class Turrets; + }; + class StaticATWeapon: StaticWeapon { + class Turrets: Turrets { + class MainTurret; + }; + }; + class ACE_SpottingScopeObject: StaticATWeapon { + XEH_ENABLED; + scope = 1; + side = 1; + typicalCargo[] = {"Soldier"}; + displayName = CSTRING(DisplayName); + model = PATHTOF(data\spottingscope.p3d); + mapSize = 0.5; + transportSoldier = 0; + getInAction = "GetInLow"; + getOutAction = "GetOutLow"; + class Turrets: Turrets { + class MainTurret: MainTurret { + minTurn = -45; + maxTurn = 45; + initTurn = 0; + minElev = -10; + maxElev = 40; + initElev = 0; + + weapons[] = {}; + magazines[] = {}; + gunnerOpticsColor[] = {1,1,1,1}; + gunnerOpticsmodel = PATHTOF(data\m144_optic.p3d); + gunnerOpticsEffect[] = {"OpticsCHAbera1","OpticsBlur2"}; + gunnerOutOpticsShowCursor = 0; + gunnerOpticsShowCursor = 0; + gunnerAction = "gunner_static_low01"; + gunnerGetInAction = "GetInLow"; + gunnerGetOutAction = "GetOutLow"; + gunnerForceOptics = 0; + ejectDeadGunner = 0; + class ViewGunner { + initAngleX = 5; + minAngleX = -30; + maxAngleX = 30; + initAngleY = 0; + minAngleY = -100; + maxAngleY = 100; + initFov = 0.7; + minFov = 0.7; + maxFov = 0.7; + }; + class ViewOptics { + initAngleX = 0; + minAngleX = -30; + maxAngleX = 30; + initAngleY = 0; + minAngleY = -100; + maxAngleY = 100; + initFov = 0.014812; + minFov = 0.014812; + maxFov = 0.014812; + }; + }; + }; + EGVAR(dragging,canDrag) = 1; + EGVAR(dragging,dragPosition[]) = {0,1,0}; + EGVAR(dragging,dragDirection) = 0; + class ACE_Actions { + class ACE_MainActions { + selection = "osaveze"; + distance = 5; + condition = "true"; + class ACE_Pickup { + selection = ""; + displayName = CSTRING(PickUp); + distance = 5; + condition = QUOTE((alive _target) && (count (crew _target) == 0)); + statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickup)); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + icon = PATHTOF(UI\w_spottingscope_ca.paa); + }; + }; + }; + }; +}; diff --git a/addons/spottingscope/CfgWeapons.hpp b/addons/spottingscope/CfgWeapons.hpp new file mode 100644 index 0000000000..4ba078c057 --- /dev/null +++ b/addons/spottingscope/CfgWeapons.hpp @@ -0,0 +1,17 @@ + +class CfgWeapons { + class ACE_ItemCore; + class InventoryItem_Base_F; + + class ACE_SpottingScope: ACE_ItemCore { + scope = 2; + displayName = CSTRING(DisplayName); + descriptionShort = ""; + picture = PATHTOF(UI\w_spottingscope_ca.paa); + model = PATHTOF(data\w_spottingscope.p3d); + + class ItemInfo: InventoryItem_Base_F { + mass = 40; + }; + }; +}; diff --git a/addons/spottingscope/README.md b/addons/spottingscope/README.md new file mode 100644 index 0000000000..ea9f2b819d --- /dev/null +++ b/addons/spottingscope/README.md @@ -0,0 +1,10 @@ +ace_spottingscope +=============== + +Adds a spotting scope. + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Ruthberg] (http://github.com/Ulteq) \ No newline at end of file diff --git a/addons/spottingscope/UI/w_spottingscope_ca.paa b/addons/spottingscope/UI/w_spottingscope_ca.paa new file mode 100644 index 0000000000..b6edc66697 Binary files /dev/null and b/addons/spottingscope/UI/w_spottingscope_ca.paa differ diff --git a/addons/spottingscope/XEH_postInit.sqf b/addons/spottingscope/XEH_postInit.sqf new file mode 100644 index 0000000000..421c54b49f --- /dev/null +++ b/addons/spottingscope/XEH_postInit.sqf @@ -0,0 +1 @@ +#include "script_component.hpp" diff --git a/addons/spottingscope/XEH_preInit.sqf b/addons/spottingscope/XEH_preInit.sqf new file mode 100644 index 0000000000..306884e595 --- /dev/null +++ b/addons/spottingscope/XEH_preInit.sqf @@ -0,0 +1,8 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(pickup); +PREP(place); + +ADDON = true; diff --git a/addons/spottingscope/config.cpp b/addons/spottingscope/config.cpp new file mode 100644 index 0000000000..a615e5da79 --- /dev/null +++ b/addons/spottingscope/config.cpp @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_Item_SpottingScope"}; + weapons[] = {"ACE_SpottingScope"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_apl", "ace_interaction"}; + author[] = {"Rocko", "Scubaman3D", "Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" \ No newline at end of file diff --git a/addons/spottingscope/data/PSO_ring.paa b/addons/spottingscope/data/PSO_ring.paa new file mode 100644 index 0000000000..e1502aa5e2 Binary files /dev/null and b/addons/spottingscope/data/PSO_ring.paa differ diff --git a/addons/spottingscope/data/ace_reticle.rvmat b/addons/spottingscope/data/ace_reticle.rvmat new file mode 100644 index 0000000000..0d1df7e696 --- /dev/null +++ b/addons/spottingscope/data/ace_reticle.rvmat @@ -0,0 +1,9 @@ +ambient[] = {0, 0, 0, 1}; +diffuse[] = {0, 0, 0, 1}; +forcedDiffuse[] = {0, 0, 0, 0}; +emmisive[] = {1, 1, 1, 1}; +specular[] = {0, 0, 0, 1}; +specularPower = 0; +renderFlags[] = {"NoZWrite"}; +PixelShaderID = "Normal"; +VertexShaderID = "Basic"; diff --git a/addons/spottingscope/data/ace_ssvzs.p3d b/addons/spottingscope/data/ace_ssvzs.p3d new file mode 100644 index 0000000000..a30b34fa3e Binary files /dev/null and b/addons/spottingscope/data/ace_ssvzs.p3d differ diff --git a/addons/spottingscope/data/m144_ca.paa b/addons/spottingscope/data/m144_ca.paa new file mode 100644 index 0000000000..4d7a63ba0a Binary files /dev/null and b/addons/spottingscope/data/m144_ca.paa differ diff --git a/addons/spottingscope/data/m144_optic.p3d b/addons/spottingscope/data/m144_optic.p3d new file mode 100644 index 0000000000..15ad16fe92 Binary files /dev/null and b/addons/spottingscope/data/m144_optic.p3d differ diff --git a/addons/spottingscope/data/model.cfg b/addons/spottingscope/data/model.cfg new file mode 100644 index 0000000000..e7beb2f2c1 --- /dev/null +++ b/addons/spottingscope/data/model.cfg @@ -0,0 +1,49 @@ +class CfgSkeletons +{ + class Default { + isDiscrete = 1; + skeletonInherit = ""; + skeletonBones[] = {}; + }; + class ace_spottingscope_skeleton: Default { + isDiscrete = 1; + skeletonInherit = "Default"; + skeletonBones[] = { + "otocvez","", + "otochlaven","otocvez" + }; + }; +}; +class CfgModels { + class Default { + sectionsInherit = ""; + sections[] = {}; + skeletonName = ""; + }; + class spottingscope: Default { + skeletonName = "ace_spottingscope_skeleton"; + sectionsInherit = "Default"; + class animations { + class mainTurret { + type = "rotationY"; + source = "mainTurret"; + selection = "otocvez"; + axis = "osaveze"; + minValue = "rad -360"; + maxValue = "rad +360"; + angle0 = "rad -360"; + angle1 = "rad +360"; + }; + class mainGun { + type = "rotationX"; + source = "mainGun"; + selection = "otochlaven"; + axis = "osahlavne"; + minValue = "rad -360"; + maxValue = "rad +360"; + angle0 = "rad -360"; + angle1 = "rad +360"; + }; + }; + }; +}; diff --git a/addons/spottingscope/data/optic_ssvzs.p3d b/addons/spottingscope/data/optic_ssvzs.p3d new file mode 100644 index 0000000000..ffb5834768 Binary files /dev/null and b/addons/spottingscope/data/optic_ssvzs.p3d differ diff --git a/addons/spottingscope/data/scopering.paa b/addons/spottingscope/data/scopering.paa new file mode 100644 index 0000000000..ecf236b025 Binary files /dev/null and b/addons/spottingscope/data/scopering.paa differ diff --git a/addons/spottingscope/data/sniper_peri.rvmat b/addons/spottingscope/data/sniper_peri.rvmat new file mode 100644 index 0000000000..35069be267 --- /dev/null +++ b/addons/spottingscope/data/sniper_peri.rvmat @@ -0,0 +1,78 @@ +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, 1.0}; +specular[] = {0.0, 0.0, 0.0, 0.0}; +specularPower = 0.0; +PixelShaderID = "Super"; +VertexShaderID = "Super"; +class Stage1 { + texture = "z\ace\addons\spottingscope\data\sniper_peri_nohq.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 { + texture = "z\ace\addons\apl\data\metal4_weapons_vehicles_int_512_dt.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {6.0, 0.0, 0.0}; + up[] = {0.0, 6.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)"; + uvSource = "tex"; + class uvTransform { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; +}; +class Stage4 { + texture = "#(argb,8,8,3)color(0,1,1,1)"; + 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\spottingscope\data\sniper_peri_smdi.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 { + texture = "#(ai,32,128,1)fresnel(1.58,0.01)"; + 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}; + }; +}; diff --git a/addons/spottingscope/data/sniper_peri_co.paa b/addons/spottingscope/data/sniper_peri_co.paa new file mode 100644 index 0000000000..6466dc6d82 Binary files /dev/null and b/addons/spottingscope/data/sniper_peri_co.paa differ diff --git a/addons/spottingscope/data/sniper_peri_nohq.paa b/addons/spottingscope/data/sniper_peri_nohq.paa new file mode 100644 index 0000000000..cc84eab64d Binary files /dev/null and b/addons/spottingscope/data/sniper_peri_nohq.paa differ diff --git a/addons/spottingscope/data/sniper_peri_smdi.paa b/addons/spottingscope/data/sniper_peri_smdi.paa new file mode 100644 index 0000000000..4cb94ce7d1 Binary files /dev/null and b/addons/spottingscope/data/sniper_peri_smdi.paa differ diff --git a/addons/spottingscope/data/spot_scope.rvmat b/addons/spottingscope/data/spot_scope.rvmat new file mode 100644 index 0000000000..294d3a75b2 --- /dev/null +++ b/addons/spottingscope/data/spot_scope.rvmat @@ -0,0 +1,78 @@ +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, 1.0}; +specular[] = {0.0, 0.0, 0.0, 0.0}; +specularPower = 0.0; +PixelShaderID = "Super"; +VertexShaderID = "Super"; +class Stage1 { + texture = "z\ace\addons\spottingscope\data\spot_scope_nohq.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 { + texture = "z\ace\addons\apl\data\plastic_512_dt.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {6.0, 0.0, 0.0}; + up[] = {0.0, 6.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)"; + uvSource = "tex"; + class uvTransform { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; +}; +class Stage4 { + texture = "#(argb,8,8,3)color(0,1,1,1)"; + 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\spottingscope\data\spot_scope_smdi.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 { + texture = "#(ai,32,128,1)fresnel(1.58,0.01)"; + 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}; + }; +}; diff --git a/addons/spottingscope/data/spot_scope_co.paa b/addons/spottingscope/data/spot_scope_co.paa new file mode 100644 index 0000000000..c0168053a3 Binary files /dev/null and b/addons/spottingscope/data/spot_scope_co.paa differ diff --git a/addons/spottingscope/data/spot_scope_nohq.paa b/addons/spottingscope/data/spot_scope_nohq.paa new file mode 100644 index 0000000000..674ad1d0ec Binary files /dev/null and b/addons/spottingscope/data/spot_scope_nohq.paa differ diff --git a/addons/spottingscope/data/spot_scope_smdi.paa b/addons/spottingscope/data/spot_scope_smdi.paa new file mode 100644 index 0000000000..b6e2d763fe Binary files /dev/null and b/addons/spottingscope/data/spot_scope_smdi.paa differ diff --git a/addons/spottingscope/data/spot_scope_tripod.rvmat b/addons/spottingscope/data/spot_scope_tripod.rvmat new file mode 100644 index 0000000000..0403471e5a --- /dev/null +++ b/addons/spottingscope/data/spot_scope_tripod.rvmat @@ -0,0 +1,79 @@ +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, 1.0}; +specular[] = {0.0, 0.0, 0.0, 0.0}; +specularPower = 0.0; +PixelShaderID = "Super"; +VertexShaderID = "Super"; +class Stage1 { + texture = "z\ace\addons\spottingscope\data\spot_scope_nohq.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 { + texture = "z\ace\addons\apl\data\metal4_weapons_vehicles_int_512_dt.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {6.0, 0.0, 0.0}; + up[] = {0.0, 6.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)"; + uvSource = "tex"; + class uvTransform { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; +}; +class Stage4 { + texture = "#(argb,8,8,3)color(0,1,1,1)"; + 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\spottingscope\data\spot_scope_smdi.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 { + texture = "#(ai,32,128,1)fresnel(1.58,0.01)"; + 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}; + }; +}; diff --git a/addons/spottingscope/data/spottingscope.p3d b/addons/spottingscope/data/spottingscope.p3d new file mode 100644 index 0000000000..c4e0363dcf Binary files /dev/null and b/addons/spottingscope/data/spottingscope.p3d differ diff --git a/addons/spottingscope/data/w_spottingscope.p3d b/addons/spottingscope/data/w_spottingscope.p3d new file mode 100644 index 0000000000..040ef5158e Binary files /dev/null and b/addons/spottingscope/data/w_spottingscope.p3d differ diff --git a/addons/spottingscope/functions/fnc_pickup.sqf b/addons/spottingscope/functions/fnc_pickup.sqf new file mode 100644 index 0000000000..e88f49589b --- /dev/null +++ b/addons/spottingscope/functions/fnc_pickup.sqf @@ -0,0 +1,30 @@ +/* + * Author: Rocko, Ruthberg + * + * Pick up spotting scope + * + * Arguments: + * 0: spotting scope + * 1: unit + * + * Return Value: + * Nothing + * + * Return value: + * None + */ +#include "script_component.hpp" + +PARAMS_2(_spottingScope,_unit); + +if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { + _unit playMove "AmovPercMstpSrasWrflDnon_diary"; +}; + +[{ + PARAMS_2(_spottingScope,_unit); + + _unit addItem "ACE_SpottingScope"; + deleteVehicle _spottingScope; + +}, [_spottingScope, _unit], 1, 0]call EFUNC(common,waitAndExecute); diff --git a/addons/spottingscope/functions/fnc_place.sqf b/addons/spottingscope/functions/fnc_place.sqf new file mode 100644 index 0000000000..4967151748 --- /dev/null +++ b/addons/spottingscope/functions/fnc_place.sqf @@ -0,0 +1,41 @@ +/* + * Author: Rocko, Ruthberg + * + * Place down spotting scope + * + * Arguments: + * 0: unit + * 1: scope class + * + * Return Value: + * Nothing + * + * Return value: + * None + */ +#include "script_component.hpp" + +PARAMS_2(_unit,_scopeClass); + +_unit removeItem _scopeClass; + +if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { + _unit playMove "AmovPercMstpSrasWrflDnon_diary"; +}; + +[{ + PARAMS_1(_unit); + + private ["_direction", "_position", "_spottingScope"]; + _direction = getDir _unit; + _position = (getPosASL _unit) vectorAdd [0.8 * sin(_direction), 0.8 * cos(_direction), 0.02]; + + _spottingScope = "ACE_SpottingScopeObject" createVehicle [0, 0, 0]; + _spottingScope setDir _direction; + _spottingScope setPosASL _position; + if ((getPosATL _spottingScope select 2) - (getPos _spottingScope select 2) < 1E-5) then { + _spottingScope setVectorUp (surfaceNormal (position _spottingScope)); + }; + _unit reveal _spottingScope; + +}, [_unit], 1, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/spottingscope/functions/script_component.hpp b/addons/spottingscope/functions/script_component.hpp new file mode 100644 index 0000000000..504cde2ca6 --- /dev/null +++ b/addons/spottingscope/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\spottingscope\script_component.hpp" \ No newline at end of file diff --git a/addons/spottingscope/script_component.hpp b/addons/spottingscope/script_component.hpp new file mode 100644 index 0000000000..11bd94a6e5 --- /dev/null +++ b/addons/spottingscope/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT spottingscope +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_SPOTTINGSCOPE + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_SPOTTINGSCOPE + #define DEBUG_SETTINGS DEBUG_SETTINGS_SPOTTINGSCOPE +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/spottingscope/stringtable.xml b/addons/spottingscope/stringtable.xml new file mode 100644 index 0000000000..7fc7fdee58 --- /dev/null +++ b/addons/spottingscope/stringtable.xml @@ -0,0 +1,38 @@ + + + + + Spotting Scope + Teleskop + Зрительная труба + Teleskop + Spotting Scope + Téléscope de visée + Zaměřovací Dalekohled + Spotting Scope + Megfigyelő távcső + + + Pick up Spotting Scope + Teleskop aufnehmen + Поднять зрительная трубу + Zabierz teleskop + Pick up Spotting Scope + Prendre téléscope de visée + Zvednout Zaměřovací dalekohled + Raccogli spottingscope + Mefgigy. távcső felvétele + + + Place Spotting Scope + Teleskop aufstellen + Установить зрительная трубу + Ustaw teleskop + Place Spotting Scope + Placer téléscope de visée + Položit Zaměřovací dalekohled + Posiziona spottingscope + Megfigy. távcső elhelyezése + + + \ No newline at end of file