diff --git a/Changelogs/0.3.5.0.txt b/Changelogs/0.3.5.0.txt index 82341eaf..072e9833 100644 --- a/Changelogs/0.3.5.0.txt +++ b/Changelogs/0.3.5.0.txt @@ -5,7 +5,8 @@ [Added] Persistent wood and metal spike traps. [Added] New custom 3x wide hesco type barrier. [Added] New custom tank trap. -[Added] Updated version of the Fishing Rod. +[Added] Updated version of the Fishing Rod. Reel was to small. +[Changed] Refine ghost preview base building snap checks. [Changed] Players now start with a Quartz radio by default. [Changed] Overhaul of secure storage system to make it faster. [Fixed] Was unable to use cursorTarget underwater, fixed using new custom made function. diff --git a/Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo b/Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo index eb243bd0..efb12f42 100644 Binary files a/Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo and b/Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo differ diff --git a/Server_Install_Pack/@epochhive/addons/a3_epoch_server_settings.pbo b/Server_Install_Pack/@epochhive/addons/a3_epoch_server_settings.pbo index 12a3cd96..7761ce66 100644 Binary files a/Server_Install_Pack/@epochhive/addons/a3_epoch_server_settings.pbo and b/Server_Install_Pack/@epochhive/addons/a3_epoch_server_settings.pbo differ diff --git a/Server_Install_Pack/README.txt b/Server_Install_Pack/README.txt index fa892cd1..ae003a36 100644 --- a/Server_Install_Pack/README.txt +++ b/Server_Install_Pack/README.txt @@ -1,12 +1,18 @@ -Arma 3: Epoch Mod - EpochMod.com +Arma 3 Epoch Mod +-------------------------- Developers -Aaron Clark - [VB]AWOL - Game Design, Code -Kenneth Bente - Axle - Public Relations -Paul Tomany - Sequisha - Models, Textures -Darren Harrison - Kiory - Models, Textures -Damian Clark - [VB]GREEN - Graphics -Niklas Wagner - Skaronator - Code - http://skaronator.com/ -Andrew Gregory - Axeman - AI Code -Florian Kinder - Fank - DLL Code -Denis Erygin - devd - Linux DLL Support +-------------------------- +* Aaron Clark - [VB]AWOL - Game Design, Code +* Kenneth Bente - Axle - Public Relations, Models +* Paul Tomany - Sequisha - Models, Textures +* Dan - OrangeSherbet - Tester, Videos, Wiki Editor +* Darren Harrison - Kiory - Models, Textures +* Damian Clark - [VB]GREEN - Graphics +* Niklas Wagner - Skaronator - Code +* Andrew Gregory - Axeman - AI Code +* Florian Kinder - Fank - DLL Code +* Denis Erygin - devd - Linux DLL Support +* Richie - Map Support +* Paden Sturtevant - SteamPunkGears - Models +* Raimonds Virtoss - Raymix - UI and Code diff --git a/Sources/epoch_code/Data/UI/buttons/build_maintain.paa b/Sources/epoch_code/Data/UI/buttons/build_maintain.paa index 75d0bf8c..c474d066 100644 Binary files a/Sources/epoch_code/Data/UI/buttons/build_maintain.paa and b/Sources/epoch_code/Data/UI/buttons/build_maintain.paa differ diff --git a/Sources/epoch_code/Data/UI/buttons/build_move.paa b/Sources/epoch_code/Data/UI/buttons/build_move.paa index 89882070..b765c04a 100644 Binary files a/Sources/epoch_code/Data/UI/buttons/build_move.paa and b/Sources/epoch_code/Data/UI/buttons/build_move.paa differ diff --git a/Sources/epoch_code/Data/UI/buttons/build_pack.paa b/Sources/epoch_code/Data/UI/buttons/build_pack.paa new file mode 100644 index 00000000..756a616a Binary files /dev/null and b/Sources/epoch_code/Data/UI/buttons/build_pack.paa differ diff --git a/Sources/epoch_code/Data/UI/buttons/build_remove.paa b/Sources/epoch_code/Data/UI/buttons/build_remove.paa index 79ef7cad..f1786bf1 100644 Binary files a/Sources/epoch_code/Data/UI/buttons/build_remove.paa and b/Sources/epoch_code/Data/UI/buttons/build_remove.paa differ diff --git a/Sources/epoch_code/Data/UI/buttons/build_upgrade.paa b/Sources/epoch_code/Data/UI/buttons/build_upgrade.paa index 062b9038..55b3fbdd 100644 Binary files a/Sources/epoch_code/Data/UI/buttons/build_upgrade.paa and b/Sources/epoch_code/Data/UI/buttons/build_upgrade.paa differ diff --git a/Sources/epoch_code/Data/UI/buttons/krypto.paa b/Sources/epoch_code/Data/UI/buttons/krypto.paa index 3ca3cf89..c48138cc 100644 Binary files a/Sources/epoch_code/Data/UI/buttons/krypto.paa and b/Sources/epoch_code/Data/UI/buttons/krypto.paa differ diff --git a/Sources/epoch_code/Data/UI/buttons/pad_can_lock.paa b/Sources/epoch_code/Data/UI/buttons/pad_can_lock.paa index 21f5245e..b6be18f4 100644 Binary files a/Sources/epoch_code/Data/UI/buttons/pad_can_lock.paa and b/Sources/epoch_code/Data/UI/buttons/pad_can_lock.paa differ diff --git a/Sources/epoch_code/Data/UI/buttons/pad_can_unlock.paa b/Sources/epoch_code/Data/UI/buttons/pad_can_unlock.paa index b7e67409..efd15c50 100644 Binary files a/Sources/epoch_code/Data/UI/buttons/pad_can_unlock.paa and b/Sources/epoch_code/Data/UI/buttons/pad_can_unlock.paa differ diff --git a/Sources/epoch_code/Data/UI/buttons/pad_cannot_lock.paa b/Sources/epoch_code/Data/UI/buttons/pad_cannot_lock.paa index 75e46a5e..bf715d9c 100644 Binary files a/Sources/epoch_code/Data/UI/buttons/pad_cannot_lock.paa and b/Sources/epoch_code/Data/UI/buttons/pad_cannot_lock.paa differ diff --git a/Sources/epoch_code/Data/UI/buttons/pad_cannot_unlock.paa b/Sources/epoch_code/Data/UI/buttons/pad_cannot_unlock.paa index 5608cb52..c6e57b08 100644 Binary files a/Sources/epoch_code/Data/UI/buttons/pad_cannot_unlock.paa and b/Sources/epoch_code/Data/UI/buttons/pad_cannot_unlock.paa differ diff --git a/Sources/epoch_code/Data/UI/buttons/player_inspect.paa b/Sources/epoch_code/Data/UI/buttons/player_inspect.paa index ebcc8468..92d9f2e9 100644 Binary files a/Sources/epoch_code/Data/UI/buttons/player_inspect.paa and b/Sources/epoch_code/Data/UI/buttons/player_inspect.paa differ diff --git a/Sources/epoch_code/Data/UI/buttons/repair.paa b/Sources/epoch_code/Data/UI/buttons/repair.paa new file mode 100644 index 00000000..1ff51302 Binary files /dev/null and b/Sources/epoch_code/Data/UI/buttons/repair.paa differ diff --git a/Sources/epoch_code/Data/UI/buttons/talk_blue.paa b/Sources/epoch_code/Data/UI/buttons/talk_blue.paa index 038d2162..da1976fd 100644 Binary files a/Sources/epoch_code/Data/UI/buttons/talk_blue.paa and b/Sources/epoch_code/Data/UI/buttons/talk_blue.paa differ diff --git a/Sources/epoch_code/Data/UI/buttons/vehicle_refuel.paa b/Sources/epoch_code/Data/UI/buttons/vehicle_refuel.paa new file mode 100644 index 00000000..7aa2c314 Binary files /dev/null and b/Sources/epoch_code/Data/UI/buttons/vehicle_refuel.paa differ diff --git a/Sources/epoch_code/Data/UI/buttons/vehicle_siphon.paa b/Sources/epoch_code/Data/UI/buttons/vehicle_siphon.paa new file mode 100644 index 00000000..08a8a722 Binary files /dev/null and b/Sources/epoch_code/Data/UI/buttons/vehicle_siphon.paa differ diff --git a/Sources/epoch_code/Data/UI/snap_ca.paa b/Sources/epoch_code/Data/UI/snap_ca.paa new file mode 100644 index 00000000..c2cade9c Binary files /dev/null and b/Sources/epoch_code/Data/UI/snap_ca.paa differ diff --git a/Sources/epoch_code/compile/building/EPOCH_countdown.sqf b/Sources/epoch_code/compile/building/EPOCH_countdown.sqf index ea763734..6d5a8aa0 100644 --- a/Sources/epoch_code/compile/building/EPOCH_countdown.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_countdown.sqf @@ -39,16 +39,18 @@ if (!isNull _this) then { EPOCH_arr_countdown = EPOCH_arr_countdown - [_this]; EPOCH_drawIcon3d = !(EPOCH_arr_countdown isEqualTo []); - - if (typeOf _this == "Fireplace_SIM_EPOCH") then { + _objClass = typeOf _this; + // Spawn temporary static item insead of saving. + if (getNumber(configfile >> "CfgVehicles" >> _objClass >> "isTemporary") == 1) then { _worldspace = [getposATL _this, vectordir _this, vectorup _this]; deleteVehicle _this; - + _class = getText(configfile >> "CfgVehicles" >> _objClass >> "staticClass"); _newObj = createVehicle["Fireplace_EPOCH", (_worldspace select 0), [], 0, "CAN_COLLIDE"]; _newObj setVectorDirAndUp[_worldspace select 1, _worldspace select 2]; _newObj setposATL(_worldspace select 0); + // proceed to send save to server } else { if (_saveCheck) then { EPOCH_SAVEBUILD = [_this, player, Epoch_personalToken]; diff --git a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf index 15b822d5..174ba058 100644 --- a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf @@ -22,6 +22,7 @@ _class = getText(configfile >> "cfgVehicles" >> _objType >> "GhostPreview"); _maxHeight = getNumber(configfile >> "cfgVehicles" >> _objType >> "maxHeight"); _simulClass = getText(configFile >> "CfgVehicles" >> _objType >> "simulClass"); _snapChecks = getArray(configFile >> "CfgSnapChecks" >> _objType >> "nails"); +diag_log format["DEBUG: _snapChecks %1",_snapChecks]; _maxSnapDistance = 1; _lastCheckTime = diag_tickTime; _stabilityCheck = false; @@ -137,6 +138,7 @@ if (_class != "") then { _baselineSnapPos = _nearestObject modelToWorldVisual [0,0,0]; if (EPOCH_buildMode == 1) then { + { if (_x in _allowedSnapPoints) then { _pOffset = _nearestObject selectionPosition _x; @@ -239,6 +241,16 @@ if (_class != "") then { _currentTarget setVectorDirAndUp[_dir2, (vectorUp _nearestObject)]; _currentTarget setposATL _snapPosition; + + { + _pos1_snap = _currentTarget modelToWorldVisual (_x select 0); + _pos2_snap = _currentTarget modelToWorldVisual (_x select 1); + _ins = lineIntersectsSurfaces [AGLToASL _pos1_snap, AGLToASL _pos2_snap,player,_currentTarget,true,1,"VIEW","FIRE"]; + if (count _ins > 0) then { + [ASLToATL (_ins select 0 select 0),1,"x\addons\a3_epoch_code\Data\UI\snap_ca.paa", "",20] call epoch_gui3dWorldPos; + }; + } forEach _snapChecks; + }; } else { @@ -292,11 +304,11 @@ if (_class != "") then { _numberOfContacts = 0; { - _pos1 = _currentTarget modelToWorld (_x select 0); - _pos2 = _currentTarget modelToWorld (_x select 1); - _ins = lineIntersectsSurfaces [AGLToASL _pos1, AGLToASL _pos2,player,_currentTarget,true,1,"VIEW","FIRE"]; + _pos1_snap = _currentTarget modelToWorldVisual (_x select 0); + _pos2_snap = _currentTarget modelToWorldVisual (_x select 1); + _ins = lineIntersectsSurfaces [AGLToASL _pos1_snap, AGLToASL _pos2_snap,player,_currentTarget,true,1,"VIEW","FIRE"]; if (count _ins > 0) then { - _numberOfContacts = _numberOfContacts + 1; + _numberOfContacts = _numberOfContacts + 1; }; } forEach _snapChecks; diff --git a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp index a7e7a04e..230575d5 100644 --- a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp +++ b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp @@ -51,7 +51,7 @@ class tra_talk { condition = "dyna_isTrader"; action = "dyna_cursorTarget call EPOCH_startInteractNPC;"; - icon = "x\addons\a3_epoch_code\Data\UI\buttons\talk_green.paa"; + icon = "x\addons\a3_epoch_code\Data\UI\buttons\talk_blue.paa"; tooltip = "Talk"; }; class tra_shop @@ -105,13 +105,13 @@ class pack_lockbox { condition = "(dyna_cursorTargetType in ['LockBox_EPOCH','LockBoxProxy_EPOCH']) && (dyna_cursorTarget getVariable ['EPOCH_Locked',false])"; action = "EPOCH_packStorage_PVS = [dyna_cursorTarget,player,Epoch_personalToken]; publicVariableServer 'EPOCH_packStorage_PVS';"; - icon = "#(rgb,8,8,3)color(1,0,1,0.5)"; + icon = "x\addons\a3_epoch_code\Data\UI\buttons\build_pack.paa"; tooltip = "Pack Lockbox"; }; class pack_safe { condition = "(dyna_cursorTargetType in ['Safe_EPOCH','SafeProxy_EPOCH']) && (dyna_cursorTarget getVariable ['EPOCH_Locked',false])"; action = "EPOCH_packStorage_PVS = [dyna_cursorTarget,player,Epoch_personalToken]; publicVariableServer 'EPOCH_packStorage_PVS';"; - icon = "#(rgb,8,8,3)color(1,0,1,0.5)"; + icon = "x\addons\a3_epoch_code\Data\UI\buttons\build_pack.paa"; tooltip = "Pack Safe"; -}; \ No newline at end of file +}; diff --git a/Sources/epoch_config/Configs/CfgAmmo.hpp b/Sources/epoch_config/Configs/CfgAmmo.hpp index f8b65a44..770d10f3 100644 --- a/Sources/epoch_config/Configs/CfgAmmo.hpp +++ b/Sources/epoch_config/Configs/CfgAmmo.hpp @@ -55,13 +55,13 @@ class CfgAmmo { class DirectionalBombBase; - class Spike_TRAP_EPOCH: DirectionalBombBase + class Spike_TRAP_AMMO_EPOCH: DirectionalBombBase { hit = 10; indirectHit = 5; indirectHitRange = 3; - model = "\x\addons\a3_epoch_assets\models\sticks.p3d"; - mineModelDisabled = "\x\addons\a3_epoch_assets\models\sticks.p3d"; + model = "\x\addons\a3_epoch_assets_3\CfgVehicles\swing_box.p3d"; + mineModelDisabled = "\x\addons\a3_epoch_assets_3\CfgVehicles\swing_box.p3d"; defaultMagazine = "APERSTripMine_Wire_Mag"; icon = "iconExplosiveAP"; @@ -86,13 +86,13 @@ class CfgAmmo }; }; - class Metal_TRAP_EPOCH: DirectionalBombBase + class Metal_TRAP_AMMO_EPOCH: DirectionalBombBase { hit = 15; indirectHit = 8; indirectHitRange = 4; - model = "\x\addons\a3_epoch_assets\models\sticks.p3d"; - mineModelDisabled = "\x\addons\a3_epoch_assets\models\sticks.p3d"; + model = "\x\addons\a3_epoch_assets_3\CfgVehicles\swing_box.p3d"; + mineModelDisabled = "\x\addons\a3_epoch_assets_3\CfgVehicles\swing_box.p3d"; defaultMagazine = "APERSTripMine_Wire_Mag"; icon = "iconExplosiveAP"; diff --git a/Sources/epoch_config/Configs/CfgSnapChecks.hpp b/Sources/epoch_config/Configs/CfgSnapChecks.hpp index 5db34b15..c9c14fe9 100644 --- a/Sources/epoch_config/Configs/CfgSnapChecks.hpp +++ b/Sources/epoch_config/Configs/CfgSnapChecks.hpp @@ -1,48 +1,50 @@ // Snap Checks - EpochMod.com -class Hesco3_EPOCH { - nails[] = { - {{0,0,-0.6},{0,0,-0.75}}, - {{1.6,0,-0.0307557},{1.8625,0,-0.0307557}}, - {{-1.6,0,-0.0307557},{-1.8625,0,-0.0307557}} +class CfgSnapChecks { + class Hesco3_EPOCH { + nails[] = { + {{0,0,-0.6},{0,0,-0.75}}, + {{1.6,0,-0.0307557},{1.8625,0,-0.0307557}}, + {{-1.6,0,-0.0307557},{-1.8625,0,-0.0307557}} + }; }; -}; -class WoodLargeWall_EPOCH { - nails[] = { - {{0,0,0.120775},{0,0,-0.190775}}, - {{2.46932,0,1.5},{2.76932,0,1.5}}, - {{-2.46932,0,1.5},{-2.76932,0,1.5}} + class WoodLargeWall_EPOCH { + nails[] = { + {{0,0,0.120775},{0,0,-0.190775}}, + {{2.46932,0,1.5},{2.76932,0,1.5}}, + {{-2.46932,0,1.5},{-2.76932,0,1.5}} + }; }; -}; -class WoodWall1_EPOCH : WoodLargeWall_EPOCH {}; -class WoodWall2_EPOCH : WoodLargeWall_EPOCH {}; -class WoodWall3_EPOCH : WoodLargeWall_EPOCH {}; -class WoodWall4_EPOCH : WoodLargeWall_EPOCH {}; -class WoodLargeWallCor_EPOCH : WoodLargeWall_EPOCH {}; -class WoodLargeWallDoorway_EPOCH : WoodLargeWall_EPOCH {}; -class WoodLargeWallDoor_EPOCH : WoodLargeWall_EPOCH {}; -class WoodLargeWallDoorL_EPOCH : WoodLargeWall_EPOCH {}; -class CinderWallGarage_EPOCH : WoodLargeWall_EPOCH {}; -class CinderWall_EPOCH : WoodLargeWall_EPOCH {}; -class CinderWallHalf_EPOCH : WoodLargeWall_EPOCH {}; -class WoodFloor_Epoch { - nails[] = { - {{2.5555,0,0.15},{2.8555,0,0.15}}, - {{0,-2.5555,0.15},{0,2.8555,0.15}}, - {{-2.5555,0,0.15},{-2.8555,0,0.15}}, - {{0,-2.5555,0.15},{0,-2.8555,0.15}}, + class WoodWall1_EPOCH : WoodLargeWall_EPOCH {}; + class WoodWall2_EPOCH : WoodLargeWall_EPOCH {}; + class WoodWall3_EPOCH : WoodLargeWall_EPOCH {}; + class WoodWall4_EPOCH : WoodLargeWall_EPOCH {}; + class WoodLargeWallCor_EPOCH : WoodLargeWall_EPOCH {}; + class WoodLargeWallDoorway_EPOCH : WoodLargeWall_EPOCH {}; + class WoodLargeWallDoor_EPOCH : WoodLargeWall_EPOCH {}; + class WoodLargeWallDoorL_EPOCH : WoodLargeWall_EPOCH {}; + class CinderWallGarage_EPOCH : WoodLargeWall_EPOCH {}; + class CinderWall_EPOCH : WoodLargeWall_EPOCH {}; + class CinderWallHalf_EPOCH : WoodLargeWall_EPOCH {}; + class WoodFloor_Epoch { + nails[] = { + {{2.5555,0,0.15},{2.8555,0,0.15}}, + {{0,-2.5555,0.15},{0,2.8555,0.15}}, + {{-2.5555,0,0.15},{-2.8555,0,0.15}}, + {{0,-2.5555,0.15},{0,-2.8555,0.15}}, - {{2.5555,0,0.15},{2.5555,0,-0.15}}, - {{-2.5555,0,0.15},{-2.5555,0,-0.15}}, - {{0,-2.5555,0.15},{0,-2.5555,-0.15}}, - {{0,2.5555,0.15},{0,2.5555,-0.15}} + {{2.5555,0,0.15},{2.5555,0,-0.15}}, + {{-2.5555,0,0.15},{-2.5555,0,-0.15}}, + {{0,-2.5555,0.15},{0,-2.5555,-0.15}}, + {{0,2.5555,0.15},{0,2.5555,-0.15}} + }; }; -}; -class MetalFloor_EPOCH : WoodFloor_Epoch {}; -class WoodStairs_EPOCH { - nails[] = { - {{0,0,0.05},{0,0,-0.20}} + class MetalFloor_EPOCH : WoodFloor_Epoch {}; + class WoodStairs_EPOCH { + nails[] = { + {{0,0,0.05},{0,0,-0.20}} + }; }; + class WoodStairs2_EPOCH : WoodStairs_EPOCH {}; + class WoodTower_EPOCH : WoodStairs_EPOCH {}; + class WoodRamp_EPOCH : WoodStairs_EPOCH {}; }; -class WoodStairs2_EPOCH : WoodStairs_EPOCH {}; -class WoodTower_EPOCH : WoodStairs_EPOCH {}; -class WoodRamp_EPOCH : WoodStairs_EPOCH {}; diff --git a/Sources/epoch_config/Configs/CfgVehicles.hpp b/Sources/epoch_config/Configs/CfgVehicles.hpp index bd717e18..35471499 100644 --- a/Sources/epoch_config/Configs/CfgVehicles.hpp +++ b/Sources/epoch_config/Configs/CfgVehicles.hpp @@ -2512,6 +2512,7 @@ class CfgVehicles simulClass = "Fireplace_SIM_EPOCH"; staticClass = "Fireplace_EPOCH"; GhostPreview = "Fireplace_EPOCH"; + isTemporary = 1; }; class Jack_SIM_EPOCH : Constructions_modular_F { @@ -3851,6 +3852,37 @@ class CfgVehicles bypassJammer = 1; }; + class TRAP_EPOCH : Constructions_static_F {}; + class Spike_TRAP_EPOCH: Constructions_static_F + { + scope = 2; + model = "\x\addons\a3_epoch_assets\models\sticks.p3d"; + displayName = "Spike Trap (SIM)"; + simulClass = "Spike_TRAP_SIM_EPOCH"; + staticClass = "Spike_TRAP_EPOCH"; + GhostPreview = "Spike_TRAP_EPOCH"; + ammoClass = "Spike_TRAP_AMMO_EPOCH"; + energyCost = 0.2; + limitNearby = 2; + bypassJammer = 1; + armor = 0.1 + }; + + class Metal_TRAP_EPOCH: Constructions_static_F + { + scope = 2; + model = "\x\addons\a3_epoch_assets\models\sticks.p3d"; + displayName = "Metal Trap (SIM)"; + simulClass = "Metal_TRAP_SIM_EPOCH"; + staticClass = "Metal_TRAP_EPOCH"; + GhostPreview = "Metal_TRAP_EPOCH"; + ammoClass = "Metal_TRAP_AMMO_EPOCH"; + energyCost = 0.4; + limitNearby = 2; + bypassJammer = 1; + armor = 0.1 + }; + class Hesco3_EPOCH: Const_All_Walls_F { scope = 2; diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf index eb8557c9..0da78b0c 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_loadBuildings.sqf @@ -49,10 +49,6 @@ for "_i" from 0 to _this do { _textureSlot = _arr select 4; }; - - - - // experiment with damage factor based on time only for now. _damage = ((1 - (_ttl / _maxTTL)) min 1) max 0; @@ -65,11 +61,22 @@ for "_i" from 0 to _this do { // remove old safes on && !(_class isKindOf 'Constructions_lockedstatic_F') if (isClass (configFile >> "CfgVehicles" >> _class) && (_damage < 1) && !(_class isKindOf 'Constructions_lockedstatic_F')) then { - _baseObj = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"]; + _baseObj = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"]; _baseObj setVectorDirAndUp _worldspace; _baseObj setposATL _location; + // spawn additional object for trap + _ammoClass = (configFile >> "CfgVehicles" >> _class >> "ammoClass"); + if(isText _ammoClass) then { + _ammoClass = getText _ammoClass; + _ammoObj = createVehicle [_ammoClass, _location, [], 0, "CAN_COLLIDE"]; + _ammoObj setVectorDirAndUp _worldspace; + _ammoObj setposATL _location; + _baseObj setVariable ["EPOCH_TRAP_OBJ",_ammoObj]; + }; + + // set persistent Animations if (_arrCount >= 6) then{ _anims = _arr param[5, [], [[]]]; { @@ -77,8 +84,8 @@ for "_i" from 0 to _this do { } foreach(getArray(configFile >> "CfgVehicles" >> _class >> "persistAnimations")); }; - // TODO make config based - if (_class == "PlotPole_EPOCH") then { + // Handle Jammers and create marker if EPOCH_SHOW_JAMMERS set true. + if (_class isKindOf "PlotPole_EPOCH") then { if (EPOCH_SHOW_JAMMERS) then { _marker = createMarker[str(_location), _location]; _marker setMarkerShape "ICON"; diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_removeBUILD.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_removeBUILD.sqf index 7bb663fb..214f54bb 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_removeBUILD.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_removeBUILD.sqf @@ -43,7 +43,7 @@ if (_vehSlot != -1 || _storageSlot != "ABORT" || _isTemporary == 1) then{ // if normal storage device dump items on ground. if (_building isKindOf "Buildable_Storage") then { - + // may not be needed but should prevent in DB. _wepsItemsCargo = weaponsItemsCargo _building; if (isNil "_wepsItemsCargo") then{ @@ -54,7 +54,7 @@ if (_vehSlot != -1 || _storageSlot != "ABORT" || _isTemporary == 1) then{ _magsAmmoCargo = []; }; - // dump items on ground + // dump items on ground _inventory = [ _wepsItemsCargo, _magsAmmoCargo, @@ -103,7 +103,7 @@ if (_vehSlot != -1 || _storageSlot != "ABORT" || _isTemporary == 1) then{ }; } forEach _x; - // add all attachments to vehicle + // add all attachments to vehicle // TODO replace with adding attachments directly to gun (Arma feature dependant) { _gwh addItemCargoGlobal[_x, 1]; @@ -148,6 +148,12 @@ if (_vehSlot != -1 || _storageSlot != "ABORT" || _isTemporary == 1) then{ } else { + // Remove trap object + _ammoObj = _building getVariable ["EPOCH_TRAP_OBJ",objNull]; + if !(isNull _ammoObj) then { + deleteVehicle _ammoObj; + }; + [_building, _player] call EPOCH_server_save_killedBuilding; deleteVehicle _building; }; @@ -158,7 +164,7 @@ if (_vehSlot != -1 || _storageSlot != "ABORT" || _isTemporary == 1) then{ _gwh addMagazineCargoGlobal[_x select 0, _x select 1]; } forEach _removeParts; }; - + }; }; diff --git a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_simulSwap.sqf b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_simulSwap.sqf index 88f5883e..5f8cfee0 100644 --- a/Sources/epoch_server/compile/epoch_bases/EPOCH_server_simulSwap.sqf +++ b/Sources/epoch_server/compile/epoch_bases/EPOCH_server_simulSwap.sqf @@ -43,6 +43,16 @@ if (_objSlot != -1) then { }; }; + // spawn additional object for trap + _ammoClass = (configFile >> "CfgVehicles" >> _class >> "ammoClass"); + if (isText _ammoClass) then { + _ammoClass = getText _ammoClass; + _ammoObj = createVehicle [_ammoClass, _worldspace select 0, [], 0, "CAN_COLLIDE"]; + _ammoObj setVectorDirAndUp [(_worldspace select 1),(_worldspace select 2)]; + _ammoObj setposATL (_worldspace select 0); + _newObj setVariable ["EPOCH_TRAP_OBJ",_ammoObj]; + }; + _newObj setVectorDirAndUp [(_worldspace select 1),(_worldspace select 2)]; _newObj setposATL (_worldspace select 0); _newObj setDamage _damage; @@ -51,4 +61,4 @@ if (_objSlot != -1) then { }; }; }; -_return \ No newline at end of file +_return diff --git a/Sources/epoch_server/compile/epoch_bases/fn_saveBuilding.sqf b/Sources/epoch_server/compile/epoch_bases/fn_saveBuilding.sqf index e1e05668..b3168a1d 100644 --- a/Sources/epoch_server/compile/epoch_bases/fn_saveBuilding.sqf +++ b/Sources/epoch_server/compile/epoch_bases/fn_saveBuilding.sqf @@ -8,18 +8,17 @@ private ["_class","_worldspace","_objHiveKey","_animPhases","_VAL","_return","_o _return = false; if !(isNull _this) then { _objSlot = _this getVariable["BUILD_SLOT", -1]; - diag_log format["DEBUG: Building Save function BUILD_SLOT %1",_objSlot]; if (_objSlot != -1) then{ _this setDamage 0; _class = typeOf _this; _worldspace = [(getposATL _this call EPOCH_precisionPos), vectordir _this, vectorup _this]; - _objHiveKey = format["%1:%2", (call EPOCH_fn_InstanceID), _objSlot]; - _animPhases = []; - { - _animPhases pushBack (_this animationPhase _x) - } foreach (getArray(configFile >> "CfgVehicles" >> _class >> "persistAnimations")); - _VAL = [_class, _worldspace, _this getVariable["EPOCH_secureStorage", "-1"], _this getVariable["BUILD_OWNER", "-1"], _this getVariable["TEXTURE_SLOT", 0], _animPhases]; - ["Building", _objHiveKey, EPOCH_expiresBuilding, _VAL] call EPOCH_fnc_server_hiveSETEX; + _objHiveKey = format["%1:%2", (call EPOCH_fn_InstanceID), _objSlot]; + _animPhases = []; + { + _animPhases pushBack (_this animationPhase _x) + } foreach (getArray(configFile >> "CfgVehicles" >> _class >> "persistAnimations")); + _VAL = [_class, _worldspace, _this getVariable["EPOCH_secureStorage", "-1"], _this getVariable["BUILD_OWNER", "-1"], _this getVariable["TEXTURE_SLOT", 0], _animPhases]; + ["Building", _objHiveKey, EPOCH_expiresBuilding, _VAL] call EPOCH_fnc_server_hiveSETEX; _return = true; }; }; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_save_killedBuilding.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_save_killedBuilding.sqf index aa872889..50ff34c1 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_save_killedBuilding.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_save_killedBuilding.sqf @@ -7,6 +7,13 @@ if (!isNull _building) then { _vehSlot = _building getVariable["BUILD_SLOT", -1]; if (_vehSlot != -1) then { + + // Set off trap object + _ammoObj = _building getVariable ["EPOCH_TRAP_OBJ",objNull]; + if !(isNull _ammoObj) then { + _ammoObj setDamage 1; + }; + _vehHiveKey = format ["%1:%2", (call EPOCH_fn_InstanceID), _vehSlot]; ["Building", _vehHiveKey, []] call EPOCH_fnc_server_hiveSET; EPOCH_BuildingSlots set [_vehSlot, 0];