diff --git a/CHANGE LOG 1.0.5.2.txt b/CHANGE LOG 1.0.5.2.txt index 6bc7e0d03..ca13496a2 100644 --- a/CHANGE LOG 1.0.5.2.txt +++ b/CHANGE LOG 1.0.5.2.txt @@ -1,9 +1,13 @@ +[NEW] RedRyder BB Gun by @arma2WillRobinson +[NEW] DB Backup script. @RimBlock [NEW] Use DayZ_UseSteamID = false; in your init.sqf to use the old PlayerUID, instead of SteamID @icomrade [NEW] UI Update - Graphical and code changes, enable using Dayz_Dark_UI = true; in init.sqf. @hogscraper http://epochmod.com/forum/index.php?/topic/13654-proposed-ui-change/ [NOTE] It's recommend to convert to the new SteamID system if possible, new servers should not use DayZ_UseSteamID = false; +[NEW] Snap building (disabled by default), use DZE_snapBuilding = true; in your init.sqf to enable. @raymix [CHANGED] An infection chance of -1 disables self-transfusion infection. 0 is always infected. (DZE_selfTransfuse_Values) @icomrade [CHANGED] Removed weapons from Traders hands and made them stand with arms by their side. @SilvDev +[CHANGED] Tweaked fuel capacity variables for vehicles. @RimBlock [FIXED] Backpack wipes when changing clothes. #1361 @icomrade [FIXED] CH53 gear when locked #1364 @icomrade @@ -11,6 +15,10 @@ [FIXED] Only first kill showing on death boards #1362 #1124 @vbawol @icomrade [FIXED] Crossbow quivers not working #1355 @icomrade [FIXED] Crash_spawner & Supply_drop modules spawning inaccessible loot piles #1408 #1390 @Uro1 +[FIXED] Undefined variable "_weapon" in fnc_plyrHit.sqf when killer is driving a vehicle #1420 @ebaydayz +[FIXED] Fire cleanup diag_log error in server_functions.sqf #1421 @ebaydayz +[FIXED] NearestObjects position error in server_playerSync.sqf #1425 @ebaydayz +[FIXED] Corrected ClassName type for CH53_DZE and BAF_Merlin_DZE. @Cinjun [UPDATED] .hpp files updated in dayz_epoch_b CfgLootPos > CfgBuildingPos. @Uro1 [UPDATED] .bat files updated in Config-Examples @Raziel23x diff --git a/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp b/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp new file mode 100644 index 000000000..0cc12c0ca --- /dev/null +++ b/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp @@ -0,0 +1,406 @@ +/* +Created by Raymix +*/ + + +class SnapBuilding { + //Barriers whitelist + class Barrier { + snapTo[] = { + "Land_HBarrier5_DZ", + "Land_HBarrier3_DZ", + "Land_HBarrier1_DZ", + "Sandbag1_DZ", + "BagFenceRound_DZ", + "Fort_RazorWire" + }; + radius = 5; + }; + //snap points + class Land_HBarrier5Preview: Barrier{ //fix for broken offsets in ghost + points[] = { + {0,0,0,"Pivot"}, + {0,-0.75,0.1,"Back"}, + {0,0.75,0.1,"Front"}, + {-2.85,0,0.1,"Left"}, + {2.85,0,0.1,"Right"}, + {0,0,0.9,"Top"} + }; + }; + class Land_HBarrier5_DZ: Land_HBarrier5Preview { + points[] = { + {0,0,0,"Pivot"}, + {0,-0.75,0,"Back"}, + {0,0.75,0,"Front"}, + {-2.85,0,0,"Left"}, + {2.85,0,0,"Right"}, + {0,0,0.9,"Top"} + }; + }; + + class Land_HBarrier3ePreview: Barrier { //whitelist inheritance + points[] = { + {0,0,0,"Pivot"}, + {0,-0.75,0,"Back"}, + {0,0.75,0,"Front"}, + {-1.7,0,0,"Left"}, + {1.7,0,0,"Right"}, + {0,0,0.9,"Top"} + }; + }; + class Land_HBarrier3_DZ: Land_HBarrier3ePreview{}; //point inheritance + + class Land_HBarrier1Preview: Barrier { + points[] = { + {0,0,0,"Pivot"}, + {0,-0.75,0,"Back"}, + {0,0.75,0,"Front"}, + {-0.6,0,0,"Left"}, + {0.6,0,0,"Right"}, + {0,0,0.9,"Top"} + }; + }; + class Land_HBarrier1_DZ: Land_HBarrier1Preview{}; + + class Fort_RazorWirePreview: Barrier { + points[] = { + {0,0,0,"Pivot"}, + {0,-0.95,-0.3,"Back"}, + {0,0.95,-0.3,"Front"}, + {-4.1,0,-0.3,"Left"}, + {4.1,0,-0.3,"Right"}, + {0,0,1,"Top"} + }; + }; + class Fort_RazorWire: Fort_RazorWirePreview {}; + + class Sandbag1_DZ: Barrier { + points[] = { + {0,0,0,"Pivot"}, + {-1.5,0,0,"Left"}, + {1.5,0,0,"Right"}, + {0,0,0.4,"Top"} + }; + }; + + class BagFenceRound_DZ: Barrier { + points[] = { + {0,0,0,"Pivot"}, + {-1.295,0.38,0,"Left"}, + {1.295,0.38,0,"Right"}, + {0,0,0.4,"Top"} + }; + }; + + //Snapping whitelists for Floors, walls and stairs + class FloorsWallsStairs { + snapTo[] = { + "WoodFloorQuarter_DZ", + "WoodFloorHalf_DZ", + "WoodFloor_DZ", + "WoodStairs_DZ", + "WoodStairsSans_DZ", + "WoodSmallWallDoor_DZ", + "WoodSmallWall_DZ", + "WoodSmallWallWin_DZ", + "Land_DZE_WoodDoor", + "Land_DZE_WoodDoorLocked", + "WoodLargeWall_DZ", + "Land_DZE_LargeWoodDoor", + "WoodLargeWallWin_DZ", + "WoodLargeWallDoor_DZ", + "Land_DZE_GarageWoodDoor", + "Land_DZE_GarageWoodDoorLocked", + "Land_DZE_LargeWoodDoorLocked", + "WoodSmallWallThird_DZ", + "CinderWall_DZ", + "CinderWallDoorway_DZ", + "CinderWallDoorLocked_DZ", + "CinderWallDoor_DZ", + "CinderWallSmallDoorway_DZ", + "CinderWallDoorSmallLocked_DZ", + "CinderWallHalf_DZ", + "CinderWallDoorSmall_DZ", + "MetalFloor_DZ" + }; + radius = 5; + }; + + class WoodFloorQuarter_Preview_DZ: FloorsWallsStairs { //fix for broken offsets in ghost + points[] = { + {0,0,0,"Pivot"}, + {0,-1.23,0,"Back"}, + {0,1.23,0,"Front"}, + {-1.24,0,0,"Left"}, + {1.24,0,0,"Right"} + }; + }; + + class WoodFloorQuarter_DZ: FloorsWallsStairs { + points[] = { + {0,0,0,"Pivot"}, + {0,-1.23,0.137726,"Back"}, + {0,1.23,0.137726,"Front"}, + {-1.24,0,0.137726,"Left"}, + {1.24,0,0.137726,"Right"} + }; + }; + + class WoodFloorHalf_Preview_DZ: FloorsWallsStairs { //fix for broken offsets in ghost + points[] = { + {0,0,0,"Pivot"}, + {0,-2.34,0,"Back"}, + {0,2.34,0,"Front"}, + {-1.25,0,0,"Left"}, + {1.25,0,0,"Right"} + }; + }; + class WoodFloorHalf_DZ: FloorsWallsStairs{ + points[] = { + {0,0,0,"Pivot"}, + {0,-2.34,0.1407,"Back"}, + {0,2.34,0.1407,"Front"}, + {-1.25,0,0.1407,"Left"}, + {1.25,0,0.1407,"Right"} + }; + }; + + class WoodFloor_Preview_DZ: FloorsWallsStairs { + points[] = { + {0,0,0,"Pivot"}, + {0,-2.33,0.130,"Back"}, + {0,2.33,0.130,"Front"}, + {-2.45,0,0.130,"Left"}, + {2.45,0,0.130,"Right"} + }; + radius = 10; + }; + class WoodFloor_DZ: WoodFloor_Preview_DZ{}; + + class Stairs_DZE: FloorsWallsStairs { + points[] = { + {0,0,0,"Pivot"}, + {1.56055,-0.78,1.5,"Back"}, + {1.56055,0.78,1.5,"Front"}, + {1.73926,0.05,2.9,"Top"}, + {-1.73926,0.05,0,"Bottom"} + }; + }; + class WoodStairs_DZ: Stairs_DZE {}; + class WoodStairs_Preview_DZ: Stairs_DZE {}; + class WoodStairsSans_Preview_DZ: Stairs_DZE {}; + class WoodStairsSans_DZ: Stairs_DZE {}; + + class WoodSmall_DZE: FloorsWallsStairs { // Small wood walls + points[] = { + {0,0,0,"Pivot"}, + {-2.285, 0, 1.5,"Left"}, + {2.285, 0, 1.5,"Right"}, + {0, 0, 3,"Top"} + }; + }; + class WoodSmallWallDoor_Preview_DZ: WoodSmall_DZE {}; + class WoodSmallWall_Preview_DZ: WoodSmall_DZE {}; + class WoodSmallWallWin_Preview_DZ: WoodSmall_DZE {}; + class WoodSmallWallDoor_DZ: WoodSmall_DZE {}; + class WoodSmallWall_DZ: WoodSmall_DZE {}; + class WoodSmallWallWin_DZ: WoodSmall_DZE {}; + class Land_DZE_WoodDoor: WoodSmall_DZE {}; + class Land_DZE_WoodDoorLocked: WoodSmall_DZE {}; + class WoodDoor_Preview_DZ: WoodSmall_DZE{}; + + class WoodLarge_DZE: FloorsWallsStairs { //Large wood walls + points[] = { + {0,0,0,"Pivot"}, + {-2.45, 0, 1.5,"Left"}, + {2.45, 0, 1.5,"Right"}, + {0, 0, 3,"Top"} + }; + }; + class WoodLargeWall_Preview_DZ: WoodLarge_DZE {}; + class WoodLargeWallWin_Preview_DZ: WoodLarge_DZE {}; + class WoodLargeWallDoor_Preview_DZ: WoodLarge_DZE {}; + class WoodSmallWallThird_Preview_DZ: WoodLarge_DZE { + points[] = { + {0,0,0,"Pivot"}, + {-2.445, 0, 1.5,"Left"}, + {2.445, 0, 1.5,"Right"}, + {0, 0, 1.17,"Top"} + }; + }; + class WoodSmallWallThird_DZ: WoodSmallWallThird_Preview_DZ{}; + class WoodLargeWall_DZ: WoodLarge_DZE {}; + class Land_DZE_LargeWoodDoor: WoodLarge_DZE {}; + class WoodLargeWallWin_DZ: WoodLarge_DZE {}; + class WoodLargeWallDoor_DZ: WoodLarge_DZE {}; + class Land_DZE_GarageWoodDoor: WoodLarge_DZE {}; + class GarageWoodDoor_Preview_DZ: WoodLarge_DZE {}; + class Land_DZE_GarageWoodDoorLocked: WoodLarge_DZE {}; + class Land_DZE_LargeWoodDoorLocked: WoodLarge_DZE {}; + class LargeWoodDoor_Preview_DZ: WoodLarge_DZE {}; + + class Cinder_DZE: FloorsWallsStairs { //All cinder walls and doors + points[] = { + {0,0,0,"Pivot"}, + {-2.752, 0, 1.5,"Left"}, + {2.752, 0, 1.5,"Right"}, + {0, 0, 3.37042,"Top"} + }; + radius = 5; + }; + class CinderWall_Preview_DZ: Cinder_DZE {}; + class CinderWallDoorway_Preview_DZ: Cinder_DZE {}; + class CinderWallSmallDoorway_Preview_DZ: Cinder_DZE {}; + class CinderWallHalf_Preview_DZ: Cinder_DZE { + points[] = { + {0,0,0,"Pivot"}, + {-2.752, 0, 1.5,"Left"}, + {2.752, 0, 1.5,"Right"}, + {0, 0, 1.5,"Top"} + }; + }; + class CinderWall_DZ: Cinder_DZE {}; + class CinderWallDoorway_DZ: Cinder_DZE {}; + class CinderWallDoorLocked_DZ: Cinder_DZE {}; + class CinderWallDoor_DZ: Cinder_DZE {}; + class CinderWallSmallDoorway_DZ: Cinder_DZE {}; + class CinderWallDoorSmallLocked_DZ: Cinder_DZE {}; + class CinderWallHalf_DZ: Cinder_DZE { + points[] = { + {0,0,0,"Pivot"}, + {-2.752, 0, 1.5,"Left"}, + {2.752, 0, 1.5,"Right"}, + {0, 0, 1.5,"Top"} + }; + }; + class CinderWallDoorSmall_DZ: Cinder_DZE {}; + + class MetalFloor_Preview_DZ: FloorsWallsStairs { //fix for broken offsets in ghost + points[] = { + {0,0,0.011,"Pivot"}, + {0, -2.64, 0.009,"Back"}, + {0, 2.64, 0.009,"Front"}, + {-2.64, 0, 0.009,"Left"}, + {2.64, 0, 0.009,"Right"} + }; + radius = 10; + }; + class MetalFloor_DZ: FloorsWallsStairs{ + points[] = { + {0,0,0,"Pivot"}, + {0, -2.64, 0.15,"Back"}, + {0, 2.64, 0.15,"Front"}, + {-2.64, 0, 0.15,"Left"}, + {2.64, 0, 0.15,"Right"} + }; + radius = 10; + }; + + + //Non essential Items that only snap to themselves, do whitelist inheritance if you want these to snap + class WoodCrate_DZ { + snapTo[] = { + "WoodCrate_DZ" + }; + radius = 5; + points[] = { + {0,0,0,"Pivot"}, + {0,-0.47,0,"Back"}, + {0,0.47,0,"Front"}, + {-0.47,0,0,"Left"}, + {0.47,0,0,"Right"}, + {0,0,0.47,"Top"} + }; + }; + + class MetalPanel_DZ { + snapTo[] = { + "MetalPanel_DZ" + }; + radius = 5; + points[] = { + {0,0,0,"Pivot"}, + {-1.5,0,0,"Left"}, + {1.5,0,0,"Right"} + }; + }; + + class MetalGate_DZ { + snapTo[] = { + "MetalGate_DZ" + }; + radius = 5; + points[] = { + {0,0,0,"Pivot"}, + {-4.1,0,0,"Left"} + }; + }; + + class StickFence_DZ { + snapTo[] = { + "StickFence_DZ" + }; + radius = 5; + points[] = { + {0,0,0,"Pivot"}, + {-2.95,0,0.3,"Left"}, + {2.95,0,0.3,"Right"} + }; + }; + + class Fence_corrugated_DZ { + snapTo[] = { + "Fence_corrugated_DZ" + }; + radius = 5; + points[] = { + {0,0,0,"Pivot"}, + {-1.95,0,0.88,"Left"}, + {1.95,0,0.88,"Right"} + }; + }; + + class WoodRamp_Preview_DZ { + snapTo[] = { + "WoodRamp_DZ" + }; + radius = 5; + points[] = { + {0,0,0,"Pivot"}, + {0.65,-1.7,1.2,"Back"}, + {0.65,1.5,1.2,"Front"}, + {3.34,-0.115,2.82,"Top"} + }; + }; + class WoodRamp_DZ: WoodRamp_Preview_DZ{}; + + class WoodLadder_Preview_DZ { + snapTo[] = { + "WoodLadder_DZ" + }; + radius = 5; + points[] = { + {0,0,0,"Pivot"}, + {-0.4,0,1.725,"Left"}, + {0.4,0,1.725,"Right"} + }; + }; + class WoodLadder_DZ: WoodLadder_Preview_DZ{}; + + class VaultStorageLocked { + snapTo[] = { + "VaultStorageLocked", + "VaultStorage" + }; + radius = 5; + points[] = { + {0,0,0,"Pivot"}, + {0,0.284,0.615,"Back"}, + {0,0,1.23,"Top"}, + {-0.362,0,0.615,"Left"}, + {0.362,0,0.615,"Right"} + }; + + }; + class VaultStorage: VaultStorageLocked {}; +}; diff --git a/SQF/dayz_code/Configs/CfgVehicles/AIR/AH6.hpp b/SQF/dayz_code/Configs/CfgVehicles/AIR/AH6.hpp index 9aa5bb48f..82b334199 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/AIR/AH6.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/AIR/AH6.hpp @@ -70,6 +70,7 @@ class AH6X_DZ: AH6_Base_EP1 { transportMaxWeapons = 3; transportMaxMagazines = 10; transportmaxbackpacks = 2; + fuelCapacity = 242; class Turrets {}; }; class MH6J_DZ: AH6_Base_EP1 { @@ -98,4 +99,4 @@ class MH6J_DZ: AH6_Base_EP1 { transportMaxMagazines = 20; transportmaxbackpacks = 5; class Turrets {}; -}; \ No newline at end of file +}; diff --git a/SQF/dayz_code/Configs/CfgVehicles/AIR/AN2.hpp b/SQF/dayz_code/Configs/CfgVehicles/AIR/AN2.hpp index 062dea1c3..6d5a3268c 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/AIR/AN2.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/AIR/AN2.hpp @@ -20,4 +20,5 @@ class AN2_DZ: An2_Base_EP1 transportMaxWeapons = 10; transportMaxMagazines = 80; transportmaxbackpacks = 15; -}; \ No newline at end of file + fuelCapacity = 757; +}; diff --git a/SQF/dayz_code/Configs/CfgVehicles/AIR/BAF_Merlin.hpp b/SQF/dayz_code/Configs/CfgVehicles/AIR/BAF_Merlin.hpp index 8c01b5a9b..feefb48c5 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/AIR/BAF_Merlin.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/AIR/BAF_Merlin.hpp @@ -9,4 +9,5 @@ class BAF_Merlin_DZE : BAF_Merlin_HC3_D { transportMaxWeapons = 15; transportMaxMagazines = 150; transportmaxbackpacks = 5; -}; \ No newline at end of file + fuelCapacity = 3222; +}; diff --git a/SQF/dayz_code/Configs/CfgVehicles/AIR/C130.hpp b/SQF/dayz_code/Configs/CfgVehicles/AIR/C130.hpp index 178c79795..4348ed7ef 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/AIR/C130.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/AIR/C130.hpp @@ -3,4 +3,5 @@ class C130J_US_EP1_DZ: C130J_US_EP1 { transportMaxWeapons = 50; transportMaxMagazines = 400; transportmaxbackpacks = 20; -}; \ No newline at end of file + fuelCapacity = 34095; +}; diff --git a/SQF/dayz_code/Configs/CfgVehicles/AIR/CH47.hpp b/SQF/dayz_code/Configs/CfgVehicles/AIR/CH47.hpp index fc339307d..f5e5224cc 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/AIR/CH47.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/AIR/CH47.hpp @@ -117,6 +117,7 @@ class CH47_base_EP1: Helicopter irScanRangeMin = 100; irScanRangeMax = 1000; irScanToEyeFactor = 2; + fuelCapacity = 4043; }; class CH_47F_EP1; @@ -278,4 +279,4 @@ class CH_47F_EP1_DZE: CH47_base_EP1 weapon = "M134_2"; }; }; -}; \ No newline at end of file +}; diff --git a/SQF/dayz_code/Configs/CfgVehicles/AIR/CH53.hpp b/SQF/dayz_code/Configs/CfgVehicles/AIR/CH53.hpp index e850e134e..b18f56d67 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/AIR/CH53.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/AIR/CH53.hpp @@ -27,4 +27,5 @@ class CH53_DZE : USEC_ch53_E { transportMaxWeapons = 25; transportMaxMagazines = 80; transportmaxbackpacks = 15; + fuelCapacity = 3849; }; \ No newline at end of file diff --git a/SQF/dayz_code/Configs/CfgVehicles/AIR/MV22.hpp b/SQF/dayz_code/Configs/CfgVehicles/AIR/MV22.hpp index c83f5d468..664fa5516 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/AIR/MV22.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/AIR/MV22.hpp @@ -11,4 +11,5 @@ class MV22_DZ : MV22 { transportMaxWeapons = 20; transportMaxMagazines = 400; transportmaxbackpacks = 10; -}; \ No newline at end of file + fuelCapacity = 6513; +}; diff --git a/SQF/dayz_code/Configs/CfgVehicles/AIR/Mi17.hpp b/SQF/dayz_code/Configs/CfgVehicles/AIR/Mi17.hpp index 6dac4f67d..9183962b6 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/AIR/Mi17.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/AIR/Mi17.hpp @@ -26,6 +26,7 @@ class Mi17_DZ: Mi17_base { transportMaxWeapons = 10; transportMaxMagazines = 50; transportmaxbackpacks = 10; + fuelCapacity = 1870; class Turrets : Turrets { class MainTurret : MainTurret { @@ -64,4 +65,4 @@ class Mi17_Civilian_DZ: Mi17_Civilian { transportMaxWeapons = 10; transportMaxMagazines = 50; transportmaxbackpacks = 10; -}; \ No newline at end of file +}; diff --git a/SQF/dayz_code/Configs/CfgVehicles/AIR/UH1.hpp b/SQF/dayz_code/Configs/CfgVehicles/AIR/UH1.hpp index f1ac0ca14..d42a071af 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/AIR/UH1.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/AIR/UH1.hpp @@ -28,6 +28,7 @@ class UH1Y_DZ: UH1_Base { transportmaxbackpacks = 4; weapons[] = {}; magazines[] = {}; + fuelCapacity = 1333; class Turrets : Turrets { class MainTurret : MainTurret { magazines[] = {"2000Rnd_762x51_M134"}; @@ -73,6 +74,7 @@ class UH1H_DZ: UH1H_base { transportMaxWeapons = 5; transportMaxMagazines = 25; transportmaxbackpacks = 4; + fuelCapacity = 1333; class Turrets : Turrets { class MainTurret : MainTurret { magazines[] = {"100Rnd_762x51_M240"}; @@ -91,4 +93,4 @@ class UH1H_DZE: UH1H_DZ { magazines[] = {}; }; }; -}; \ No newline at end of file +}; diff --git a/SQF/dayz_code/Configs/CfgVehicles/AIR/UH60.hpp b/SQF/dayz_code/Configs/CfgVehicles/AIR/UH60.hpp index e1b3f8693..419bad99b 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/AIR/UH60.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/AIR/UH60.hpp @@ -11,6 +11,7 @@ class UH60_Base: Helicopter { magazines[] = {"60Rnd_CMFlareMagazine"}; lockDetectionSystem = "8 + 4"; incommingMisslieDetectionSystem = 0; + fuelCapacity = 2760; }; class MH60S_DZ : UH60_Base { crew = ""; @@ -247,14 +248,13 @@ class UH60M_base_EP1: UH60_Base { icon = "\ca\air_e\data\UI\Icon_uh60m_CA.paa"; mapSize = 17; class Library { - libTextDesc = "The Blackhawk is the US Army’s front-line utility helicopter used for transport roles, medical evacuation and even air support.
It is capable of carrying 11 combat-equipped soldiers. Easy to maintain in the field, the Blackhawk performs well in a variety of roles including air assault and medical evacuation."; + libTextDesc = "The Blackhawk is the US Army�s front-line utility helicopter used for transport roles, medical evacuation and even air support.
It is capable of carrying 11 combat-equipped soldiers. Easy to maintain in the field, the Blackhawk performs well in a variety of roles including air assault and medical evacuation."; }; crew = "US_Soldier_Pilot_EP1"; typicalCargo[] = {"US_Soldier_Pilot_EP1","US_Soldier_Pilot_EP1"}; gunnerAction = "ManActTestDriver"; transportMaxBackpacks = 10; transportSoldier = 13; - fuelCapacity = 600; maxSpeed = 295; mainRotorSpeed = 1.2; backRotorSpeed = 6.1; @@ -549,4 +549,4 @@ class UH60M_EP1_DZE: UH60M_US_base_EP1 { weapon = "M134_2"; }; }; -}; \ No newline at end of file +}; diff --git a/SQF/dayz_code/Configs/CfgVehicles/LAND/Kamaz.hpp b/SQF/dayz_code/Configs/CfgVehicles/LAND/Kamaz.hpp index 1d6d219d7..57e535e33 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/LAND/Kamaz.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/LAND/Kamaz.hpp @@ -24,5 +24,5 @@ class KamazRefuel_DZ: KamazRefuel { class TransportMagazines{}; class TransportWeapons{}; transportFuel = 0; - fuelCapacity = 10000; -}; \ No newline at end of file + fuelCapacity = 10400; +}; diff --git a/SQF/dayz_code/Configs/CfgVehicles/SEA/PBX.hpp b/SQF/dayz_code/Configs/CfgVehicles/SEA/PBX.hpp index effd26a1d..398640b59 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/SEA/PBX.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/SEA/PBX.hpp @@ -26,4 +26,5 @@ class PBX: RubberBoat { transportMaxMagazines = 50; transportMaxWeapons = 5; transportMaxBackpacks = 1; -}; \ No newline at end of file + fuelCapacity = 23; +}; diff --git a/SQF/dayz_code/Configs/CfgVehicles/SEA/RHIB.hpp b/SQF/dayz_code/Configs/CfgVehicles/SEA/RHIB.hpp index 3d4870929..8524f99a1 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/SEA/RHIB.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/SEA/RHIB.hpp @@ -17,7 +17,7 @@ class Ship : AllVehicles maxSpeed = 30; simulation = "ship"; audible = 6; - fuelCapacity = 100; + fuelCapacity = 250; formationX = 50; formationZ = 100; brakeDistance = 50; @@ -569,4 +569,4 @@ class RHIB_DZ : Boat "ca\water\data\rhib_dash_destruct.rvmat" }; }; -}; \ No newline at end of file +}; diff --git a/SQF/dayz_code/actions/dayz_spaceInterrupt.sqf b/SQF/dayz_code/actions/dayz_spaceInterrupt.sqf index 0df2ca363..53de8087d 100644 --- a/SQF/dayz_code/actions/dayz_spaceInterrupt.sqf +++ b/SQF/dayz_code/actions/dayz_spaceInterrupt.sqf @@ -189,4 +189,9 @@ if (_dikCode == 0x39 || (_dikCode in actionKeys "User19")) then { DZE_5 = true; }; +// F key +if ((_dikCode == 0x21 && (!_alt && !_ctrl)) || (_dikCode in actionKeys "User6")) then { + DZE_F = true; +}; + _handled diff --git a/SQF/dayz_code/actions/player_build.sqf b/SQF/dayz_code/actions/player_build.sqf index c393f005f..ff7534816 100644 --- a/SQF/dayz_code/actions/player_build.sqf +++ b/SQF/dayz_code/actions/player_build.sqf @@ -337,7 +337,7 @@ if (_hasrequireditem) then { if(abs(_objHDiff) > 5) exitWith { _isOk = false; _cancel = true; - _reason = "Cannot move up || down more than 5 meters"; + _reason = "Cannot move up or down more than 5 meters"; detach _object; deleteVehicle _object; }; @@ -521,7 +521,7 @@ if (_hasrequireditem) then { publicVariableServer "PVDZE_obj_Publish"; cutText [format[(localize "str_epoch_player_140"),_combinationDisplay,_text], "PLAIN DOWN", 5]; - + systemChat format [(localize "str_epoch_player_140"),_combinationDisplay,_text]; } else { _tmpbuilt setVariable ["CharacterID",dayz_characterID,true]; diff --git a/SQF/dayz_code/actions/player_build2.sqf b/SQF/dayz_code/actions/player_build2.sqf new file mode 100644 index 000000000..339bfff29 --- /dev/null +++ b/SQF/dayz_code/actions/player_build2.sqf @@ -0,0 +1,627 @@ +/* + DayZ Base Building + Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com. +*/ +private ["_helperColor","_objectHelper","_objectHelperDir","_objectHelperPos","_canDo", +"_location","_dir","_classname","_item","_hasrequireditem","_missing","_hastoolweapon","_cancel","_reason","_started","_finished","_animState","_isMedic","_dis","_sfx","_hasbuilditem","_tmpbuilt","_onLadder","_isWater","_require","_text","_offset","_IsNearPlot","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_findNearestPoles","_findNearestPole","_distance","_classnametmp","_ghost","_isPole","_needText","_lockable","_zheightchanged","_rotate","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_combination_1_Display","_combinationDisplay","_zheightdirection","_abort","_isNear","_need","_needNear","_vehicle","_inVehicle","_requireplot","_objHDiff","_isLandFireDZ","_isTankTrap"]; + +if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_40") , "PLAIN DOWN"]; }; +DZE_ActionInProgress = true; + +// disallow building if too many objects are found within 30m +if((count ((getPosATL player) nearObjects ["All",30])) >= DZE_BuildingLimit) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_41"), "PLAIN DOWN"];}; + +_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; +_isWater = dayz_isSwimming; +_cancel = false; +_reason = ""; +_canBuildOnPlot = false; + +_vehicle = vehicle player; +_inVehicle = (_vehicle != player); +//snap +helperDetach = false; +_canDo = (!r_drag_sqf and !r_player_unconscious); + +DZE_Q = false; +DZE_Z = false; + +DZE_Q_alt = false; +DZE_Z_alt = false; + +DZE_Q_ctrl = false; +DZE_Z_ctrl = false; + +DZE_5 = false; +DZE_4 = false; +DZE_6 = false; +DZE_F = false; + +DZE_cancelBuilding = false; + +call gear_ui_init; +closeDialog 1; + +if (_isWater) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_26", "PLAIN DOWN"];}; +if (_inVehicle) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_42"), "PLAIN DOWN"];}; +if (_onLadder) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_21", "PLAIN DOWN"];}; +if (player getVariable["combattimeout", 0] >= time) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_43"), "PLAIN DOWN"];}; + +_item = _this; + +// Need Near Requirements +_abort = false; +_reason = ""; + +_needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "neednearby"); + +{ + switch(_x) do{ + case "fire": + { + _distance = 3; + _isNear = {inflamed _x} count (getPosATL player nearObjects _distance); + if(_isNear == 0) then { + _abort = true; + _reason = "fire"; + }; + }; + case "workshop": + { + _distance = 3; + _isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]); + if(_isNear == 0) then { + _abort = true; + _reason = "workshop"; + }; + }; + case "fueltank": + { + _distance = 30; + _isNear = count (nearestObjects [player, dayz_fuelsources, _distance]); + if(_isNear == 0) then { + _abort = true; + _reason = "fuel tank"; + }; + }; + }; +} forEach _needNear; + + +if(_abort) exitWith { + cutText [format[(localize "str_epoch_player_135"),_reason,_distance], "PLAIN DOWN"]; + DZE_ActionInProgress = false; +}; + +_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create"); +_classnametmp = _classname; +_require = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "require"); +_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName"); +_ghost = getText (configFile >> "CfgVehicles" >> _classname >> "ghostpreview"); + +_lockable = 0; +if(isNumber (configFile >> "CfgVehicles" >> _classname >> "lockable")) then { + _lockable = getNumber(configFile >> "CfgVehicles" >> _classname >> "lockable"); +}; + +_requireplot = DZE_requireplot; +if(isNumber (configFile >> "CfgVehicles" >> _classname >> "requireplot")) then { + _requireplot = getNumber(configFile >> "CfgVehicles" >> _classname >> "requireplot"); +}; + +_isAllowedUnderGround = 1; +if(isNumber (configFile >> "CfgVehicles" >> _classname >> "nounderground")) then { + _isAllowedUnderGround = getNumber(configFile >> "CfgVehicles" >> _classname >> "nounderground"); +}; + +_offset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset"); +if((count _offset) <= 0) then { + _offset = [0,1.5,0]; +}; + +_isPole = (_classname == "Plastic_Pole_EP1_DZ"); +_isLandFireDZ = (_classname == "Land_Fire_DZ"); + +_distance = DZE_PlotPole select 0; +_needText = localize "str_epoch_player_246"; + +if(_isPole) then { + _distance = DZE_PlotPole select 1; +}; + +// check for near plot +_findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance]; +_findNearestPole = []; + +{ + if (alive _x) then { + _findNearestPole set [(count _findNearestPole),_x]; + }; +} count _findNearestPoles; + +_IsNearPlot = count (_findNearestPole); + +// If item is plot pole && another one exists within 45m +if(_isPole && _IsNearPlot > 0) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_44") , "PLAIN DOWN"]; }; + +if(_IsNearPlot == 0) then { + + // Allow building of plot + if(_requireplot == 0 || _isLandFireDZ) then { + _canBuildOnPlot = true; + }; + +} else { + // Since there are plots nearby we check for ownership && then for friend status + + // check nearby plots ownership && then for friend status + _nearestPole = _findNearestPole select 0; + + // Find owner + _ownerID = _nearestPole getVariable ["CharacterID","0"]; + + // diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID]; + + // check if friendly to owner + if(dayz_characterID == _ownerID) then { //Keep ownership + // owner can build anything within his plot except other plots + if(!_isPole) then { + _canBuildOnPlot = true; + }; + + } else { + // disallow building plot + if(!_isPole) then { + _friendlies = player getVariable ["friendlyTo",[]]; + // check if friendly to owner + if(_ownerID in _friendlies) then { + _canBuildOnPlot = true; + }; + }; + }; +}; + +// _message +if(!_canBuildOnPlot) exitWith { DZE_ActionInProgress = false; cutText [format[(localize "STR_EPOCH_PLAYER_135"),_needText,_distance] , "PLAIN DOWN"]; }; + +_missing = ""; +_hasrequireditem = true; +{ + _hastoolweapon = _x in weapons player; + if(!_hastoolweapon) exitWith { _hasrequireditem = false; _missing = getText (configFile >> "cfgWeapons" >> _x >> "displayName"); }; +} count _require; + +_hasbuilditem = _this in magazines player; +if (!_hasbuilditem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]; }; + +if (!_hasrequireditem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_epoch_player_137"),_missing] , "PLAIN DOWN"]; }; +if (_hasrequireditem) then { + + _location = [0,0,0]; + _isOk = true; + + // get inital players position + _location1 = getPosATL player; + _dir = getDir player; + + // if ghost preview available use that instead + if (_ghost != "") then { + _classname = _ghost; + }; + + _object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"]; + //Build gizmo + _objectHelper = "Sign_sphere10cm_EP1" createVehicle _location; + _helperColor = "#(argb,8,8,3)color(0,0,0,0,ca)"; + _objectHelper setobjecttexture [0,_helperColor]; + _objectHelper attachTo [player,_offset]; + _object attachTo [_objectHelper,[0,0,0]]; + _position = getPosATL _objectHelper; + + //cutText [(localize "str_epoch_player_45"), "PLAIN DOWN"]; + + _objHDiff = 0; + +if (isClass (configFile >> "SnapBuilding" >> _classname)) then { + ["","","",["Init",_object,_classname,_objectHelper]] spawn snap_build; +}; + + while {_isOk} do { + + _zheightchanged = false; + _zheightdirection = ""; + _rotate = false; + + if (DZE_Q) then { + DZE_Q = false; + _zheightdirection = "up"; + _zheightchanged = true; + }; + if (DZE_Z) then { + DZE_Z = false; + _zheightdirection = "down"; + _zheightchanged = true; + }; + if (DZE_Q_alt) then { + DZE_Q_alt = false; + _zheightdirection = "up_alt"; + _zheightchanged = true; + }; + if (DZE_Z_alt) then { + DZE_Z_alt = false; + _zheightdirection = "down_alt"; + _zheightchanged = true; + }; + if (DZE_Q_ctrl) then { + DZE_Q_ctrl = false; + _zheightdirection = "up_ctrl"; + _zheightchanged = true; + }; + if (DZE_Z_ctrl) then { + DZE_Z_ctrl = false; + _zheightdirection = "down_ctrl"; + _zheightchanged = true; + }; + if (DZE_4) then { + _rotate = true; + DZE_4 = false; + if (helperDetach) then { + _dir = -45; + } else { + _dir = 180; + }; + }; + if (DZE_6) then { + _rotate = true; + DZE_6 = false; + if (helperDetach) then { + _dir = 45; + } else { + _dir = 0; + }; + }; + + if (DZE_F and _canDo) then { + if (helperDetach) then { + _objectHelperDir = getDir _objectHelper; + _objectHelper attachTo [player]; + _objectHelper setDir _objectHelperDir-(getDir player); + helperDetach = false; + } else { + _objectHelperPos = getPosATL _objectHelper; + detach _objectHelper; + _objectHelper setPosATL _objectHelperPos; + _objectHelperDir = getDir _objectHelper; + _objectHelper setVelocity [0,0,0]; //fix sliding glitch + helperDetach = true; + }; + DZE_F = false; + }; + + if(_rotate) then { + if (helperDetach) then { + _objectHelperDir = getDir _objectHelper; + _objectHelperPos = getPosATL _objectHelper; + _objectHelper setDir _objectHelperDir+_dir; + _objectHelper setPosATL _objectHelperPos; + } else { + _objectHelper setDir _dir; + _objectHelper setPosATL _position; + //diag_log format["DEBUG Rotate BUILDING POS: %1", _position]; + }; + + }; + + if(_zheightchanged) then { + if (!helperDetach) then { + detach _objectHelper; + }; + + _position = getPosATL _objectHelper; + + if(_zheightdirection == "up") then { + _position set [2,((_position select 2)+0.1)]; + _objHDiff = _objHDiff + 0.1; + }; + if(_zheightdirection == "down") then { + _position set [2,((_position select 2)-0.1)]; + _objHDiff = _objHDiff - 0.1; + }; + + if(_zheightdirection == "up_alt") then { + _position set [2,((_position select 2)+1)]; + _objHDiff = _objHDiff + 1; + }; + if(_zheightdirection == "down_alt") then { + _position set [2,((_position select 2)-1)]; + _objHDiff = _objHDiff - 1; + }; + + if(_zheightdirection == "up_ctrl") then { + _position set [2,((_position select 2)+0.01)]; + _objHDiff = _objHDiff + 0.01; + }; + if(_zheightdirection == "down_ctrl") then { + _position set [2,((_position select 2)-0.01)]; + _objHDiff = _objHDiff - 0.01; + }; + + _objectHelper setDir (getDir _objectHelper); + + if((_isAllowedUnderGround == 0) && ((_position select 2) < 0)) then { + _position set [2,0]; + }; + + _objectHelper setPosATL _position; + + //diag_log format["DEBUG Change BUILDING POS: %1", _position]; + + if (!helperDetach) then { + _objectHelper attachTo [player]; + }; + }; + + sleep 0.5; + + _location2 = getPosATL player; + + if(DZE_5) exitWith { + _isOk = false; + detach _object; + _dir = getDir _object; + _position = getPosATL _object; + //diag_log format["DEBUG BUILDING POS: %1", _position]; + deleteVehicle _object; + detach _objectHelper; + deleteVehicle _objectHelper; + }; + + if(_location1 distance _location2 > 10) exitWith { + _isOk = false; + _cancel = true; + _reason = "You've moved to far away from where you started building (within 10 meters)"; + detach _object; + deleteVehicle _object; + detach _objectHelper; + deleteVehicle _objectHelper; + }; + + if(_location1 distance _objectHelperPos > 10) exitWith { + _isOk = false; + _cancel = true; + _reason = "Object is placed to far away from where you started building (within 10 meters)"; + detach _object; + deleteVehicle _object; + detach _objectHelper; + deleteVehicle _objectHelper; + }; + + if(abs(_objHDiff) > 10) exitWith { + _isOk = false; + _cancel = true; + _reason = "Cannot move up or down more than 10 meters"; + detach _object; + deleteVehicle _object; + detach _objectHelper; + deleteVehicle _objectHelper; + }; + + if (player getVariable["combattimeout", 0] >= time) exitWith { + _isOk = false; + _cancel = true; + _reason = (localize "str_epoch_player_43"); + detach _object; + deleteVehicle _object; + detach _objectHelper; + deleteVehicle _objectHelper; + }; + + if (DZE_cancelBuilding) exitWith { + _isOk = false; + _cancel = true; + _reason = "Cancelled building."; + detach _object; + deleteVehicle _object; + detach _objectHelper; + deleteVehicle _objectHelper; + }; + }; + + //No building on roads unless toggled + if (!DZE_BuildOnRoads) then { + if (isOnRoad _position) then { _cancel = true; _reason = "Cannot build on a road."; }; + }; + + // No building in trader zones + if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; }; + + if(!_cancel) then { + + _classname = _classnametmp; + + // Start Build + _tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"]; + + _tmpbuilt setdir _dir; + + // Get position based on object + _location = _position; + + if((_isAllowedUnderGround == 0) && ((_location select 2) < 0)) then { + _location set [2,0]; + }; + + _tmpbuilt setPosATL _location; + + + cutText [format[(localize "str_epoch_player_138"),_text], "PLAIN DOWN"]; + + _limit = 3; + + if (DZE_StaticConstructionCount > 0) then { + _limit = DZE_StaticConstructionCount; + } + else { + if (isNumber (configFile >> "CfgVehicles" >> _classname >> "constructioncount")) then { + _limit = getNumber(configFile >> "CfgVehicles" >> _classname >> "constructioncount"); + }; + }; + + _isOk = true; + _proceed = false; + _counter = 0; + + while {_isOk} do { + + [10,10] call dayz_HungerThirst; + player playActionNow "Medic"; + + _dis=20; + _sfx = "repair"; + [player,_sfx,0,false,_dis] call dayz_zombieSpeak; + [player,_dis,true,(getPosATL player)] spawn player_alertZombies; + + r_interrupt = false; + r_doLoop = true; + _started = false; + _finished = false; + + while {r_doLoop} do { + _animState = animationState player; + _isMedic = ["medic",_animState] call fnc_inString; + if (_isMedic) then { + _started = true; + }; + if (_started && !_isMedic) then { + r_doLoop = false; + _finished = true; + }; + if (r_interrupt || (player getVariable["combattimeout", 0] >= time)) then { + r_doLoop = false; + }; + if (DZE_cancelBuilding) exitWith { + r_doLoop = false; + }; + sleep 0.1; + }; + r_doLoop = false; + + + if(!_finished) exitWith { + _isOk = false; + _proceed = false; + }; + + if(_finished) then { + _counter = _counter + 1; + }; + + cutText [format[(localize "str_epoch_player_139"),_text, _counter,_limit], "PLAIN DOWN"]; + + if(_counter == _limit) exitWith { + _isOk = false; + _proceed = true; + }; + + }; + + if (_proceed) then { + + _num_removed = ([player,_item] call BIS_fnc_invRemove); + if(_num_removed == 1) then { + + cutText [format[localize "str_build_01",_text], "PLAIN DOWN"]; + + if (_isPole) then { + [] spawn player_plotPreview; + }; + + _tmpbuilt setVariable ["OEMPos",_location,true]; + + if(_lockable > 1) then { + + _combinationDisplay = ""; + + switch (_lockable) do { + + case 2: { // 2 lockbox + _combination_1 = (floor(random 3)) + 100; // 100=red,101=green,102=blue + _combination_2 = floor(random 10); + _combination_3 = floor(random 10); + _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; + dayz_combination = _combination; + if (_combination_1 == 100) then { + _combination_1_Display = "Red"; + }; + if (_combination_1 == 101) then { + _combination_1_Display = "Green"; + }; + if (_combination_1 == 102) then { + _combination_1_Display = "Blue"; + }; + _combinationDisplay = format["%1%2%3",_combination_1_Display,_combination_2,_combination_3]; + }; + + case 3: { // 3 combolock + _combination_1 = floor(random 10); + _combination_2 = floor(random 10); + _combination_3 = floor(random 10); + _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3]; + dayz_combination = _combination; + _combinationDisplay = _combination; + }; + + case 4: { // 4 safe + _combination_1 = floor(random 10); + _combination_2 = floor(random 10); + _combination_3 = floor(random 10); + _combination_4 = floor(random 10); + _combination = format["%1%2%3%4",_combination_1,_combination_2,_combination_3,_combination_4]; + dayz_combination = _combination; + _combinationDisplay = _combination; + }; + }; + + _tmpbuilt setVariable ["CharacterID",_combination,true]; + + + PVDZE_obj_Publish = [_combination,_tmpbuilt,[_dir,_location],_classname]; + publicVariableServer "PVDZE_obj_Publish"; + + cutText [format[(localize "str_epoch_player_140"),_combinationDisplay,_text], "PLAIN DOWN", 5]; + systemChat format [(localize "str_epoch_player_140"),_combinationDisplay,_text]; + + } else { + _tmpbuilt setVariable ["CharacterID",dayz_characterID,true]; + + // fire? + if(_tmpbuilt isKindOf "Land_Fire_DZ") then { + _tmpbuilt spawn player_fireMonitor; + } else { + PVDZE_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location],_classname]; + publicVariableServer "PVDZE_obj_Publish"; + }; + }; + } else { + deleteVehicle _tmpbuilt; + cutText [(localize "str_epoch_player_46") , "PLAIN DOWN"]; + }; + + } else { + r_interrupt = false; + if (vehicle player == player) then { + [objNull, player, rSwitchMove,""] call RE; + player playActionNow "stop"; + }; + + deleteVehicle _tmpbuilt; + + cutText [(localize "str_epoch_player_46") , "PLAIN DOWN"]; + }; + + } else { + cutText [format[(localize "str_epoch_player_47"),_text,_reason], "PLAIN DOWN"]; + }; +}; + +DZE_ActionInProgress = false; diff --git a/SQF/dayz_code/actions/snap_build.sqf b/SQF/dayz_code/actions/snap_build.sqf new file mode 100644 index 000000000..88a2f32ba --- /dev/null +++ b/SQF/dayz_code/actions/snap_build.sqf @@ -0,0 +1,294 @@ +/*-----------------------------------*/ +// by Raymix // +// July 10 2014 // +/*--------------------------------*/ + +private ["_object","_objectSnapGizmo","_objColorActive","_objColorInactive","_classname","_whitelist","_points","_radius","_cfg","_cnt","_pos","_findWhitelisted","_nearbyObject","_posNearby","_selectedAction","_newPos","_pointsNearby","_onWater"]; +//Args +snapActionState = _this select 3 select 0; +_object = _this select 3 select 1; +_classname = _this select 3 select 2; +_objectHelper = _this select 3 select 3; +_selectedAction = _this select 3 select 4; + +//Snap config file +_cfg = (configFile >> "SnapBuilding" >> _classname); +_whitelist = getArray (_cfg >> "snapTo"); +_points = getArray (_cfg >> "points"); +_radius = getNumber (_cfg >> "radius"); + +//colors +_objColorActive = "#(argb,8,8,3)color(0,0.92,0.06,1,ca)"; +_objColorInactive = "#(argb,8,8,3)color(0.04,0.84,0.92,0.3,ca)"; + + +fnc_snapActionCleanup = { + private ["_s1","_s2","_s3","_cnt"]; + _s1 = _this select 0; + _s2 = _this select 1; + _s3 = _this select 2; + player removeAction s_player_toggleSnap; s_player_toggleSnap = -1; + player removeAction s_player_toggleSnapSelect; s_player_toggleSnapSelect = -1; + if (count s_player_toggleSnapSelectPoint != 0) then {{player removeAction _x;} count s_player_toggleSnapSelectPoint; s_player_toggleSnapSelectPoint=[]; snapActions = -1;}; + if (_s1 > 0) then { + s_player_toggleSnap = player addaction [format[("" + ("Snap: %1") +""),snapActionState],"\z\addons\dayz_code\actions\snap_build.sqf",[snapActionState,_object,_classname,_objectHelper],6,false,true]; + }; + if (_s2 > 0) then { + s_player_toggleSnapSelect = player addaction [format[("" + ("Snap Point: %1") +""),snapActionStateSelect],"\z\addons\dayz_code\actions\snap_build.sqf",[snapActionStateSelect,_object,_classname,_objectHelper],5,false,true]; + }; + if (_s3 > 0) then { + s_player_toggleSnapSelectPoint=[]; + _cnt = 0; + {snapActions = player addaction [format[("" + ("%1)Select: %2") +""),_cnt,_x select 3],"\z\addons\dayz_code\actions\snap_build.sqf",["Selected",_object,_classname,_objectHelper,_cnt],4,false,false]; + s_player_toggleSnapSelectPoint set [count s_player_toggleSnapSelectPoint,snapActions]; + _cnt = _cnt+1; + }count _points; + }; +}; + +fnc_initSnapPoints = { + snapGizmos = []; + { + _objectSnapGizmo = "Sign_sphere10cm_EP1" createVehicleLocal [0,0,0]; + _objectSnapGizmo setobjecttexture [0,_objColorInactive]; + _objectSnapGizmo attachTo [_object,[_x select 0,_x select 1,_x select 2]]; + snapGizmos set [count snapGizmos,_objectSnapGizmo]; + } count _points; +}; + +fnc_initSnapPointsNearby = { + _pos = getPosATL _object; + _findWhitelisted = []; _pointsNearby = []; + _findWhitelisted = nearestObjects [_pos,_whitelist,_radius]-[_object]; + snapGizmosNearby = []; + { + _nearbyObject = _x; + _pointsNearby = getArray (configFile >> "SnapBuilding" >> (typeOf _x) >> "points"); + { + _onWater = surfaceIsWater position _nearbyObject; + _objectSnapGizmo = "Sign_sphere10cm_EP1" createVehicleLocal [0,0,0]; + _objectSnapGizmo setobjecttexture [0,_objColorInactive]; + _posNearby = _nearbyObject modelToWorld [_x select 0,_x select 1,_x select 2]; + if (_onWater) then { + _objectSnapGizmo setPosASL [(_posNearby) select 0,(_posNearby) select 1,(getPosASL _nearbyObject select 2) + (_x select 2)]; + } else { + _objectSnapGizmo setPosATL _posNearby; + }; + _objectSnapGizmo setDir (getDir _nearbyObject); + snapGizmosNearby set [count snapGizmosNearby,_objectSnapGizmo]; + } count _pointsNearby; + } forEach _findWhitelisted; +}; + +fnc_initSnapPointsCleanup = { + {detach _x;deleteVehicle _x;}count snapGizmos;snapGizmos=[]; + {deleteVehicle _x;}count snapGizmosNearby;snapGizmosNearby=[]; + snapActionState = "OFF"; +}; + +fnc_snapDistanceCheck = { + while {snapActionState != "OFF"} do { + private ["_distClosestPointFound","_distCheck","_distClosest","_distClosestPoint","_testXPos","_testXDir","_distClosestPointFoundPos","_distClosestPointFoundDir","_distClosestAttached","_distCheckAttached","_distClosestAttachedFoundPos"]; + _distClosestPointFound = objNull; _distCheck = 0; _distClosest = 10; _distClosestPoint = objNull; _testXPos = []; _distClosestPointFoundPos =[]; _distClosestPointFoundDir = 0; + { + if (_x !=_distClosestPointFound) then {_x setobjecttexture [0,_objColorInactive];}; + _onWater = surfaceIsWater position _x; + if (_onWater) then { + _testXPos = [(getPosASL _x select 0),(getPosASL _x select 1),(getPosASL _x select 2)]; + } else { + _testXPos = [(getPosATL _x select 0),(getPosATL _x select 1),(getPosATL _x select 2)]; + }; + _distCheck = _objectHelper distance _testXPos; + _distClosestPoint = _x; + if (_distCheck < _distClosest) then { + _distClosest = _distCheck; + _distClosestPointFound setobjecttexture [0,_objColorInactive]; + _distClosestPointFound = _x; + _distClosestPointFound setobjecttexture [0,_objColorActive]; + }; + } count snapGizmosNearby; + + if (!isNull _distClosestPointFound) then { + if (snapActionStateSelect == "Manual") then { + if (helperDetach) then { + _onWater = surfaceIsWater position _distClosestPointFound; + _distClosestPointFoundDir = getDir _distClosestPointFound; + if (_onWater) then { + _distClosestPointFoundPos = getPosASL _distClosestPointFound; + _objectHelper setPosASL _distClosestPointFoundPos; + } else { + _distClosestPointFoundPos = getPosATL _distClosestPointFound; + _objectHelper setPosATL _distClosestPointFoundPos; + }; + _objectHelper setDir _distClosestPointFoundDir; + waitUntil {sleep 0.1; !helperDetach}; + }; + } else { + _distClosestAttached = objNull; _distCheckAttached = 0; _distClosest = 10; _distClosestAttachedFoundPos = []; + { + if (_x !=_distClosestAttached) then {_x setobjecttexture [0,_objColorInactive];}; + _onWater = surfaceIsWater position _x; + if (_onWater) then { + _testXPos = [(getPosASL _x select 0),(getPosASL _x select 1),(getPosASL _x select 2)]; + } else { + _testXPos = [(getPosATL _x select 0),(getPosATL _x select 1),(getPosATL _x select 2)]; + }; + _distCheckAttached = _distClosestPointFound distance _testXPos; + _distClosestPoint = _x; + if (_distCheckAttached < _distClosest) then { + _distClosest = _distCheckAttached; + _distClosestAttached setobjecttexture [0,_objColorInactive]; + _distClosestAttached = _x; + _distClosestAttached setobjecttexture [0,_objColorActive]; + }; + } count snapGizmos; + + if (helperDetach) then { + _distClosestPointFoundDir = getDir _distClosestPointFound; + _onWater = surfaceIsWater position _distClosestPointFound; + if (_onWater) then { + _distClosestPointFoundPos = getPosASL _distClosestPointFound; + _distClosestAttachedFoundPos = getPosASL _distClosestAttached; + detach _object; + _objectHelper setPosASL _distClosestAttachedFoundPos; + _object attachTo [_objectHelper]; + _objectHelper setPosASL _distClosestPointFoundPos; + } else { + _distClosestPointFoundPos = getPosATL _distClosestPointFound; + _distClosestAttachedFoundPos = getPosATL _distClosestAttached; + detach _object; + _objectHelper setPosATL _distClosestAttachedFoundPos; + _object attachTo [_objectHelper]; + _objectHelper setPosATL _distClosestPointFoundPos; + }; + _objectHelper setDir _distClosestPointFoundDir; + waitUntil {sleep 0.1; !helperDetach}; + }; + }; + }; + sleep 0.1; + }; +}; + +fnc_initSnapTutorial = { +/* + Shows help dialog for player ONCE per log in, explaining controls. + Add snapTutorial = false; to your init.sqf to disable this tutorial completely. + You can also add this bool to the end of this function to only show tutorial once per player login (not recommended) +*/ + private ["_bldTxtSwitch","_bldTxtEnable","_bldTxtClrO","_bldTxtClrW","_bldTxtClrR","_bldTxtClrG","_bldTxtSz","_bldTxtSzT","_bldTxtShdw","_bldTxtAlgnL","_bldTxtUndrln","_bldTxtBold","_bldTxtFinal","_bldTxtStringTitle","_bldTxtStringSD","_bldTxtStringSE","_bldTxtStringSA","_bldTxtStringSM","_bldTxtStringPG","_bldTxtStringAPG","_bldTxtStringCPG","_bldTxtStringQE","_bldTxtStringQEF","_bldTxtStringFD","_bldTxtStringFS"]; + if (isNil "snapTutorial") then { + _bldTxtSwitch = _this select 0; + _bldTxtEnable = _this select 1; + _bldTxtClrO = "color='#ff8800'"; //orange + _bldTxtClrW = "color='#ffffff'"; //white + _bldTxtClrR = "color='#fd0a05'"; //red + _bldTxtClrG = "color='#11ef00'"; //green + _bldTxtSz = "size='0.76'"; //Title font size + _bldTxtSzT = "size='0.4'"; //Text font size + _bldTxtShdw = "shadow='1'"; //Font shadow + _bldTxtAlgnL = "align='left'"; //Text align left + _bldTxtUndrln = "underline='true'"; + _bldTxtBold = "font='Zeppelin33'"; //Bold text + _bldTxtFinal = ""; + + //Delete on init + 800 cutRsc ["Default", "PLAIN"]; + sleep 0.1; + + //Init Tutorial text + if (_bldTxtEnable) then { + _bldTxtStringTitle = format ["Epoch Snap Building
",_bldTxtClrW,_bldTxtSz,_bldTxtShdw,_bldTxtAlgnL,_bldTxtClrO,_bldTxtUndrln,_bldTxtBold]; + _bldTxtStringSD = format["[Snap] Disabled: use action menu to enable.

",_bldTxtClrO,_bldTxtClrR,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL]; + _bldTxtStringSE = format["[Snap] Enabled: use action menu to disable.

",_bldTxtClrO,_bldTxtClrG,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL]; + _bldTxtStringSA = format["[Auto]: Automatic snap point detection.

",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL]; + _bldTxtStringSM = format["[Manual]: Select your preferred snap point.

",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL]; + _bldTxtStringPG = format["[PgUP / PgDOWN]: Adjust height of object by 10cm
",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL]; + _bldTxtStringAPG = format["[Alt]+[PgUP / PgDOWN]: Adjust height of object by 1m
",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL]; + _bldTxtStringCPG = format["[Ctrl]+[PgUP / PgDOWN]: Adjust height of object by 1cm
",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL]; + _bldTxtStringQE = format["[Q / E]: Rotate object 180 degrees while holding.
",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL]; + _bldTxtStringQEF = format["[Q / E]: Rotate object 45 degrees while dropped or snapped.

",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL]; + _bldTxtStringFD = format["[F]: Drop / Pick up object.
",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL]; + _bldTxtStringFS = format["[F]: Snap /Pick up object.
",_bldTxtClrO,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL]; + switch (_bldTxtSwitch) do { + case "init": { + _bldTxtFinal = _bldTxtStringTitle + _bldTxtStringSD + _bldTxtStringPG + _bldTxtStringAPG + _bldTxtStringCPG + _bldTxtStringQE + _bldTxtStringQEF + _bldTxtStringFD; + }; + case "OnAuto": { + _bldTxtFinal = _bldTxtStringTitle + _bldTxtStringSE + _bldTxtStringSA + _bldTxtStringPG + _bldTxtStringAPG + _bldTxtStringCPG + _bldTxtStringQE + _bldTxtStringQEF + _bldTxtStringFS; + }; + case "manual": { + _bldTxtFinal = _bldTxtStringTitle + _bldTxtStringSE + _bldTxtStringSM + _bldTxtStringPG + _bldTxtStringAPG + _bldTxtStringCPG + _bldTxtStringQE + _bldTxtStringQEF + _bldTxtStringFS; + }; + }; + + [ + _bldTxtFinal, //structured text + 0.73 * safezoneW + safezoneX, //number - x + 0.65 * safezoneH + safezoneY, //number - y + 30, //number - duration + 1, // number - fade in time + 0, // number - delta y + 800 //number - layer ID + ] spawn bis_fnc_dynamicText; + }; + }; +}; + +switch (snapActionState) do { + case "Init": { + ["init",true] call fnc_initSnapTutorial; + snapActionState = "OFF"; + [1,0,0] call fnc_snapActionCleanup; + [] spawn { + while {true} do { + if(!DZE_ActionInProgress) exitWith {call fnc_initSnapPointsCleanup;[0,0,0] call fnc_snapActionCleanup; ["",false] call fnc_initSnapTutorial; snapActionState = "OFF";}; + sleep 2; + }; + }; + }; + case "OFF": { + ["OnAuto",true] call fnc_initSnapTutorial; + snapActionState = "ON"; snapActionStateSelect = "Auto"; + [1,1,0] call fnc_snapActionCleanup; + call fnc_initSnapPoints; + call fnc_initSnapPointsNearby; + sleep 0.25; + call fnc_snapDistanceCheck; + }; + + case "ON": { + ["init",true] call fnc_initSnapTutorial; + snapActionState = "OFF"; + [1,0,0] call fnc_snapActionCleanup; + call fnc_initSnapPointsCleanup; + }; + + case "Auto": { + ["manual",true] call fnc_initSnapTutorial; + snapActionState = "ON";snapActionStateSelect = "Manual"; + [1,1,1] call fnc_snapActionCleanup; + }; + + case "Manual": { + ["OnAuto",true] call fnc_initSnapTutorial; + snapActionState = "ON";snapActionStateSelect = "Auto"; + [1,1,0] call fnc_snapActionCleanup; + }; + + case "Selected": { _cnt = 0; _newPos = []; +{ + _x setobjecttexture [0,_objColorInactive]; + if (_cnt == _selectedAction) then { + _newPos = [(getPosATL _x select 0),(getPosATL _x select 1),(getPosATL _x select 2)]; + detach _object; + detach _objectHelper; + _objectHelper setPosATL _newPos; + _object attachTo [_objectHelper]; + _x setobjecttexture [0,_objColorActive]; + if (!helperDetach) then {_objectHelper attachTo [player];}; + }; + _cnt = _cnt+1; +}count snapGizmos; + }; +}; diff --git a/SQF/dayz_code/actions/trade_items_wo_db.sqf b/SQF/dayz_code/actions/trade_items_wo_db.sqf index 7984c9ea2..2ba3f85ad 100644 --- a/SQF/dayz_code/actions/trade_items_wo_db.sqf +++ b/SQF/dayz_code/actions/trade_items_wo_db.sqf @@ -4,7 +4,7 @@ private ["_part_out","_part_in","_qty_out","_qty_in","_textPartIn","_textPartOut if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_103") , "PLAIN DOWN"]; }; DZE_ActionInProgress = true; -//_activatingPlayer = if (DayZ_UseSteamID) then {GetPlayerUID player;} else {GetPlayerUIDOld player;}; +//_activatingPlayer = [player] call FNC_GetPlayerUID; _part_out = (_this select 3) select 0; _part_in = (_this select 3) select 1; diff --git a/SQF/dayz_code/actions/trade_weapons.sqf b/SQF/dayz_code/actions/trade_weapons.sqf index 9dd34bdd2..b81feea20 100644 --- a/SQF/dayz_code/actions/trade_weapons.sqf +++ b/SQF/dayz_code/actions/trade_weapons.sqf @@ -40,7 +40,7 @@ if(_buy_o_sell == "sell") then { } else { // buying item type must NOT exist if rifle || pistol - _msg = "Drop || sell your current weapon before you can buy a new one."; + _msg = "Drop or sell your current weapon before you can buy a new one."; _config = (configFile >> "CfgWeapons" >> _part_out); _configName = configName(_config); _wepType = getNumber(_config >> "Type"); @@ -64,7 +64,7 @@ if(_buy_o_sell == "sell") then { }; if(_isToolBelt || _isBinocs) then { _abort = (_configName in (weapons player)); - _msg = "Drop || sell your current toolbelt item before you can buy a new one."; + _msg = "Drop or sell your current toolbelt item before you can buy a new one."; }; }; diff --git a/SQF/dayz_code/compile/fn_unconscious.sqf b/SQF/dayz_code/compile/fn_unconscious.sqf index 4884f6e7f..6f01bf26b 100644 --- a/SQF/dayz_code/compile/fn_unconscious.sqf +++ b/SQF/dayz_code/compile/fn_unconscious.sqf @@ -11,7 +11,9 @@ if ((!r_player_handler1) && (r_handlerCount == 0)) then { _timeout = 0; r_handlerCount = r_handlerCount + 1; r_player_handler1 = true; - player playAction "CanNotMove"; + if (vehicle player == player) then { + player playAction "CanNotMove"; + }; "dynamicBlur" ppEffectEnable true;"dynamicBlur" ppEffectAdjust [2]; "dynamicBlur" ppEffectCommit 0; "colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.1], [1, 1, 1, 0.0]];"colorCorrections" ppEffectCommit 0; 0 fadeSound 0.05; diff --git a/SQF/dayz_code/compile/player_death.sqf b/SQF/dayz_code/compile/player_death.sqf index d794023ee..d6046fbcd 100644 --- a/SQF/dayz_code/compile/player_death.sqf +++ b/SQF/dayz_code/compile/player_death.sqf @@ -12,7 +12,7 @@ if (dialog) then {closeDialog 0;}; if (visibleMap) then {openMap false;}; _body = player; -_playerID = if (DayZ_UseSteamID) then {GetPlayerUID player;} else {GetPlayerUIDOld player;}; +_playerID = [player] call FNC_GetPlayerUID; disableUserInput true; //add weapon on back to player... diff --git a/SQF/dayz_code/compile/player_switchModel.sqf b/SQF/dayz_code/compile/player_switchModel.sqf index bc928712a..41a8e954d 100644 --- a/SQF/dayz_code/compile/player_switchModel.sqf +++ b/SQF/dayz_code/compile/player_switchModel.sqf @@ -1,11 +1,11 @@ private ["_weapons","_backpackWpn","_backpackMag","_currentWpn","_isWeapon","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_tagSetting","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_playerObjName","_wpnType","_ismelee"]; - +if (gear_done) then {disableUserInput true;}; _class = _this; _position = getPosATL player; _dir = getDir player; _currentAnim = animationState player; _tagSetting = player getVariable["DZE_display_name",false]; -_playerUID = if (DayZ_UseSteamID) then {GetPlayerUID player;} else {GetPlayerUIDOld player;}; +_playerUID = [player] call FNC_GetPlayerUID; _weapons = weapons player; _countMags = call player_countMagazines; _magazines = _countMags select 0; @@ -16,11 +16,11 @@ _primweapon = primaryWeapon player; _secweapon = secondaryWeapon player; if(!(_primweapon in _weapons) && _primweapon != "") then { - _weapons = _weapons + [_primweapon]; + _weapons set [(count _weapons), _primweapon]; }; if(!(_secweapon in _weapons) && _secweapon != "") then { - _weapons = _weapons + [_secweapon]; + _weapons set [(count _weapons), _secweapon]; }; //BackUp Backpack @@ -127,6 +127,7 @@ if (!isNil "_newBackpackType") then { [] call _switchUnit; if (gear_done) then {sleep 0.001;}; ["1"] call gearDialog_create; + if (gear_done) then {sleep 0.001;}; //magazines _countr = 0; { @@ -147,6 +148,7 @@ if (!isNil "_newBackpackType") then { }; } count _backpackMag; (findDisplay 106) closeDisplay 0; + if (gear_done) then {sleep 0.001; disableUserInput false;}; _countr = 0; { (unitBackpack player) addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)]; @@ -156,26 +158,14 @@ if (!isNil "_newBackpackType") then { } else { [] call _switchUnit; }; [objNull, player, rSwitchMove,_currentAnim] call RE; player disableConversation true; - -//player setVariable ["bodyName",dayz_playerName,true]; //Outcommit (Issue #991) - Also removed in DayZ Mod 1.8 - if (_tagSetting) then { DZE_ForceNameTags = true; }; -/* -_playerUID = if (DayZ_UseSteamID) then {GetPlayerUID player;} else {GetPlayerUIDOld player;}; -_playerObjName = format["PVDZE_player%1",_playerUID]; -call compile format["%1 = player;",_playerObjName]; -publicVariableServer _playerObjName; -*/ - -//melee check _wpnType = primaryWeapon player; _ismelee = (gettext (configFile >> "CfgWeapons" >> _wpnType >> "melee")); if (_ismelee == "true") then { call dayz_meleeMagazineCheck; }; -//reveal the same objects we do on login {player reveal _x} count (nearestObjects [getPosATL player, dayz_reveal, 50]); diff --git a/SQF/dayz_code/compile/player_unlockVault.sqf b/SQF/dayz_code/compile/player_unlockVault.sqf index 3696e1933..2c30ada89 100644 --- a/SQF/dayz_code/compile/player_unlockVault.sqf +++ b/SQF/dayz_code/compile/player_unlockVault.sqf @@ -39,7 +39,7 @@ if ((_ownerID == dayz_combination) || (_ownerID == dayz_playerUID)) then { // Check if any players are nearby if not allow player to claim item. _playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]) > 1; - _playerID = if (DayZ_UseSteamID) then {GetPlayerUID player;} else {GetPlayerUIDOld player;}; + _playerID = [player] call FNC_GetPlayerUID; // Only allow if not already claimed. if (_claimedBy == "0" || !_playerNear) then { diff --git a/SQF/dayz_code/compile/player_updateGui.sqf b/SQF/dayz_code/compile/player_updateGui.sqf index 9d7bba2f4..f0c245b9e 100644 --- a/SQF/dayz_code/compile/player_updateGui.sqf +++ b/SQF/dayz_code/compile/player_updateGui.sqf @@ -87,32 +87,49 @@ if (!canStand player) then { /* Flashing: */ -if (_combatVal == 1) then { - _ctrlCombat call player_guiControlFlash; +_ctrl_Array=[]; +if (_combatVal > 0) then { + _ctrl_Array=_ctrl_Array + [_ctrlCombat]; +}else { + _ctrlCombat ctrlShow true; }; -if (_bloodVal < 0.2) then { - _ctrlBlood call player_guiControlFlash; + +if (_bloodVal < 0.4) then { + _ctrl_Array=_ctrl_Array + [_ctrlBlood]; +}else { + _ctrlBlood ctrlShow true; }; + if (_thirstVal > 0.8) then { - _ctrlThirst call player_guiControlFlash; + _ctrl_Array=_ctrl_Array + [_ctrlThirst]; +}else { + _ctrlThirst ctrlShow true; }; if (_foodVal > 0.8) then { - _ctrlFood call player_guiControlFlash; + _ctrl_Array=_ctrl_Array + [_ctrlFood]; +}else { + _ctrlFood ctrlShow true; }; if (_tempVal < 0.2) then { //TeeChange - _ctrlTemp call player_guiControlFlash; + _ctrl_Array=_ctrl_Array + [_ctrlTemp]; } else { _ctrlTemp ctrlShow true; }; if (r_player_injured) then { - _ctrlBleed call player_guiControlFlash; + _ctrl_Array=_ctrl_Array + [_ctrlBleed]; +}else { + _ctrlBleed ctrlShow false; }; +if((count _ctrl_Array) > 0) then +{ +_ctrl_Array call player_guiControlFlash; +}; } @@ -226,30 +243,48 @@ if (!canStand player) then { /* Flashing: */ +_ctrl_Array=[]; if (_combatVal == 0) then { - _ctrlCombat call player_guiControlFlash; + _ctrl_Array=_ctrl_Array + [_ctrlCombat]; +}else { + _ctrlCombat ctrlShow true; }; -if (_bloodVal < 0.2) then { - _ctrlBlood call player_guiControlFlash; + +if (_bloodVal < 0.4) then { + _ctrl_Array=_ctrl_Array + [_ctrlBlood]; +}else { + _ctrlBlood ctrlShow true; }; + if (_thirstVal < 0.2) then { - _ctrlThirst call player_guiControlFlash; + _ctrl_Array=_ctrl_Array + [_ctrlThirst]; +}else { + _ctrlThirst ctrlShow true; }; if (_foodVal < 0.2) then { - _ctrlFood call player_guiControlFlash; + _ctrl_Array=_ctrl_Array + [_ctrlFood]; +}else { + _ctrlFood ctrlShow true; }; if (_tempVal > 0.8) then { //TeeChange - _ctrlTemp call player_guiControlFlash; + _ctrl_Array=_ctrl_Array + [_ctrlTemp]; } else { _ctrlTemp ctrlShow true; }; if (r_player_injured) then { - _ctrlBleed call player_guiControlFlash; + _ctrl_Array=_ctrl_Array + [_ctrlBleed]; +}else { + _ctrlBleed ctrlShow false; +}; + +if((count _ctrl_Array) > 0) then +{ +_ctrl_Array call player_guiControlFlash; }; diff --git a/SQF/dayz_code/config.cpp b/SQF/dayz_code/config.cpp index becabf882..db6405fcd 100644 --- a/SQF/dayz_code/config.cpp +++ b/SQF/dayz_code/config.cpp @@ -97,5 +97,6 @@ class CfgAddons #include "Configs\CfgAmmo.hpp" #include "Configs\CfgLoot\CfgBuildingLoot.hpp" #include "Configs\CfgArma.hpp" +#include "Configs\CfgExtra\snappoints.hpp" #include "external\R3F_Realism\R3F_Weight\R3F_CfgWeight.h" \ No newline at end of file diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index b7950d631..9689e0433 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -35,14 +35,14 @@ if (!isDedicated) then { [["Hedgehog_DZ"], 1,"STR_EPOCH_ACTIONS_14"] call player_removeNearby; }; player_removeNet = { - [["DesertLargeCamoNet","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ"], 5,"str_epoch_player_8"] call player_removeNearby; + [["DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ"], 5,"str_epoch_player_8"] call player_removeNearby; }; player_login = { private ["_unit","_detail","_PUID"]; _unit = _this select 0; _detail = _this select 1; - _PUID = if (DayZ_UseSteamID) then {GetPlayerUID player} else {GetPlayerUIDOld player}; + _PUID = [player] call FNC_GetPlayerUID; if(_unit == _PUID) then { player setVariable["publish",_detail]; }; @@ -106,7 +106,13 @@ if (!isDedicated) then { player_sleep = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_sleep.sqf"; player_antiWall = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_antiWall.sqf"; player_deathBoard = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\list_playerDeathsAlt.sqf"; - + + //Snap building - disabled by default, not sure about your stance towards this mod yet, feel free to edit + if (DZE_snapBuilding) then { + player_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_build2.sqf"; + snap_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\snap_build.sqf"; + }; + player_plotPreview = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_showPlotRadius.sqf"; player_upgradeVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_upgradeVehicle.sqf"; @@ -279,15 +285,15 @@ if (!isDedicated) then { }; }; - player_guiControlFlash = { - private["_control"]; - _control = _this; - if (ctrlShown _control) then { - _control ctrlShow false; - } else { - _control ctrlShow true; - }; - }; + player_guiControlFlash = { + private["_control"]; + _control = _this; + if (ctrlShown (_control select 0)) then { + {_x ctrlShow false} foreach _control; + } else { + {_x ctrlShow true} foreach _control; + }; + }; gearDialog_create = { private ["_i","_dialog"]; @@ -528,6 +534,22 @@ if (!isDedicated) then { spawn_loot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot.sqf"; spawn_loot_small = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot_small.sqf"; // player_projectileNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf"; + FNC_GetPlayerUID = { + private ["_object","_version","_PID"]; + _object = _this select 0; + _version = productVersion select 3; + if (DayZ_UseSteamID) then { + _PID = GetPlayerUID _object; + } else { + if (_version >= 125548) then { + _PID = call (compile "GetPlayerUIDOld _object"); + } else { + _PID = GetPlayerUID _object; + diag_log format["Your game version, %1, is less than the required for the old UID system; using Steam ID system instead. Update to 1.63.125548 (or latest steam beta)", _version]; + }; + }; + _PID; + }; FNC_GetSetPos = { //DO NOT USE IF YOU NEED ANGLE COMPENSATION!!!! private "_pos"; _thingy = _this select 0; @@ -614,4 +636,4 @@ if (!isDedicated) then { eh_localCleanup = {}; }; -initialized = true; \ No newline at end of file +initialized = true; diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index d0b3d81e9..c87cc6bbc 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -257,6 +257,10 @@ dayz_resetSelfActions = { s_player_heli_lift = -1; s_player_heli_detach = -1; s_player_lockUnlock_crtl = -1; + s_player_toggleSnap = -1; + s_player_toggleSnapSelect = -1; + s_player_toggleSnapSelectPoint=[]; + snapActions = -1; }; call dayz_resetSelfActions; @@ -534,6 +538,12 @@ if(isNil "DZE_StaticConstructionCount") then { if (isNil "DZE_selfTransfuse_Values") then { DZE_selfTransfuse_Values = [12000, 15, 300]; }; +if (isNil "DZE_snapBuilding") then { + DZE_snapBuilding = false; +}; +if (isNil "helperDetach") then { + helperDetach = false; +}; // needed on server if(isNil "DZE_PlotPole") then { @@ -782,6 +792,8 @@ if(!isDedicated) then { DZE_5 = false; DZE_4 = false; DZE_6 = false; + + DZE_F = false; DZE_cancelBuilding = false; DZE_PZATTACK = false; diff --git a/SQF/dayz_code/medical/setup_functions_med.sqf b/SQF/dayz_code/medical/setup_functions_med.sqf index a15009e3b..5c48d17a0 100644 --- a/SQF/dayz_code/medical/setup_functions_med.sqf +++ b/SQF/dayz_code/medical/setup_functions_med.sqf @@ -260,7 +260,9 @@ fnc_usec_recoverUncons = { sleep 1; disableUserInput false; - [objNull,player,rSwitchMove,"AinjPpneMstpSnonWnonDnon"] call RE; - player switchMove "AinjPpneMstpSnonWnonDnon"; - player playMoveNow "AmovPpneMstpSnonWnonDnon_healed"; + if (vehicle player == player) then { + [objNull,player,rSwitchMove,"AinjPpneMstpSnonWnonDnon"] call RE; + player switchMove "AinjPpneMstpSnonWnonDnon"; + player playMoveNow "AmovPpneMstpSnonWnonDnon_healed"; + }; }; \ No newline at end of file diff --git a/SQF/dayz_code/system/antihack.sqf b/SQF/dayz_code/system/antihack.sqf index 8e279bc9c..53134561c 100644 --- a/SQF/dayz_code/system/antihack.sqf +++ b/SQF/dayz_code/system/antihack.sqf @@ -9,7 +9,7 @@ waitUntil {vehicle player == player}; [] spawn { private ["_playerName","_playerUID"]; _playerName = name player; - _playerUID = if (DayZ_UseSteamID) then {GetPlayerUID player;} else {GetPlayerUIDOld player;}; + _playerUID = [player] call FNC_GetPlayerUID; while {1 == 1} do { if (typeName player != "OBJECT") then { PVDZE_atp = format["WARNING typename error for player UID#%1", _playerUID]; @@ -24,7 +24,7 @@ waitUntil {vehicle player == player}; [] spawn { _playerName = name player; - _playerUID = if (DayZ_UseSteamID) then {GetPlayerUID player;} else {GetPlayerUIDOld player;}; + _playerUID = [player] call FNC_GetPlayerUID; while {true} do { sleep 5; }; @@ -93,7 +93,7 @@ while {1 == 1} do { if (_lastVehicle == vehicle player) then { if ((_speed > _topSpeed) && (alive player) && ((driver (vehicle player) == player) || (isNull (driver (vehicle player)))) && (_debug distance _lastpos > 3000) && !((vehicle player == player) && (_curheight < _lastheight) && ((_curheight - _terrainHeight) > 1))) then { (vehicle player) setposATL _lastpos; - _PUID = if (DayZ_UseSteamID) then {GetPlayerUID player;} else {GetPlayerUIDOld player;}; + _PUID = [player] call FNC_GetPlayerUID; PVDZE_atp = format["TELEPORT REVERT for player UID#%1 from %2 to %3, %4 meters, now at %5", _PUID, _lastpos, _curPos, round(_lastpos distance _curpos), getPosATL player]; publicVariableServer "PVDZE_atp"; } else { diff --git a/SQF/dayz_code/system/player_monitor.fsm b/SQF/dayz_code/system/player_monitor.fsm index a2f7961b3..922608740 100644 --- a/SQF/dayz_code/system/player_monitor.fsm +++ b/SQF/dayz_code/system/player_monitor.fsm @@ -408,7 +408,7 @@ class FSM "" \n "progressLoadingScreen 0.3;" \n "" \n - "_playerUID = if (DayZ_UseSteamID) then {GetPlayerUID player;} else {GetPlayerUIDOld player;};"/*%FSM*/; + "_playerUID = [player] call FNC_GetPlayerUID;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { diff --git a/SQF/dayz_epoch_b/CfgServerTrader/Category/BanditHelicopterArmed.hpp b/SQF/dayz_epoch_b/CfgServerTrader/Category/BanditHelicopterArmed.hpp index 47e8dc8db..ee35fc513 100644 --- a/SQF/dayz_epoch_b/CfgServerTrader/Category/BanditHelicopterArmed.hpp +++ b/SQF/dayz_epoch_b/CfgServerTrader/Category/BanditHelicopterArmed.hpp @@ -29,4 +29,9 @@ class Category_512 { buy[] = {4,"ItemBriefcase100oz"}; sell[] = {1,"ItemBriefcase100oz"}; }; + class CH53_DZE { + type = "trade_any_vehicle"; + buy[] = {3,"ItemBriefcase100oz"}; + sell[] = {2,"ItemBriefcase100oz"}; + }; }; diff --git a/SQF/dayz_epoch_b/CfgServerTrader/Category/HeroHelicopterArmed.hpp b/SQF/dayz_epoch_b/CfgServerTrader/Category/HeroHelicopterArmed.hpp index e458b3212..4803c5715 100644 --- a/SQF/dayz_epoch_b/CfgServerTrader/Category/HeroHelicopterArmed.hpp +++ b/SQF/dayz_epoch_b/CfgServerTrader/Category/HeroHelicopterArmed.hpp @@ -29,4 +29,9 @@ class Category_493 { buy[] = {2,"ItemBriefcase100oz"}; sell[] = {1,"ItemBriefcase100oz"}; }; + class CH53_DZE { + type = "trade_any_vehicle"; + buy[] = {2,"ItemBriefcase100oz"}; + sell[] = {1,"ItemBriefcase100oz"}; + }; }; diff --git a/SQF/dayz_server/compile/fnc_plyrHit.sqf b/SQF/dayz_server/compile/fnc_plyrHit.sqf index 35843aa71..49c44beb5 100644 --- a/SQF/dayz_server/compile/fnc_plyrHit.sqf +++ b/SQF/dayz_server/compile/fnc_plyrHit.sqf @@ -9,13 +9,17 @@ if ((owner _victim) == (owner _attacker)) exitWith { }; _weapon = weaponState _attacker; -if (_weapon select 0 == "Throw") then -{ - _weapon = _weapon select 3; -} -else -{ - _weapon = _weapon select 0; +if (!isNil "_weapon") then { + if (count _weapon != 0) then { + if (_weapon select 0 == "Throw") then + { + _weapon = _weapon select 3; + } + else + { + _weapon = _weapon select 0; + }; + }; }; _vehicle = typeOf (vehicle _attacker); diff --git a/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf b/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf index 46382d3d3..0f72ad72d 100644 --- a/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf +++ b/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf @@ -4,7 +4,7 @@ _playerName = _this select 1; _playerObj = nil; _playerPos = []; { - _PUID = if (DayZ_UseSteamID) then {GetPlayerUID _x;} else {GetPlayerUIDOld _x;}; + _PUID = [_x] call FNC_GetPlayerUID; if (_PUID == _playerUID) exitWith {_playerObj = _x;}; } count playableUnits; @@ -18,7 +18,7 @@ if (isNil "_playerObj") then { if (isNil "_playerObj") exitWith { diag_log format["%1: nil player object, _this:%2", __FILE__, _this]; }; -_PUID = if (DayZ_UseSteamID) then {GetPlayerUID _playerObj;} else {GetPlayerUIDOld _playerObj;}; +_PUID = [_playerObj] call FNC_GetPlayerUID; diag_log format["get: %1 (%2), sent: %3 (%4)",typeName _PUID, _PUID, typeName _playerUID, _playerUID]; if (!isNull _playerObj) then { diff --git a/SQF/dayz_server/compile/server_playerLogin.sqf b/SQF/dayz_server/compile/server_playerLogin.sqf index 9e067d30f..6295a2230 100644 --- a/SQF/dayz_server/compile/server_playerLogin.sqf +++ b/SQF/dayz_server/compile/server_playerLogin.sqf @@ -28,7 +28,7 @@ _isInfected = 0; _model = ""; if (_playerID == "") then { - _playerID = if (DayZ_UseSteamID) then {GetPlayerUID _playerObj;} else {GetPlayerUIDOld _playerObj;}; + _playerID = [_playerObj] call FNC_GetPlayerUID; }; if ((_playerID == "") || (isNil "_playerID")) exitWith { diff --git a/SQF/dayz_server/compile/server_playerSetup.sqf b/SQF/dayz_server/compile/server_playerSetup.sqf index c749e8665..d582e6484 100644 --- a/SQF/dayz_server/compile/server_playerSetup.sqf +++ b/SQF/dayz_server/compile/server_playerSetup.sqf @@ -4,7 +4,7 @@ private ["_characterID","_playerObj","_playerID","_dummy","_worldspace","_state" _characterID = _this select 0; _playerObj = _this select 1; -_playerID = if (DayZ_UseSteamID) then {GetPlayerUID _playerObj;} else {GetPlayerUIDOld _playerObj;}; +_playerID = [_playerObj] call FNC_GetPlayerUID; if (isNull _playerObj) exitWith { diag_log ("SETUP INIT FAILED: Exiting, player object null: " + str(_playerObj)); @@ -15,7 +15,7 @@ if (isNull _playerObj) exitWith { _playerObj addMPEventHandler ["MPHit", {_this spawn fnc_plyrHit;}]; if (_playerID == "") then { - _playerID = if (DayZ_UseSteamID) then {GetPlayerUID _playerObj;} else {GetPlayerUIDOld _playerObj;}; + _playerID = [_playerObj] call FNC_GetPlayerUID; }; if (_playerID == "") exitWith { @@ -23,7 +23,7 @@ if (_playerID == "") exitWith { }; private["_dummy"]; -_dummy = if (DayZ_UseSteamID) then {GetPlayerUID _playerObj;} else {GetPlayerUIDOld _playerObj;}; +_dummy = [_playerObj] call FNC_GetPlayerUID; if ( _playerID != _dummy ) then { diag_log format["DEBUG: _playerID miscompare with UID! _playerID:%1",_playerID]; _playerID = _dummy; diff --git a/SQF/dayz_server/compile/server_playerSync.sqf b/SQF/dayz_server/compile/server_playerSync.sqf index f8592d02a..fdfb51fed 100644 --- a/SQF/dayz_server/compile/server_playerSync.sqf +++ b/SQF/dayz_server/compile/server_playerSync.sqf @@ -203,10 +203,9 @@ if (_characterID != "0") then { }; // Force gear updates for nearby vehicles/tents - _pos = _this select 0; { [_x, "gear"] call server_updateObject; - } count nearestObjects [_pos, dayz_updateObjects, 10]; + } count (nearestObjects [_charPos, dayz_updateObjects, 10]); //[_charPos] call server_updateNearbyObjects; //Reset timer diff --git a/SQF/dayz_server/compile/server_swapObject.sqf b/SQF/dayz_server/compile/server_swapObject.sqf index 761bd5dcf..5e8524e16 100644 --- a/SQF/dayz_server/compile/server_swapObject.sqf +++ b/SQF/dayz_server/compile/server_swapObject.sqf @@ -6,7 +6,7 @@ _worldspace = _this select 2; _class = _this select 3; _obj = _this select 4; _activatingplayer = _this select 5; -_activatingplayerUID = if (DayZ_UseSteamID) then {GetPlayerUID _activatingplayer;} else {GetPlayerUIDOld _activatingplayer;}; +_activatingplayerUID = [_activatingplayer] call FNC_GetPlayerUID; _proceed = false; _objectID = "0"; diff --git a/SQF/dayz_server/compile/server_tradeObject.sqf b/SQF/dayz_server/compile/server_tradeObject.sqf index 9631b44bf..b0e760391 100644 --- a/SQF/dayz_server/compile/server_tradeObject.sqf +++ b/SQF/dayz_server/compile/server_tradeObject.sqf @@ -10,7 +10,7 @@ _qty = _this select 6; _clientID = owner _player; _price = format ["%2x %1",_currency,_qty]; _name = if (alive _player) then { name _player; } else { "Dead Player"; }; -_PUID = if (DayZ_UseSteamID) then {GetPlayerUID _player;} else {GetPlayerUIDOld _player;}; +_PUID = [_player] call FNC_GetPlayerUID; if (_buyorsell == 0) then { //Buy diag_log format["EPOCH SERVERTRADE: Player: %1 (%2) bought a %3 in/at %4 for %5", _name, _PUID, _classname, _traderCity, _price]; diff --git a/SQF/dayz_server/compile/server_updateObject.sqf b/SQF/dayz_server/compile/server_updateObject.sqf index 785119078..9ee8310e0 100644 --- a/SQF/dayz_server/compile/server_updateObject.sqf +++ b/SQF/dayz_server/compile/server_updateObject.sqf @@ -126,7 +126,7 @@ _object_killed = { _objID = _object getVariable['ObjectID','0']; _objUID = _object getVariable['ObjectUID','0']; _worldSpace = getPosATL _object; - _PUID = if (DayZ_UseSteamID) then {GetPlayerUID _killer;} else {GetPlayerUIDOld _killer;}; + _PUID = [_killer] call FNC_GetPlayerUID; if (_PUID != "") then { _name = if (alive _killer) then { name _killer; } else { format["OBJECT %1", _killer]; }; diag_log format["Vehicle killed: Vehicle %1 (TYPE: %2), CharacterID: %3, ObjectID: %4, ObjectUID: %5, Position: %6, Killer: %7 (UID: %8)", _object, (typeOf _object), _charID, _objID, _objUID, _worldSpace, _name, _PUID]; diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf index 43412f893..382ee8909 100644 --- a/SQF/dayz_server/init/server_functions.sqf +++ b/SQF/dayz_server/init/server_functions.sqf @@ -815,7 +815,7 @@ server_checkHackers = { }; server_spawnCleanFire = { - private ["_delQtyFP","_qty","_delQtyNull","_missionFires"]; + private ["_delQtyFP","_qty","_missionFires"]; _missionFires = allMissionObjects "Land_Fire_DZ"; _delQtyFP = 0; { @@ -828,7 +828,7 @@ server_spawnCleanFire = { } count _missionFires; if (_delQtyFP > 0) then { _qty = count _missionFires; - diag_log (format["CLEANUP: Deleted %1 fireplaces out of %2",_delQtyNull,_qty]); + diag_log (format["CLEANUP: Deleted %1 fireplaces out of %2",_delQtyFP,_qty]); }; }; server_spawnCleanLoot = { @@ -914,7 +914,7 @@ server_logUnlockLockEvent = { [_obj, "gear"] call server_updateObject; _statusText = "LOCKED"; }; - _PUID = if (DayZ_UseSteamID) then {GetPlayerUID _killer;} else {GetPlayerUIDOld _killer;}; + _PUID = [_killer] call FNC_GetPlayerUID; diag_log format["SAFE %5: ID:%1 UID:%2 BY %3(%4)", _objectID, _objectUID, (name _player), _PUID, _statusText]; }; }; diff --git a/SQF/redryder/config.cpp b/SQF/redryder/config.cpp new file mode 100644 index 000000000..a98226002 --- /dev/null +++ b/SQF/redryder/config.cpp @@ -0,0 +1,90 @@ +// RedRyder BB Gun by WillRobinson. + +#define TEast 0 +#define TWest 1 +#define TGuerrila 2 +#define TCivilian 3 +#define TSideUnknown 4 +#define TEnemy 5 +#define TFriendly 6 +#define TLogic 7 + +#define true 1 +#define false 0 + +class CfgPatches +{ + class RedRyder + { + units[] = {}; + weapons[] = {RedRyder}; + requiredVersion = 1.00000; + }; +}; +class CfgModels +{ + class Default{}; + class Weapon: Default{}; + class RedRyder : Weapon{}; + +}; + +class CfgAmmo +{ + class BulletBase; + class 177_BB: BulletBase { + model= \addons\redryder\models\BB_Round.p3d; //will need to be changed + simulation=shotShell; + soundHit[]={,0,1}; + hit=3.7;indirectHit=0;indirectHitRange=0; + visibleFire=10; + audibleFire=10; + visibleFireTime=3; + deflecting=5; + airFriction = -0.001064; + fuseDistance = 0; + CraterEffects = ""; + explosionEffects = ""; + muzzleEffect = "BIS_Effects_Rifle"; + }; +}; + +class CfgMagazines +{ + class CA_Magazine; + class 350Rnd_BB_Magazine: CA_Magazine { + scope = 2; + model= \addons\redryder\models\bb_magazine.p3d; //will need to be changed + picture="\addons\redryder\textures\bb_magazine_picture.paa"; //will need to be changed + displayName = 350 Count 177 Cal. BBs; + count=350; + ammo = 177_BB; + initSpeed = 175; + sound[]={"\addons\redryder\M9SD_S1", db8, 1,60}; //will need to be changed + reloadMagazineSound[]={"Ca\sounds\Weapons\rifles\M1014-reload",db-40,1,20}; + descriptionShort = 350 Zink Coated .177, 4.5mm BBs; +}; +}; +class CfgWeapons +{ + class Default {}; + class Rifle: Default {}; + class RedRyder: Rifle { + scope = 2; + model="\addons\redryder\models\RedRyder.p3d"; //will need to be changed + displayName = "RedRyder BB Gun"; + displayNameMagazine="BB"; + magazines[]={"350Rnd_BB_Magazine"}; + recoil = "recoil_single_pistol_2outof3"; + recoilProne = "recoil_single_pistol_prone_2outof3"; + reloadTime=0.45; + sound[]={"\addons\redryder\RedRyder\M9SD_S1", db8, 1,60}; //will need to be changed + dispersion=0.00045; + minRange=0;minRangeProbab=0.30; + midRange=39;midRangeProbab=0.7; + maxRange=75;maxRangeProbab=0.05; + picture="\addons\redryder\textures\redryder_picture.paa"; //will need to be changed + handAnim[]={"OFP2_ManSkeleton","\Ca\weapons\data\Anim\M24.rtm"}; + + }; +}; diff --git a/SQF/redryder/model.cfg b/SQF/redryder/model.cfg new file mode 100644 index 000000000..bd366644d --- /dev/null +++ b/SQF/redryder/model.cfg @@ -0,0 +1,45 @@ +class CfgSkeletons +{ + class Default; + class redryder: Default + { + skeletonInherit=""; + skeletonBones[]= + { + "lever","" + }; + }; +} + +class CfgModels +{ + class Default; + class redryder: Default + { + skeletonName = "redryder"; + class Animations + + { + class lever_up + { + type="rotation"; + source="reload"; + selection="lever"; + axis="lever_axis"; + memory=1; + minValue=0.000000; + maxValue=0.100000; + angle0=0.000000; + angle1=1.570796; + }; + class lever_down:lever_up + { + minValue=0.950000; + maxValue=1.000000; + angle0=0.000000; + angle1=-1.570796; + }; + + }; + }; +}; diff --git a/SQF/redryder/models/BB_Round.p3d b/SQF/redryder/models/BB_Round.p3d new file mode 100644 index 000000000..e3f0f7470 Binary files /dev/null and b/SQF/redryder/models/BB_Round.p3d differ diff --git a/SQF/redryder/models/RedRyder.p3d b/SQF/redryder/models/RedRyder.p3d new file mode 100644 index 000000000..69d913538 Binary files /dev/null and b/SQF/redryder/models/RedRyder.p3d differ diff --git a/SQF/redryder/models/bb_magazine.p3d b/SQF/redryder/models/bb_magazine.p3d new file mode 100644 index 000000000..19291ba5d Binary files /dev/null and b/SQF/redryder/models/bb_magazine.p3d differ diff --git a/SQF/redryder/textures/bb_NOHQ.paa b/SQF/redryder/textures/bb_NOHQ.paa new file mode 100644 index 000000000..ed32e845a Binary files /dev/null and b/SQF/redryder/textures/bb_NOHQ.paa differ diff --git a/SQF/redryder/textures/bb_SMDI.paa b/SQF/redryder/textures/bb_SMDI.paa new file mode 100644 index 000000000..a51774b2f Binary files /dev/null and b/SQF/redryder/textures/bb_SMDI.paa differ diff --git a/SQF/redryder/textures/bb_co.paa b/SQF/redryder/textures/bb_co.paa new file mode 100644 index 000000000..4f0e96aa4 Binary files /dev/null and b/SQF/redryder/textures/bb_co.paa differ diff --git a/SQF/redryder/textures/bb_rv.rvmat b/SQF/redryder/textures/bb_rv.rvmat new file mode 100644 index 000000000..0550761be --- /dev/null +++ b/SQF/redryder/textures/bb_rv.rvmat @@ -0,0 +1,32 @@ +ambient[]={0.85000002,0.85000002,0.85000002,0.85000002}; +diffuse[]={0.85000002,0.85000002,0.85000002,0.85000002}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={1,1,1,1}; +specularPower=30; +PixelShaderID="NormalMapSpecularMap"; +VertexShaderID="NormalMap"; +class Stage1 +{ + texture="addons\redryder\textures\bb_NOHQ.paa"; //will need to be changed + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="addons\redryder\textures\bb_SMDI.paa"; //will need to be changed + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; diff --git a/SQF/redryder/textures/bb_uvmap.paa b/SQF/redryder/textures/bb_uvmap.paa new file mode 100644 index 000000000..0c7bd7560 Binary files /dev/null and b/SQF/redryder/textures/bb_uvmap.paa differ diff --git a/SQF/redryder/textures/redmap1sd2_SMDI.paa b/SQF/redryder/textures/redmap1sd2_SMDI.paa new file mode 100644 index 000000000..f814d544c Binary files /dev/null and b/SQF/redryder/textures/redmap1sd2_SMDI.paa differ diff --git a/SQF/redryder/textures/redmap3.paa b/SQF/redryder/textures/redmap3.paa new file mode 100644 index 000000000..adb0ef445 Binary files /dev/null and b/SQF/redryder/textures/redmap3.paa differ diff --git a/SQF/redryder/textures/redmap_NOHQ.paa b/SQF/redryder/textures/redmap_NOHQ.paa new file mode 100644 index 000000000..1ecace189 Binary files /dev/null and b/SQF/redryder/textures/redmap_NOHQ.paa differ diff --git a/SQF/redryder/textures/redryder.rvmat b/SQF/redryder/textures/redryder.rvmat new file mode 100644 index 000000000..668582423 --- /dev/null +++ b/SQF/redryder/textures/redryder.rvmat @@ -0,0 +1,32 @@ +ambient[]={0.85000002,0.85000002,0.85000002,0.85000002}; +diffuse[]={0.85000002,0.85000002,0.85000002,0.85000002}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0.80392158,0.80392158,0.80392158,1}; +specularPower=150; +PixelShaderID="NormalMapSpecularMap"; +VertexShaderID="NormalMap"; +class Stage1 +{ + texture="addons\redryder\textures\redmap_NOHQ.paa"; //will need to be changed + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="addons\redryder\textures\redmap1sd2_SMDI.paa"; //will need to be changed + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; diff --git a/Server Files/SQL/1.0.5_Updates.sql b/Server Files/SQL/1.0.5_Updates.sql index a5e7d08f5..b77136718 100644 --- a/Server Files/SQL/1.0.5_Updates.sql +++ b/Server Files/SQL/1.0.5_Updates.sql @@ -3,10 +3,13 @@ INSERT IGNORE INTO `Traders_DATA` VALUES (NULL, '["ItemFuelBarrelEmpty",1]', 250 INSERT IGNORE INTO `Traders_DATA` VALUES (NULL, '["ItemFuelBarrelEmpty",1]', 250, '[1,"ItemGoldBar",1]', '[5,"ItemSilverBar10oz",1]', 0, 636, 'trade_items'); INSERT IGNORE INTO `Traders_DATA` VALUES (NULL, '["ItemFuelBarrelEmpty",1]', 250, '[1,"ItemGoldBar",1]', '[5,"ItemSilverBar10oz",1]', 0, 555, 'trade_items'); -INSERT IGNORE INTO `Traders_DATA` VALUES (NULL, '["CH53_DZE",1]', 6, '[2,"ItemBriefcase100oz",1]', '[1,"ItemBriefcase100oz",1]', 0, 493, 'trade_any_vehicle'); -INSERT IGNORE INTO `Traders_DATA` VALUES (NULL, '["CH53_DZE",1]', 10, '[3,"ItemBriefcase100oz",1]', '[2,"ItemBriefcase100oz",1]', 0, 512, 'trade_any_vehicle'); -INSERT IGNORE INTO `Traders_DATA` VALUES (NULL, '["BAF_Merlin_DZE",1]', 10, '[2,"ItemBriefcase100oz",1]', '[1,"ItemBriefcase100oz",1]', 0, 519, 'trade_any_vehicle'); +INSERT IGNORE INTO `Traders_DATA` VALUES (NULL, '["CH53_DZE",2]', 6, '[2,"ItemBriefcase100oz",1]', '[1,"ItemBriefcase100oz",1]', 0, 493, 'trade_any_vehicle'); +INSERT IGNORE INTO `Traders_DATA` VALUES (NULL, '["CH53_DZE",2]', 10, '[3,"ItemBriefcase100oz",1]', '[2,"ItemBriefcase100oz",1]', 0, 512, 'trade_any_vehicle'); +INSERT IGNORE INTO `Traders_DATA` VALUES (NULL, '["BAF_Merlin_DZE",2]', 10, '[2,"ItemBriefcase100oz",1]', '[1,"ItemBriefcase100oz",1]', 0, 519, 'trade_any_vehicle'); +-- Remove incorrect lines +DELETE FROM `Traders_DATA` WHERE item = '["CH53_DZE",1]'; +DELETE FROM `Traders_DATA` WHERE item = '["BAF_Merlin_DZE",1]'; UPDATE `Traders_DATA` SET `item` = '["C130J_US_EP1_DZ",2]' WHERE `item` = '["C130J_US_EP1",2]'; @@ -20,3 +23,9 @@ UPDATE `Traders_DATA` SET `qty` = '10' WHERE `afile` = 'trade_backpacks'; UPDATE `Traders_DATA` SET `qty` = '2' WHERE `afile` = 'trade_any_vehicle'; UPDATE `Traders_DATA` SET `qty` = '2' WHERE `afile` = 'trade_any_boat'; UPDATE `Traders_DATA` SET `qty` = '10' WHERE `afile` = 'trade_any_bicycle'; + +-- +-- Prevent hitpoints from overflooding and causing errors +-- + +ALTER TABLE `Object_DATA` CHANGE `Hitpoints` `Hitpoints` VARCHAR(1024) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '[]'; diff --git a/Server Files/Tools/Backup_DB_sample.bat b/Server Files/Tools/Backup_DB_sample.bat new file mode 100644 index 000000000..a25ff2252 --- /dev/null +++ b/Server Files/Tools/Backup_DB_sample.bat @@ -0,0 +1,25 @@ +@REM *** PARAMETERS/VARIABLES *** +SET BackupDir="[Where you want to save the backups]" +SET mysqldir="C:\Program Files\MySQL\MySQL Server 5.6\bin" +SET mysqlschema=[Your DB schema name] +SET mysqlpassword=[your DB password] +SET mysqluser=[your DB user login] +SET housekeepafter=5 + +For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b) +For /f "tokens=1-2 delims=/:" %%a in ("%TIME%") do (set mytime=%%a.%%b) + +set hour=%time:~0,2% +if "%time:~0,1%"==" " set hour=0%time:~1,1% +set datestamp=%date:~10,4%-%date:~4,2%-%date:~7,2%_%hour%%time:~3,2% + +@REM *** EXECUTION *** +@REM Change to mysqldir +c: +cd %mysqldir% + +@REM dump/backup ALL database, this is all in one line +mysqldump -u %mysqluser% -p%mysqlpassword% --databases %mysqlschema% >%BackupDir%\%mysqlschema%_backup.%datestamp%.sql + +@REM - Housekeeping +forfiles -p %BackupDir% -s -m *.sql -d -%housekeepafter% -c "cmd /c del @path" diff --git a/Server Files/Tools/Backup_DB_sample.txt b/Server Files/Tools/Backup_DB_sample.txt new file mode 100644 index 000000000..2aeaec576 --- /dev/null +++ b/Server Files/Tools/Backup_DB_sample.txt @@ -0,0 +1,22 @@ +RimBlocks basic MySQL DB backup. + +This batch (.bat) file will connect to your MySQL server and create a dump of the sql code required to recreate the DB you have selected. mysqldump.exe has other options you can supply so you could talior the basic script fairly easily to fit your individual need. + +How to use Backup_DB.bat + +Input your DB connection details and desired backup save location. All details that need changing are in []. Make the changes without the []. + +e.g. +SET mysqlschema=[Your DB schema name] +may change to +SET mysqlschema=EpochDB + +SET BackupDir="[Where you want to save the backups]" +May change to +SET BackupDir="c:\DB-Backups" + +Housekeeping will clear any .sql files that are over housekeepafter number of days old. + +You may need to confirm the MySQL path for the mysqldump exe as it may depend on your provider. + +Add "pause" (without "") at the end of the file to require an input for debugging. This allows you to check the test backup is ok and troubleshoot any issues. Remove it when automating or the .bat file will never close. Automation can be done via Windows task scheduler. Create a basic task and then edit the tasks parameters after creating if you want to backup more than once a day. The option is only available after the task is created. \ No newline at end of file diff --git a/Tools/ServerList/steam_list.php b/Tools/ServerList/steam_list.php new file mode 100644 index 000000000..2b370dd77 --- /dev/null +++ b/Tools/ServerList/steam_list.php @@ -0,0 +1,140 @@ +
+	
+
\ No newline at end of file