From 68d4c9bbd80ed2e6528244569c79676b87295bd1 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:54:45 +0300 Subject: init --- Common/Init/Init_Airfield.sqf | 9 + Common/Init/Init_Boundaries.sqf | 38 +++ Common/Init/Init_Camp.sqf | 85 ++++++ Common/Init/Init_Common.sqf | 285 ++++++++++++++++++++ Common/Init/Init_CommonConstants.sqf | 492 +++++++++++++++++++++++++++++++++++ Common/Init/Init_Location.sqf | 87 +++++++ Common/Init/Init_Neighbors.sqf | 232 +++++++++++++++++ Common/Init/Init_PublicVariables.sqf | 62 +++++ Common/Init/Init_TownMode.sqf | 53 ++++ Common/Init/Init_Towns.sqf | 25 ++ 10 files changed, 1368 insertions(+) create mode 100644 Common/Init/Init_Airfield.sqf create mode 100644 Common/Init/Init_Boundaries.sqf create mode 100644 Common/Init/Init_Camp.sqf create mode 100644 Common/Init/Init_Common.sqf create mode 100644 Common/Init/Init_CommonConstants.sqf create mode 100644 Common/Init/Init_Location.sqf create mode 100644 Common/Init/Init_Neighbors.sqf create mode 100644 Common/Init/Init_PublicVariables.sqf create mode 100644 Common/Init/Init_TownMode.sqf create mode 100644 Common/Init/Init_Towns.sqf (limited to 'Common/Init') diff --git a/Common/Init/Init_Airfield.sqf b/Common/Init/Init_Airfield.sqf new file mode 100644 index 0000000..14f56e8 --- /dev/null +++ b/Common/Init/Init_Airfield.sqf @@ -0,0 +1,9 @@ +Private ["_location"]; +_location = _this select 0; + +waitUntil {commonInitComplete}; + +if (isNil "Airfields") then {Airfields = []}; +Airfields = Airfields + [_location]; + +diag_log Format["[WFBE (INIT)][frameno:%4 | ticktime:%5] Init_Airfield: Airfield initialization (position: %1 - item: %2 (%3)) - [Done]",getPos _location,_location,typeOf _location,diag_frameno,diag_tickTime]; \ No newline at end of file diff --git a/Common/Init/Init_Boundaries.sqf b/Common/Init/Init_Boundaries.sqf new file mode 100644 index 0000000..9f55ba7 --- /dev/null +++ b/Common/Init/Init_Boundaries.sqf @@ -0,0 +1,38 @@ +Private ['_boundariesXY']; +_boundariesXY = -1; + +switch (toLower(worldName)) do { + case 'chernarus': {_boundariesXY = 15360}; + case 'eden': {_boundariesXY = 12800}; + case 'fallujah': {_boundariesXY = 10240}; + case 'isladuala': {_boundariesXY = 10240}; + case 'panthera2': {_boundariesXY = 10240}; + case 'queshkibrul': {_boundariesXY = 5120}; + case 'sara': {_boundariesXY = 20480}; + case 'saraLite': {_boundariesXY = 10240}; + case 'takistan': {_boundariesXY = 12800}; + case 'utes': {_boundariesXY = 5120}; + case 'yapal': {_boundariesXY = 5120}; + case 'zargabad': {_boundariesXY = 8192}; +}; + +if (paramBoundaries) then { + if (_boundariesXY == -1) then { + paramBoundaries = false; + if (local player) then { + BoundariesIsOnMap = nil; + BoundariesHandleOnMap = nil; + }; + diag_log Format["[WFBE (INFORMATION)][frameno:%2 | ticktime:%3] Init_Boundaries: There is no proper boundaries set for the island '%1'",worldName,diag_frameno,diag_tickTime]; + } else { + ['WFBE_BOUNDARIESXY',_boundariesXY,true] Call SetNamespace; + diag_log Format["[WFBE (INIT)][frameno:%3 | ticktime:%4] Init_Boundaries: Boundaries found for the island '%1' %2",worldName,_boundariesXY,diag_frameno,diag_tickTime]; + }; +} else { + if (_boundariesXY == -1) then { + diag_log Format["[WFBE (INFORMATION)][frameno:%2 | ticktime:%3] Init_Boundaries: There is no proper boundaries set for the island '%1'",worldName,diag_frameno,diag_tickTime]; + } else { + ['WFBE_BOUNDARIESXY',_boundariesXY,true] Call SetNamespace; + diag_log Format["[WFBE (INIT)][frameno:%3 | ticktime:%4] Init_Boundaries: Boundaries found for the island '%1' %2 [Boundaries parameter is disabled]",worldName,_boundariesXY,diag_frameno,diag_tickTime]; + }; +}; \ No newline at end of file diff --git a/Common/Init/Init_Camp.sqf b/Common/Init/Init_Camp.sqf new file mode 100644 index 0000000..9a31709 --- /dev/null +++ b/Common/Init/Init_Camp.sqf @@ -0,0 +1,85 @@ +Private ['_camp','_camps','_flagPole','_index','_marker','_supplyValue','_town']; + +_camp = _this select 0; +_town = _this select 1; + +waitUntil {townModeSet}; +if (isNull _town && !isNull _camp) exitWith { + if (isServer) then { + if (isNil 'EastMHQ' || isNil 'WestMHQ') exitWith {}; + (getPos _camp) Spawn { + Private ["_defenses"]; + waitUntil {commonInitComplete}; + _defenses = _this nearEntities[('WFBE_RESISTANCEDEFENSENAMES' Call GetNamespace),250]; + {deleteVehicle _x} forEach _defenses; + }; + deleteVehicle _camp; + }; +}; +if ((str _town) in TownTemplate) exitWith { + if (isServer) then { + if (isNil 'EastMHQ' || isNil 'WestMHQ') exitWith {}; + diag_log Format ["[WFBE (INIT)][frameno:%3 | ticktime:%4] Init_Camp: Removing camp %1 (%2) since the town is removed in the towns templates.",_camp,str _town,diag_frameno,diag_tickTime]; + (getPos _camp) Spawn { + Private ["_defenses"]; + waitUntil {commonInitComplete}; + _defenses = _this nearEntities[('WFBE_RESISTANCEDEFENSENAMES' Call GetNamespace),250]; + {deleteVehicle _x} forEach _defenses; + }; + deleteVehicle _camp; + }; +}; + +waitUntil{initJIP}; +if !(paramKeepCamps) exitWith{ + diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Camp: Removing camp %3 due to a parameter (Town: %4) - [Done]",diag_frameno,diag_tickTime,_camp,_town]; + (getPos _camp) Spawn { + Private ["_defenses"]; + waitUntil {commonInitComplete}; + _defenses = _this nearEntities[('WFBE_RESISTANCEDEFENSENAMES' Call GetNamespace),250]; + {deleteVehicle _x} forEach _defenses; + }; + deleteVehicle _camp; +}; + +if (isNull _camp) exitWith {diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Camp: Camp removed (Town is null) - [Done]",diag_frameno,diag_tickTime];}; + +_camps = _town getVariable "camps"; +if (isNil "_camps") then {_town setVariable ["camps",[]]}; +_camps = _town getVariable "camps"; +_camps = _camps + [_camp]; +_town setVariable ["camps",_camps]; +_camp setVariable ['town',_town]; + +diag_log Format["[WFBE (INIT)][frameno:%3 | ticktime:%4] Init_Camp: Camp '%1' of town '%2' initialization - [Done]",str _camp,str _town,diag_frameno,diag_tickTime]; + +waitUntil {commonInitComplete}; + +if (local player) then { + waitUntil {clientInitComplete}; + + _index = _camps find _camp; + _marker = Format["%1Camp%2",str _town,_index]; + createMarkerLocal [_marker,getPos _camp]; + _marker setMarkerTypeLocal "Strongpoint"; + _marker setMarkerSizeLocal [0.5,0.5]; + _marker setMarkerColorLocal ("Resistance" Call GetMarkerColoration); +}; + +if (isServer) then { + if (isNil 'EastMHQ' || isNil 'WestMHQ') exitWith {}; + + sleep 10; + + _supplyValue = 0; + if (isNil {_camp getVariable "sideID"}) then {_camp setVariable ["sideID",RESISTANCEID,true]}; + /* OA Camps are made of kryptonite */ + if (WF_A2_Arrowhead || WF_A2_CombinedOps) then {_camp addEventHandler ['handleDamage',{false}]}; + if (isNil {_camp getVariable "supplyValue"}) then { + waitUntil {_supplyValue = _town getVariable "supplyValue"; !isNil "_supplyValue"}; + _camp setVariable ["supplyValue",_supplyValue,true]; + _flagPole = WFFLAG createVehicle getPos _camp; + waitUntil {serverInitComplete && townInit}; + [_camp,_town,_flagPole] ExecFSM 'Server\FSM\updatecamp.fsm'; + }; +}; \ No newline at end of file diff --git a/Common/Init/Init_Common.sqf b/Common/Init/Init_Common.sqf new file mode 100644 index 0000000..abb5787 --- /dev/null +++ b/Common/Init/Init_Common.sqf @@ -0,0 +1,285 @@ +private ['_count']; +diag_log Format["[WFBE (INIT)][frameno:%2 | ticktime:%3] Init_Common: Init Start at %1",time,diag_frameno,diag_tickTime]; + +Private ['_count']; + +if (paramBalancing) then {BalanceInit = Compile preprocessFile "Common\Functions\Common_BalanceInit.sqf"}; +if !(WF_A2_Vanilla) then { + BackpackHasSpace = Compile preprocessFile "Common\Functions\Common_BackpackHasSpace.sqf"; + EquipBackpack = Compile preprocessFile "Common\Functions\Common_EquipBackpack.sqf"; +}; +BuildingInRange = Compile preprocessFile "Common\Functions\Common_BuildingInRange.sqf"; +ChangeSideSupply = Compile preprocessFile "Common\Functions\Common_ChangeSideSupply.sqf"; +ChangeTeamFunds = Compile preprocessFile "Common\Functions\Common_ChangeTeamFunds.sqf"; +CreateMan = Compile preprocessFile "Common\Functions\Common_CreateUnit.sqf"; +CreateVehi = Compile preprocessFile "Common\Functions\Common_CreateVehicle.sqf"; +EquipArtillery = Compile preprocessFile "Common\Functions\Common_EquipArtillery.sqf"; +EquipLoadout = Compile preprocessFile "Common\Functions\Common_EquipLoadout.sqf"; +FireArtillery = Compile preprocessFile "Common\Functions\Common_FireArtillery.sqf"; +GetAIDigit = Compile preprocessFile "Common\Functions\Common_GetAIDigit.sqf"; +GetClientID = Compile preprocessFile "Common\Functions\Common_GetClientID.sqf"; +GetClientTeam = Compile preprocessFile "Common\Functions\Common_GetClientTeam.sqf"; +GetClosestLocation = Compile preprocessFile "Common\Functions\Common_GetClosestLocation.sqf"; +GetClosestLocationBySide = Compile preprocessFile "Common\Functions\Common_GetClosestLocationBySide.sqf"; +GetCommanderFromVotes = Compile preprocessFile "Common\Functions\Common_GetCommanderFromVotes.sqf"; +GetCommanderTeam = Compile preprocessFile "Common\Functions\Common_GetCommanderTeam.sqf"; +GetCommanderVotes = Compile preprocessFile "Common\Functions\Common_GetCommanderVotes.sqf"; +GetConfigInfo = Compile preprocessFile "Common\Functions\Common_GetConfigInfo.sqf"; +GetFactories = Compile preprocessFile "Common\Functions\Common_GetFactories.sqf"; +GetFriendlyCamps = Compile preprocessFile "Common\Functions\Common_GetFriendlyCamps.sqf"; +GetGroupFromConfig = Compile preprocessFile "Common\Functions\Common_GetGroupFromConfig.sqf"; +GetHostilesInArea = Compile preprocessFile "Common\Functions\Common_GetHostilesInArea.sqf"; +GetLiveUnits = Compile preprocessFile "Common\Functions\Common_GetLiveUnits.sqf"; +GetNamespace = Compile preprocessFile "Common\Functions\Common_GetNamespace.sqf"; +GetPositionFrom = Compile preprocessFile "Common\Functions\Common_GetPositionFrom.sqf"; +GetRandomPosition = Compile preprocessFile "Common\Functions\Common_GetRandomPosition.sqf"; +GetRespawnCamps = Compile preprocessFile "Common\Functions\Common_GetRespawnCamps.sqf"; +GetSafePlace = Compile preprocessFile "Common\Functions\Common_GetSafePlace.sqf"; +GetSideFromID = Compile preprocessFile "Common\Functions\Common_GetSideFromID.sqf"; +GetSideHQ = Compile preprocessFile "Common\Functions\Common_GetSideHQ.sqf"; +GetSideHQDeployed = Compile preprocessFile "Common\Functions\Common_GetSideHQDeployed.sqf"; +GetSideID = Compile preprocessFile "Common\Functions\Common_GetSideID.sqf"; +GetSideStructures = Compile preprocessFile "Common\Functions\Common_GetSideStructures.sqf"; +GetSideSupply = Compile preprocessFile "Common\Functions\Common_GetSideSupply.sqf"; +GetSideUpgrades = Compile preprocessFile "Common\Functions\Common_GetSideUpgrades.sqf"; +GetSideTowns = Compile preprocessFile "Common\Functions\Common_GetSideTowns.sqf"; +GetSleepFPS = Compile preprocessFile "Common\Functions\Common_GetSleepFPS.sqf"; +GetTeamArtillery = Compile preprocessFile "Common\Functions\Common_GetTeamArtillery.sqf"; +GetTeamAutonomous = Compile preprocessFile "Common\Functions\Common_GetTeamAutonomous.sqf"; +GetTeamFunds = Compile preprocessFile "Common\Functions\Common_GetTeamFunds.sqf"; +GetTeamMoveMode = Compile preprocessFile "Common\Functions\Common_GetTeamMoveMode.sqf"; +GetTeamMovePos = Compile preprocessFile "Common\Functions\Common_GetTeamMovePos.sqf"; +GetTeamRespawn = Compile preprocessFile "Common\Functions\Common_GetTeamRespawn.sqf"; +GetTeamType = Compile preprocessFile "Common\Functions\Common_GetTeamType.sqf"; +GetTeamVehicles = Compile preprocessFile "Common\Functions\Common_GetTeamVehicles.sqf"; +GetTotalCamps = Compile preprocessFile "Common\Functions\Common_GetTotalCamps.sqf"; +GetTotalCampsOnSide = Compile preprocessFile "Common\Functions\Common_GetTotalCampsOnSide.sqf"; +GetTotalSupplyValue = Compile preprocessFile "Common\Functions\Common_GetTotalSupplyValue.sqf"; +GetTownsHeld = Compile preprocessFile "Common\Functions\Common_GetTownsHeld.sqf"; +GetTownsIncome = Compile preprocessFile "Common\Functions\Common_GetTownsIncome.sqf"; +GetUnitsBelowHeight = Compile preprocessFile "Common\Functions\Common_GetUnitsBelowHeight.sqf"; +GetUnitVehicle = Compile preprocessFile "Common\Functions\Common_GetUnitVehicle.sqf"; +HandleArtillery = Compile preprocessFile "Common\Functions\Common_HandleArtillery.sqf"; +HandleIncomingMissile = Compile preprocessFile "Common\Functions\Common_HandleIncomingMissile.sqf"; +IsArtillery = Compile preprocessFile "Common\Functions\Common_IsArtillery.sqf"; +MarkerUpdate = Compile preprocessFile "Common\Common_MarkerUpdate.sqf"; +PlaceNear = Compile preprocessFile "Common\Functions\Common_PlaceNear.sqf"; +PlaceSafe = Compile preprocessFile "Common\Functions\Common_PlaceSafe.sqf"; +if !(WF_A2_Vanilla) then { + GetTurretsMags = Compile preprocessFile "Common\Functions\Common_GetTurretsMags.sqf"; + GetVehicleMags = Compile preprocessFile "Common\Functions\Common_GetVehicleMags.sqf"; + RearmVehicle = Compile preprocessFile "Common\Functions\Common_RearmVehicleOA.sqf"; + SetTurretsMags = Compile preprocessFile "Common\Functions\Common_SetTurretsMags.sqf"; +} else { + RearmVehicle = Compile preprocessFile "Common\Functions\Common_RearmVehicle.sqf"; +}; +RevealArea = Compile preprocessFile "Common\Functions\Common_RevealArea.sqf"; +SetCommanderVotes = Compile preprocessFile "Common\Functions\Common_SetCommanderVotes.sqf"; +SetNamespace = Compile preprocessFile "Common\Functions\Common_SetNamespace.sqf"; +SetTeamAutonomous = Compile preprocessFile "Common\Functions\Common_SetTeamAutonomous.sqf"; +SetTeamRespawn = Compile preprocessFile "Common\Functions\Common_SetTeamRespawn.sqf"; +SetTeamMoveMode = Compile preprocessFile "Common\Functions\Common_SetTeamMoveMode.sqf"; +SetTeamMovePos = Compile preprocessFile "Common\Functions\Common_SetTeamMovePos.sqf"; +SetTeamType = Compile preprocessFile "Common\Functions\Common_SetTeamType.sqf"; +SpawnTurrets = Compile preprocessFile "Common\Functions\Common_SpawnTurrets.sqf"; +SortByDistance = Compile preprocessFile "Common\Functions\Common_SortByDistance.sqf"; +UnitKilled = Compile preprocessFile "Common\Functions\Common_UnitKilled.sqf"; +UpdateStatistics = Compile preprocessFile "Common\Functions\Common_UpdateStatistics.sqf"; +UseStationaryDefense = Compile preprocessFile "Common\Functions\Common_UseStationaryDefense.sqf"; +if (paramICBM) then { + NukeDammage = Compile preprocessFile "Client\Module\Nuke\damage.sqf"; + NukeRadiation = Compile preprocessFile "Client\Module\Nuke\radzone.sqf"; +}; + +diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Common: Functions - [Done]",diag_frameno,diag_tickTime]; + +varQueu = (random 10)+(random 100)+(random 1000); + +EastCommanderTeam = ObjNull; +WestCommanderTeam = ObjNull; + +/* Starting Supply */ +if (isNil "EastSupplies") then {EastSupplies = if (WF_Debug) then {900000} else {1200}}; +if (isNil "WestSupplies") then {WestSupplies = if (WF_Debug) then {900000} else {1200}}; + +diag_log Format["[WFBE (INIT)][frameno:%3 | ticktime:%4] Init_Common: Starting Supply (West: %1 East: %2) - [Done]",WestSupplies,EastSupplies,diag_frameno,diag_tickTime]; + +/* Starting Money */ +['WFBE_EASTSTARTINGMONEY',if (WF_Debug) then {900000} else {800},false] Call SetNamespace; +['WFBE_WESTSTARTINGMONEY',if (WF_Debug) then {900000} else {800},false] Call SetNamespace; + +diag_log Format["[WFBE (INIT)][frameno:%3 | ticktime:%4] Init_Common: Starting Funds (West: %1 East: %2) - [Done]",'WFBE_WESTSTARTINGMONEY' Call GetNamespace,'WFBE_EASTSTARTINGMONEY' Call GetNamespace,diag_frameno,diag_tickTime]; + +/* Allies */ +if (('WFBE_ALLIES' Call GetNamespace) > 0) then { + westAlliesFunds = ('WFBE_WESTSTARTINGMONEY' Call GetNamespace)*5; + eastAlliesFunds = ('WFBE_EASTSTARTINGMONEY' Call GetNamespace)*5; + + diag_log Format["[WFBE (INIT)][frameno:%3 | ticktime:%4] Init_Common: Allies Starting Funds (West: %1 East: %2) - [Done]",('WFBE_WESTSTARTINGMONEY' Call GetNamespace)*5,('WFBE_EASTSTARTINGMONEY' Call GetNamespace)*5,diag_frameno,diag_tickTime]; +}; + +unitMarker = 0; + +for [{_count = 0},{_count < maxPlayers},{_count = _count + 1}] do { + Call Compile Format["if (IsNil 'EastTeam%1Vote') then {EastTeam%1Vote = -1}",_count + 1]; + Call Compile Format["if (IsNil 'WestTeam%1Vote') then {WestTeam%1Vote = -1}",_count + 1]; +}; + +/* Respawn Markers */ +createMarkerLocal ["respawn_east",getMarkerPos "EastTempRespawnMarker"]; +"respawn_east" setMarkerColorLocal "ColorGreen"; +"respawn_east" setMarkerShapeLocal "RECTANGLE"; +"respawn_east" setMarkerBrushLocal "BORDER"; +"respawn_east" setMarkerSizeLocal [15,15]; +"respawn_east" setMarkerAlphaLocal 0; +createMarkerLocal ["respawn_west",getMarkerPos "WestTempRespawnMarker"]; +"respawn_west" setMarkerColorLocal "ColorGreen"; +"respawn_west" setMarkerShapeLocal "RECTANGLE"; +"respawn_west" setMarkerBrushLocal "BORDER"; +"respawn_west" setMarkerSizeLocal [15,15]; +"respawn_west" setMarkerAlphaLocal 0; + +/* Prepare the common constants */ +[] Call Compile preprocessFile "Common\Init\Init_CommonConstants.sqf"; + +if (('WFBE_ISIS' Call GetNamespace) != 0) then { + ISIS_Heal = Compile preprocessFile "Client\Module\ISIS\ISIS_Heal.sqf"; + ISIS_Wound = Compile preprocessFile "Client\Module\ISIS\ISIS_Wound.sqf"; + ISIS_Wounded = Compile preprocessFile "Client\Module\ISIS\ISIS_Wounded.sqf"; +}; + +/* Wait for BIS Module Init */ +waitUntil {!(isNil 'BIS_fnc_init')}; +waitUntil {BIS_fnc_init}; + +/* CORE SYSTEM - Start + Different Core are added depending on the current ArmA Version running, add yours bellow. +*/ +switch (true) do { + case WF_A2_Vanilla: { + /* Gear Core */ + [] Call Compile preprocessFile 'Common\Config\Core_Gear\Core_Vanilla_G.sqf'; + /* Class Core */ + [] Call Compile preprocessFile 'Common\Config\Core\Core_CDF.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_CIV.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_FR.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_GUE.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_INS.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_MVD.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_RU.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_Spetsnaz.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_USMC.sqf'; + + /* Call in the teams template - Vanilla */ + [] Call Compile preprocessFile 'Common\Config\Core_Definition\Vanilla\Definition_USMC_RU.sqf'; + }; + case WF_A2_Arrowhead: { + /* Gear Core */ + [] Call Compile preprocessFile 'Common\Config\Core_Gear\Core_Arrowhead_G.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core_Gear\Core_BAF_G.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core_Gear\Core_PMC_G.sqf'; + /* Class Core */ + [] Call Compile preprocessFile 'Common\Config\Core\Core_ACR.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_BAF.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_BAFD.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_BAFW.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_DeltaForce.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_KSK.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_PMC.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_TKA.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_TKCIV.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_TKGUE.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_TKSF.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_US.sqf'; + + /* Call in the teams template - Arrowhead */ + [] Call Compile preprocessFile 'Common\Config\Core_Definition\Arrowhead\Definition_US_TKA.sqf'; + }; + case WF_A2_CombinedOps: { + /* Gear Core */ + [] Call Compile preprocessFile 'Common\Config\Core_Gear\Core_Vanilla_G.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core_Gear\Core_Arrowhead_G.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core_Gear\Core_BAF_G.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core_Gear\Core_PMC_G.sqf'; + /* Class Core */ + [] Call Compile preprocessFile 'Common\Config\Core\Core_ACR.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_BAF.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_BAFD.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_BAFW.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_CDF.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_CIV.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_DeltaForce.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_FR.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_GUE.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_INS.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_KSK.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_MVD.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_PMC.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_RU.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_Spetsnaz.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_TKA.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_TKCIV.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_TKGUE.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_TKSF.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_US.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_USMC.sqf'; + + /* Call in the teams template - Combined Operations */ + [] Call Compile preprocessFile 'Common\Config\Core_Definition\CombinedOps\Definition_US_RU.sqf'; + + /* Mods */ + if (WF_ACE) then { + [] Call Compile preprocessFile 'Common\Config\Core_Gear\Core_ACE_G.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_ACE_US_D.sqf'; + [] Call Compile preprocessFile 'Common\Config\Core\Core_ACE_US_W.sqf'; + }; + }; +}; +/* CORE SYSTEM - End */ + +diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Common: Core Loading - [Done]",diag_frameno,diag_tickTime]; + +//--- Common Exec. +[] Call Compile preprocessFile "Common\Init\Init_PublicVariables.sqf"; +[] Call Compile preprocessFile "Common\Config\Config_Special.sqf"; +[] Call Compile preprocessFile "Common\Config\Config_Artillery.sqf"; +[] Call Compile preprocessFile "Common\Config\Config_Barracks.sqf"; +[] Call Compile preprocessFile "Common\Config\Config_LightFactory.sqf"; +[] Call Compile preprocessFile "Common\Config\Config_HeavyFactory.sqf"; +[] Call Compile preprocessFile "Common\Config\Config_AircraftFactory.sqf"; +[] Call Compile preprocessFile "Common\Config\Config_Airport.sqf"; +[] Call Compile preprocessFile "Common\Config\Config_Depot.sqf"; +[] Call Compile preprocessFile "Common\Config\Config_Structures.sqf"; +[] Call Compile preprocessFile "Common\Config\Config_Squads.sqf"; +[] Call Compile preprocessFile "Common\Config\Config_Loadouts.sqf"; + +//--- Server Exec. +if (isServer) then { + [] Call Compile preprocessFile "Common\Config\Config_Resistance.sqf"; + [] Call Compile preprocessFile "Common\Config\Config_Occupation.sqf"; + + //--- Allies. + if (('WFBE_ALLIES' Call GetNamespace) > 0) then {[] Call Compile preprocessFile "Common\Config\Config_Allies.sqf"}; +}; + +diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Common: Config Loading - [Done]",diag_frameno,diag_tickTime]; + +//--- Boundaries, use setPos to find the perfect spot on other islands and worldName to determine the island name (editor: diag_log worldName; player setPos [0,5120,0]; ). +[] Call Compile preprocessFile "Common\Init\Init_Boundaries.sqf"; +diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Common: Boundaries Loading - [Done]",diag_frameno,diag_tickTime]; + +//--- Neighbors +if (('WFBE_TOWNCONQUESTMODE' Call GetNamespace) > 0) then {[] Call Compile preprocessFile "Common\Init\Init_Neighbors.sqf"}; + +//--- CIPHER Module - Functions. +[] Call Compile preprocessFile "Common\Module\CIPHER\CIPHER_Init.sqf"; + +//--- Common initilization is complete at this point. +diag_log Format["[WFBE (INIT)][frameno:%2 | ticktime:%3] Init_Common: Init End at %1",time,diag_frameno,diag_tickTime]; +commonInitComplete = true; + +//--- Variable Destruction. +{Call Compile Format ["%1 = nil",_x]} forEach ['WFBE_V_West_UnitsRootVersion','WFBE_V_East_UnitsRootVersion','WFBE_V_West_Faction', +'WFBE_V_East_Faction','WFBE_V_East_SquadsFaction','WFBE_V_West_SquadsFaction','WFBE_V_East_SquadsRootVersion','WFBE_V_West_SquadsRootVersion','WFBE_V_East_Loadout', +'WFBE_V_West_Loadout','WFBE_V_East_LoadoutRootVersion','WFBE_V_West_LoadoutRootVersion','WFBE_V_West_StructuresFaction','WFBE_V_East_StructuresFaction','WFBE_V_East_StructuresRootVersion', +'WFBE_V_West_StructuresRootVersion','WFBE_V_West_ArtilleryRootVersion','WFBE_V_West_ArtilleryFaction','WFBE_V_East_ArtilleryRootVersion','WFBE_V_East_ArtilleryFaction']; \ No newline at end of file diff --git a/Common/Init/Init_CommonConstants.sqf b/Common/Init/Init_CommonConstants.sqf new file mode 100644 index 0000000..58cfc6c --- /dev/null +++ b/Common/Init/Init_CommonConstants.sqf @@ -0,0 +1,492 @@ +Private ['_resType']; + +/* DO NOT CHANGE! */ +EASTID = 128; +WESTID = 256; +RESISTANCEID = 512; +/* DO NOT CHANGE! */ +QUERYUNITLABEL = 0; +QUERYUNITPICTURE = 1; +QUERYUNITPRICE = 2; +QUERYUNITTIME = 3; +QUERYUNITCREW = 4; +QUERYUNITUPGRADE = 5; +QUERYUNITFACTORY = 6; +QUERYUNITSKILL = 7; +QUERYUNITFACTION = 8; +QUERYUNITTURRETS = 9; +/* DO NOT CHANGE! */ +QUERYGEARLABEL = 0; +QUERYGEARPICTURE = 1; +QUERYGEARCLASS = 2; +QUERYGEARTYPE = 3; +QUERYGEARCOST = 4; +QUERYGEARUPGRADE = 5; +QUERYGEARALLOWED = 6; +QUERYGEARHANDGUNPOOL = 7; +QUERYGEARMAGAZINES = 8; +QUERYGEARSPACE = 9; +QUERYGEARALLOWTWO = 10; + +/* IMPORTANT: New Getter/Setter, variable are stored into missionNamespace, the true/false variable define whether we shall override an existing variable or not */ +//--- How long a vehicle last empty before being sweeped. +['WFBE_ABANDONVEHICLETIMER',1200,false] Call SetNamespace; +//--- AI Commander will move the base after this laps of time if all conditions are met. +['WFBE_AICOMMANDERMOVEINTERVAL',3600,true] Call SetNamespace; +//--- Global AI Skill (only used over units not present in core). +['WFBE_AISKILL',0.7,true] Call SetNamespace; +//--- Maximum AIs that will be able to man defense within the barracks area. +['WFBE_AIDEFENSE',30,false] Call SetNamespace; +//--- Allies Parameters (0 Disabled, 1 West, 2 East, 3 both). +['WFBE_ALLIES',0,false] Call SetNamespace; +//--- Anti Air Radar Z offset detection. +['WFBE_ANTIAIRRADARDETECTION',100,true] Call SetNamespace; +//--- Artillery Computer (0: Disabled, 1: Enabled on Upgrade, 2: Enabled). +['WFBE_ARTILLERYCOMPUTER',1,false] Call SetNamespace; +//--- Artillery Range. +['WFBE_ARTILLERYMAXRANGE',3,false] Call SetNamespace; +//--- Artillery Laser Detection Range (Per Shell). +['WFBE_ARTILLERYAMMOLASERRANGE',175,true] Call SetNamespace; +//--- Artillery SADARM Detection Range (Distance from the core). +['WFBE_ARTILLERYAMMOSADARMRANGE',200,true] Call SetNamespace; +//--- Price Focus. (0: Default, 1: Infantry, 2: Tanks, 3: Air). +['WFBE_BALANCEPRICE',0,false] Call SetNamespace; +//--- Balanced units. +['WFBE_BALANCEDUNITS',['HMMWV_Avenger','M6_EP1','Ka52','Ka52Black'],true] Call SetNamespace; +//--- Base Area Limits. +['WFBE_BASEAREARANGE',250,true] Call SetNamespace; +['WFBE_BASEAREAMAX',2,false] Call SetNamespace; +//--- Bounty Coefficient Modifier (Blood money). +['WFBE_BOUNTYMODIFIER',0.25,true] Call SetNamespace; +//--- Bounty Coefficient Modifier, Kill Assist (bounty = (Unit price * WFBE_BOUNTYMODIFIER) * WFBE_BOUNTYMODIFIERASSIST). +['WFBE_BOUNTYMODIFIERASSIST',0.5,true] Call SetNamespace; +//--- Building Damage Reduction (Current damage given / x, 1 = normal). +['WFBE_BUILDINGDAMAGEREDUCTION',6,true] Call SetNamespace; +//--- Building is sold after x seconds. +['WFBE_BUILDINGSELLDELAY',240,true] Call SetNamespace; +//--- Building Limits. +['WFBE_BUILDINGMAXBARRACKS',3,false] Call SetNamespace; +['WFBE_BUILDINGMAXLIGHT',3,false] Call SetNamespace; +['WFBE_BUILDINGMAXCOMMANDCENTER',3,false] Call SetNamespace; +['WFBE_BUILDINGMAXHEAVY',3,false] Call SetNamespace; +['WFBE_BUILDINGMAXAIRCRAFT',3,false] Call SetNamespace; +['WFBE_BUILDINGMAXSERVICEPOINT',6,false] Call SetNamespace; +//--- Bounty received by player whenever he capture a camp. +['WFBE_CAMPCAPTUREBOUNTY',100,true] Call SetNamespace; +//--- Civilian Faction (first is nil). +if (WF_A2_Vanilla) then {['WFBE_CIVILIANFACTIONS',['','Chernarus Civilians'],true] Call SetNamespace}; +if (WF_A2_Arrowhead) then {['WFBE_CIVILIANFACTIONS',['','Takistan Civilians'],true] Call SetNamespace}; +if (WF_A2_CombinedOps) then {['WFBE_CIVILIANFACTIONS',['','Takistan Civilians','Chernarus Civilians'],true] Call SetNamespace}; +['WFBE_CIVILIANFACTION',0,false] Call SetNamespace; +//--- Killed Civilians bring a $xxx penalty to the player. +['WFBE_CIVILIANPENALTY',2500,true] Call SetNamespace; +//--- Command Center Range. +['WFBE_COMMANDCENTERRANGE',50000,true] Call SetNamespace; +//--- Commander bounties. +['WFBE_COMMANDERBUILDSCORE',1,true] Call SetNamespace; +['WFBE_COMMANDERTOWNCAPTURECOEF',30,true] Call SetNamespace; +['WFBE_COMMANDERTOWNCAPTURESCORE',1,true] Call SetNamespace; +['WFBE_COMMANDERUPGRADESCORE',1,true] Call SetNamespace; +//--- Counter Measures. +['WFBE_COUNTERMEASUREPLANES',64,true] Call SetNamespace; +['WFBE_COUNTERMEASURECHOPPERS',32,true] Call SetNamespace; +//--- Crew Cost. +['WFBE_CREWCOST',120,true] Call SetNamespace; +//--- Within 250 meters, units on defense mode will board defenses. +['WFBE_DEFENSEMANRANGE',250,false] Call SetNamespace; +//--- Supply Trucks (Clients) delivery range. +['WFBE_DELIVERYRANGE',30,true] Call SetNamespace; +//--- Patrolling Range Ratio. +['WFBE_DETECTIONTOPATROLRANGERATIO',0.4,true] Call SetNamespace; +//--- Fast Time skip time rate index. +['WFBE_FASTTIMERATE',0,false] Call SetNamespace; +//--- Fast time rates (Seconds = value * 60 * 60). +['WFBE_FASTTIMERATES',[0,0.000555,0.000833,0.00111,0.00138,0.00277,0.00416,0.00555,0.00694,0.00833],true] Call SetNamespace; +//--- Fast Travel (0 Disabled, 1 Free, 2 Fee). +['WFBE_FASTTRAVEL',1,false] Call SetNamespace; +['WFBE_FASTTRAVELMAXRANGE',3500,true] Call SetNamespace; +['WFBE_FASTTRAVELPRICEKM',215,true] Call SetNamespace; +['WFBE_FASTTRAVELRANGE',175,true] Call SetNamespace; +['WFBE_FASTTRAVELTIMECOEF',1,true] Call SetNamespace; +//--- Fire mission interval. +['WFBE_FIREMISSIONTIMEOUT0',300,true] Call SetNamespace; +['WFBE_FIREMISSIONTIMEOUT1',250,true] Call SetNamespace; +['WFBE_FIREMISSIONTIMEOUT2',200,true] Call SetNamespace; +['WFBE_FIREMISSIONTIMEOUT3',150,true] Call SetNamespace; +//--- Coef per supply delivery. +['WFBE_FUNDSPERSUPPLYPOINT',2,true] Call SetNamespace; +//--- Distance above which units are able to perform an HALO jump. +['WFBE_HALOJUMPHEIGHT',200,true] Call SetNamespace; +//--- HQ Deploy / Mobilize Price. +['WFBE_HQDEPLOYPRICE',100,false] Call SetNamespace; +//--- MHQ Deploy Range. +['WFBE_HQDEPLOYRANGE',120,false] Call SetNamespace; +//--- Income Interval (Delay between each paycheck). +['WFBE_INCOMEINTERVAL',60,false] Call SetNamespace; +//--- Income System (1:Full, 2:Half (Half -> 120 SV Town = 60$ / 60SV), 3: Commander System, 4: Commander System: Full) +['WFBE_INCOMESYSTEM',4,false] Call SetNamespace; +//--- Incoming Guided missiles Range limit (0 = Disabled). +['WFBE_INCOMINGMISSILEMAXRANGE',0,false] Call SetNamespace; +//--- ISIS, Injury System (0: Disabled, 1: Leaders only, 2: All). +['WFBE_ISIS',0,false] Call SetNamespace; +//--- Map Coloration System (0: Default, 1: Nato). +['WFBE_MAPCOLORATION',0,false] Call SetNamespace; +//--- Time that a marker remain on a dead unit. +['WFBE_MARKERDEADDELAY',60,true] Call SetNamespace; +//--- Maximum spread area of artillery support. +['WFBE_MAXARTILLERYAREA',300,true] Call SetNamespace; +//--- Maximum rate of a camp's capture affecting a town. +['WFBE_MAXCAMPCAPTURERATE',5,true] Call SetNamespace; +//--- Maximum Client Group size. +['WFBE_MAXGROUPSIZE',14,false] Call SetNamespace; +['WFBE_MAXGROUPSIZEAI',10,false] Call SetNamespace; +//--- Skill (Soldiers), have more units than the others. +['WFBE_MAXGZBONUSSKILL',6,true] Call SetNamespace; +//--- Maximum amount of supply truck per side (AI). +['WFBE_MAXAISUPPLYTRUCKS',5,true] Call SetNamespace; +//--- Maximum Clutter Distance (Grass). +['WFBE_MAXCLUTTERDISTANCE',50,false] Call SetNamespace; +//--- Maximum Supply per trucks. +['WFBE_MAXSUPPLYTRUCKSSV0',5,true] Call SetNamespace; +['WFBE_MAXSUPPLYTRUCKSSV1',7,true] Call SetNamespace; +['WFBE_MAXSUPPLYTRUCKSSV2',10,true] Call SetNamespace; +//--- Maximum Client Side View Distance. +['WFBE_MAXVIEWDISTANCE',4000,false] Call SetNamespace; +//--- HQ Building Range. +['WFBE_MHQBUILDINGRANGE',120,true] Call SetNamespace; +//--- HQ Repair Price. +['WFBE_MHQREPAIRPRICE',if !(paramMoneyOnly) then {25000} else {50000},true] Call SetNamespace; +//--- Occupation 'part' (faction) to be used, keep the alias (US..USMC) the same as the files in Core_Occupation. +if (WF_A2_Vanilla) then { + ['WFBE_OCCUPATIONWESTFACTIONS',['CDF','USMC'],true] Call SetNamespace; + ['WFBE_OCCUPATIONEASTFACTIONS',['INS','RU'],true] Call SetNamespace; + ['WFBE_OCCUPATIONWESTFACTION',1,false] Call SetNamespace; + ['WFBE_OCCUPATIONEASTFACTION',1,false] Call SetNamespace; +}; +if (WF_A2_Arrowhead) then { + ['WFBE_OCCUPATIONWESTFACTIONS',['US'],true] Call SetNamespace; + ['WFBE_OCCUPATIONEASTFACTIONS',['TKA'],true] Call SetNamespace; + ['WFBE_OCCUPATIONWESTFACTION',0,false] Call SetNamespace; + ['WFBE_OCCUPATIONEASTFACTION',0,false] Call SetNamespace; +}; +if (WF_A2_CombinedOps) then { + ['WFBE_OCCUPATIONWESTFACTIONS',['CDF','US','USMC'],true] Call SetNamespace; + ['WFBE_OCCUPATIONEASTFACTIONS',['INS','RU','TKA'],true] Call SetNamespace; + ['WFBE_OCCUPATIONWESTFACTION',1,false] Call SetNamespace; + ['WFBE_OCCUPATIONEASTFACTION',1,false] Call SetNamespace; +}; +//--- East or West Inactive period before being removed (town). +['WFBE_OCCUPATIONINACTIVETIME',300,true] Call SetNamespace; +//--- Maximum man-able defenses per town. +['WFBE_OCCUPATIONMAXDEFENSES',20,true] Call SetNamespace; +//--- Delay between each occupation reinforcement spawned in town. +['WFBE_OCCUPATIONREINFORCEMENTDELAY',300,true] Call SetNamespace; +//--- Town Occupation SV floor. +['WFBE_OCCUPATIONTEAM1',20,true] Call SetNamespace; +['WFBE_OCCUPATIONTEAM2',40,true] Call SetNamespace; +['WFBE_OCCUPATIONTEAM3',60,true] Call SetNamespace; +['WFBE_OCCUPATIONTEAM4',80,true] Call SetNamespace; +['WFBE_OCCUPATIONTEAM5',100,true] Call SetNamespace; +['WFBE_OCCUPATIONTEAM6',120,true] Call SetNamespace; +//--- Town Occupation AA SV floor. +['WFBE_OCCUPATIONAATEAM1',50,true] Call SetNamespace; +['WFBE_OCCUPATIONAATEAM2',100,true] Call SetNamespace; +//--- Maximum seconds off the map limits. +['WFBE_OFFMAPMAXTIME',30,true] Call SetNamespace; +//--- Paratroopers Call Interval. +['WFBE_PARADELAY',1200,true] Call SetNamespace; +//--- Unit Patrol Radius. +['WFBE_PATROLRANGE',400,true] Call SetNamespace; +//--- Purchase Unit Range. +['WFBE_PURCHASEUNITSRANGE',150,true] Call SetNamespace; +['WFBE_PURCHASEUNITSRANGEAIR',50,true] Call SetNamespace; +//--- Purchase Gear Range. +['WFBE_PURCHASEGEARRANGE',150,true] Call SetNamespace; +//--- Repair truck repair range. +['WFBE_REPAIRTRUCKRANGE',40,true] Call SetNamespace; +//--- Resistance 'part' (faction) to be used, don't forget to define the types bellow for patrol & strikers, keep the alias (GUE..TKGUE) the same as the files in Core_Resistance. +if (WF_A2_Vanilla) then { + ['WFBE_RESISTANCEFACTIONS',['GUE'],true] Call SetNamespace; + ['WFBE_RESISTANCEFACTION',0,false] Call SetNamespace; +}; +if (WF_A2_Arrowhead) then { + ['WFBE_RESISTANCEFACTIONS',['PMC','TKGUE'],true] Call SetNamespace; + ['WFBE_RESISTANCEFACTION',1,false] Call SetNamespace; +}; +if (WF_A2_CombinedOps) then { + ['WFBE_RESISTANCEFACTIONS',['GUE','PMC','TKGUE'],true] Call SetNamespace; + ['WFBE_RESISTANCEFACTION',2,false] Call SetNamespace; +}; +//--- Resistance Inactive period before being removed (town). +['WFBE_RESISTANCEINACTIVETIME',300,true] Call SetNamespace; +//--- Delay between each resistance reinforcement spawned in town. +['WFBE_RESISTANCEREINFORCEMENTDELAY',240,true] Call SetNamespace; +//--- Respawn Camps (0: Disabled, 1: Classic [from town center], 2: Enhanced [from nearby camps]). +['WFBE_RESPAWNCAMPSMODE',2,false] Call SetNamespace; +//--- Respawn Camps Rule (0: Disabled, 1: West | East, 2: West | East | Resistance). +['WFBE_RESPAWNCAMPSRULEMODE',2,false] Call SetNamespace; +//--- Respawn Delay (Players/AI). +['WFBE_RESPAWNDELAY',30,false] Call SetNamespace; +//--- Respawn Penalty (0: None, 1: Remove All, 2: Pay full gear price, 3: Pay 1/2 gear price, 4: pay 1/4 gear price, 5: Charge on Mobile). +['WFBE_RESPAWNPENALTY',5,false] Call SetNamespace; +//--- How far a player need to be from a town to spawn at camps. +['WFBE_RESPAWNRANGE',550,false] Call SetNamespace; +['WFBE_RESPAWNMINRANGE',50,true] Call SetNamespace; +//--- How far a player need to be from a mobile respawn in order to spawn on it. +['WFBE_RESPAWNMOBILERANGE0',250,true] Call SetNamespace; +['WFBE_RESPAWNMOBILERANGE1',350,true] Call SetNamespace; +['WFBE_RESPAWNMOBILERANGE2',500,true] Call SetNamespace; +//--- Advanced Aircraft restriction. +['WFBE_RESTRICTIONADVAIR',0,false] Call SetNamespace; +//--- Salvager Sell %. +['WFBE_SALVAGERPERCENT',30,true] Call SetNamespace; +//--- Salvager's Range. +['WFBE_SALVAGERRANGE',20,true] Call SetNamespace; +//--- Score Gained per town assist. +['WFBE_SCOREASSISTCAPTURETOWN',5,true] Call SetNamespace; +//--- Points Gained per camp captire. +['WFBE_SCORECAPTURECAMP',1,true] Call SetNamespace; +//--- Score Gained per town capture. +['WFBE_SCORECAPTURETOWN',10,true] Call SetNamespace; +//--- Points Received per Supply delivery. +['WFBE_SCOREPERSUPPLYPOINT',2,true] Call SetNamespace; +//--- Service points action range. +['WFBE_SERVICEPOINTRANGE',50,true] Call SetNamespace; +//--- Sides need at last xkm of distance between them. +['WFBE_SIDESTARTINGDISTANCE',5000,false] Call SetNamespace; +//--- Starting Locations Mode: 0 = WN|ES; 1 = WS|EN; 2 = Random; +['WFBE_STARTINGLOCATIONMODE',2,false] Call SetNamespace; +//--- When a structure is sold, x% of supply goes back to the side. +['WFBE_STRUCTURESELLPERCENT',40,false] Call SetNamespace; +//--- Supply System (0: Trucks, 1: Automatic with time). +['WFBE_SUPPLYSYSTEM',0,false] Call SetNamespace; +//--- If SUPPLYSYSTEM == 1 then, we increase of SUPPLYSYSTEMINCREASE each SUPPLYSYSTEMINCREASETIME. +['WFBE_SUPPLYSYSTEMINCREASE0',1,true] Call SetNamespace; +['WFBE_SUPPLYSYSTEMINCREASE1',2,true] Call SetNamespace; +['WFBE_SUPPLYSYSTEMINCREASE2',3,true] Call SetNamespace; +['WFBE_SUPPLYSYSTEMINCREASETIME',60,true] Call SetNamespace; +//--- Action range for repair/rearm/refuel. +['WFBE_SUPPORTRANGE',70,true] Call SetNamespace; +//--- Price of Support (Base), note that Rearm, Refuel and Repair are using Ratio. +['WFBE_SUPPORTHEALPRICE',100,true] Call SetNamespace; +['WFBE_SUPPORTREARMPRICE',4,true] Call SetNamespace; +['WFBE_SUPPORTREFUELPRICE',16,true] Call SetNamespace; +['WFBE_SUPPORTREPAIRPRICE',2,true] Call SetNamespace; +//--- Amount of time required to be able to use an action from the support menu again. +['WFBE_SUPPORTHEALTIME',25,true] Call SetNamespace; +['WFBE_SUPPORTREARMTIME',30,true] Call SetNamespace; +['WFBE_SUPPORTREFUELTIME',20,true] Call SetNamespace; +['WFBE_SUPPORTREPAIRTIME',40,true] Call SetNamespace; +//--- Money to be deducted from a teamkiller. +['WFBE_TEAMKILLPENALTY',500,true] Call SetNamespace; +//--- Thermal Imaging (0: Disabled, 1: Weapons, 2: Vehicles, 3: All). +['WFBE_THERMALIMAGING',3,false] Call SetNamespace; +//--- Bounty received by player whenever he get an assist in a town. +['WFBE_TOWNASSISTCAPTUREBOUNTY',175,true] Call SetNamespace; +['WFBE_TOWNMISSIONASSISTCAPTUREBOUNTY',350,true] Call SetNamespace; +//--- Restrict use of build menu if the player is near a town. +['WFBE_TOWNBUILDPROTECTIONRANGE',450,false] Call SetNamespace; +//--- Range Coefficient whenever a player get an assist in a town. +['WFBE_TOWNCAPTUREASSISTRANGEMODIFIER',0.6,true] Call SetNamespace; +//--- Bounty received by player whenever he capture a town. +['WFBE_TOWNCAPTUREBOUNTY',400,true] Call SetNamespace; +['WFBE_TOWNMISSIONCAPTUREBOUNTY',800,true] Call SetNamespace; +//--- Town capture mode (0: normal, 1: threshold, 2: all camps[Best Use with PvP]). +['WFBE_TOWNCAPTUREMODE',1,false] Call SetNamespace; +//--- Town Depot capture range. +['WFBE_TOWNCAPTURERANGE',40,true] Call SetNamespace; +//--- Town Depot capture range (Threshold Capture mode). +['WFBE_TOWNCAPTURERANGETHRESHOLD',50,true] Call SetNamespace; +//--- Town Capture rate. +['WFBE_TOWNCAPTURERATE',1,true] Call SetNamespace; +//--- Town Conquest mode (0: None, 1: Territoriality 2: (tbd) commander task set). - TODO +['WFBE_TOWNCONQUESTMODE',0,false] Call SetNamespace; +//--- Buy Gear From (0: None, 1: Camps, 2: Depot, 3: Camps & Depot). +['WFBE_TOWNGEAR',1,false] Call SetNamespace; +//--- Amount of Waypoints given to the AI Patrol in towns (Higher is wider). +['WFBE_TOWNPATROLHOPS',5,true] Call SetNamespace; +//--- Town Purchase range. +['WFBE_TOWNPURCHASERANGE',30,true] Call SetNamespace; +//--- Town occupation Difficulty (1: Light, 2: Medium, 3: Hard, 4: Insane, 5: Auto). +['WFBE_TOWNOCCUPATIONDIFFICULTY',1,false] Call SetNamespace; +//--- Town resistance Difficulty (1: Light, 2: Medium, 3: Hard, 4: Insane). +['WFBE_TOWNRESISTANCEDIFFICULTY',1,false] Call SetNamespace; +//--- Town starting mode (0: Resistance, 1: 50% blu, 50% red, 2: Nearby Towns, 3: Random). +['WFBE_TOWNSTARTINGMODE',0,false] Call SetNamespace; +//--- Distance between each defensive waypoints. +['WFBE_TOWNUNITSDEFENSEDISTANCE',30,true] Call SetNamespace; +//--- Distance between each patrolling waypoints. +['WFBE_TOWNUNITSPATROLDISTANCE',360,true] Call SetNamespace; +//--- Unit will spawn within this range. +['WFBE_TOWNUNITSPAWNRANGE',75,true] Call SetNamespace; +//--- Interval between each uav spotting routine. +['WFBE_UAVSPOTTINGDELAY',20,true] Call SetNamespace; +//--- UAV will reveal each targets that it knows about this value (0-4) +['WFBE_UAVSPOTTINGDETECTION',0.21,true] Call SetNamespace; +//--- Max Range of the UAV spotting. +['WFBE_UAVSPOTTINGRANGE',900,true] Call SetNamespace; +//--- Units cleaning delay. +['WFBE_UNITREMOVEDLAY',300,false] Call SetNamespace; +//--- Victory Condition (0: Annihilation, 1: Assassination, 2: Supremacy, 3: Towns). +['WFBE_VICTORYCONDITION',2,false] Call SetNamespace; +//--- Commander vote time. +['WFBE_VOTETIME',if (WF_Debug) then {6} else {60},true] Call SetNamespace; +//--- Weather Type, 0: Clear, 1: Cloudy, 2: Rainy, 3: Dynamic) +['WFBE_WEATHER',0,false] Call SetNamespace; +//--- Weather Transition period (longer is more realistic). +['WFBE_WEATHERTRANSITION',600,true] Call SetNamespace; +//--- Proper worlds (Radio town localization). +['WFBE_WORLDWHITELISTOA',["Zargabad","Takistan"],true] Call SetNamespace; +['WFBE_WORLDWHITELISTVA',["chernarus","utes"],true] Call SetNamespace; + +if (paramUseWorkers) then { + //--- Minimal Distance in order to start building. + ['WFBE_WORKERS_BUILDDISTANCE',30,true] Call SetNamespace; + //--- Degredation of the building in time during a repair phase (over 100). + ['WFBE_WORKERS_DEGRADATION',1,true] Call SetNamespace; + //--- Maximum Workers per side. + ['WFBE_WORKERS_MAX',10,true] Call SetNamespace; + //--- Maximal Traveling distance. + ['WFBE_WORKERS_MAXRANGE',650,true] Call SetNamespace; + //--- Workers Models. + ['WFBE_WORKERS_MODELS_EAST',if (WF_A2_Vanilla) then {["Worker3","Worker1"]} else {["TK_CIV_Worker01_EP1"]}, true] Call SetNamespace; + ['WFBE_WORKERS_MODELS_WEST',if (WF_A2_Vanilla) then {["Worker2","Worker4"]} else {["TK_CIV_Worker02_EP1"]}, true] Call SetNamespace; + //--- Worker Price + ['WFBE_WORKERS_PRICE',500,true] Call SetNamespace; + //--- Build Speed Ratio. + ['WFBE_WORKERS_RATIO',2,true] Call SetNamespace; + //--- Health Point fixed during a repair. + ['WFBE_WORKERS_REPAIR',0.0075,true] Call SetNamespace; + //--- Ruins model. + ['WFBE_WORKERS_RUINS',if (WF_A2_Vanilla) then {"Land_budova4_ruins"} else {"Land_Mil_Barracks_i_ruins_EP1"}, true] Call SetNamespace; +}; + +//--- Build area (Radius/Height). +['WFBE_AREAHQDEPLOYED',[('WFBE_HQDEPLOYRANGE' Call GetNamespace),25],true] Call SetNamespace; +['WFBE_AREAHQUNDEPLOYED',[('WFBE_HQDEPLOYRANGE' Call GetNamespace)/2,15],true] Call SetNamespace; +['WFBE_AREAREPAIRTRUCK',[45,10],true] Call SetNamespace; + +//--- Construction Module, Flat Detection. +if (WF_A2_Vanilla) then { + ['WFBE_COINMINDISTANCE',8,true] Call SetNamespace; + ['WFBE_COINMAXGRADIENT',4,true] Call SetNamespace; +} else { + ['WFBE_COINMINDISTANCE',24,true] Call SetNamespace; + ['WFBE_COINMAXGRADIENT',4,true] Call SetNamespace; +}; + +//--- Resistance Island Patrol System. +['WFBE_RESPATROLINTERVAL',1200,true] Call SetNamespace; +['WFBE_RESPATROL',0,false] Call SetNamespace; + +//--- Resistance Strikers. +['WFBE_RESSTRIKERINTERVAL',1800,true] Call SetNamespace; +['WFBE_RESSTRIKER',0,false] Call SetNamespace; + +/* UPGRADE SYSTEM: */ +//--- Important: If you add any other upgrades, add them at the end, also add a new 0 to init_server.sqf upgrade array. + +//--- Desc-Array - added MrNiceGuy +['WFBE_UPGRADEDESCRIPTION', + [localize 'STR_WF_UPGRADE_barracks_Desc',localize 'STR_WF_UPGRADE_lightfactory_Desc',localize 'STR_WF_UPGRADE_heavyfactory_Desc',localize 'STR_WF_UPGRADE_aircraftfactory_Desc', + localize 'STR_WF_UPGRADE_Paratroop_Desc',localize 'STR_WF_UPGRADE_uav_Desc',localize 'STR_WF_UPGRADE_Supply_Desc',localize 'STR_WF_UPGRADE_RespawnRange_Desc', + localize 'STR_WF_UPGRADE_Airlift_Desc',localize 'STR_WF_UPGRADE_Countermeasures_Desc',localize 'STR_WF_UPGRADE_ArtilleryUpgrade_Desc',localize 'STR_WF_UPGRADE_ICBM_Desc', + localize 'STR_WF_UPGRADE_FastTravel_Desc',localize 'STR_WF_UPGRADE_Gear_Desc',localize 'STR_WF_UPGRADE_Ammo_Desc',localize 'STR_WF_UPGRADE_EASA_Desc', + localize 'STR_WF_UPGRADE_Paradrop_Desc',localize 'STR_WF_UPGRADE_ArtilleryAmmo_Desc'], + true +] Call SetNamespace; + +['WFBE_UPGRADELABELS', + [localize 'strwfbarracks',localize 'strwflightfactory',localize 'strwfheavyfactory',localize 'strwfaircraftfactory',localize 'STR_WF_TACTICAL_Paratroop', + localize 'str_dn_uav',localize 'STR_WF_UPGRADE_Supply',localize 'STR_WF_UPGRADE_RespawnRange',localize 'STR_WF_UPGRADE_Airlift',localize 'STR_WF_UPGRADE_Countermeasures', + localize 'STR_WF_UPGRADE_ArtilleryUpgrade',localize 'STR_WF_ICBM',localize 'STR_WF_TACTICAL_FastTravel',localize 'STR_WF_UPGRADE_Gear',localize 'STR_WF_Ammo','EASA', + localize 'STR_WF_TACTICAL_Paradrop', localize 'STR_WF_UPGRADE_ArtilleryAmmo'], + true +] Call SetNamespace; +//--- Amount of upgrade levels. +['WFBE_UPGRADELEVELS',[3,3,3,3,3,1,2,2,1,1,3,1,1,3,1,1,1,3],true] Call SetNamespace; +//--- [upgrade index, upgrade level]. +['WFBE_UPGRADEDEPENDENCIES',[[],[],[],[],[3,1],[3,2],[],[1,2],[],[3,1],[2,1],[3,3],[],[0,1],[13,3],[3,3],[8,1],[10,3]],true] Call SetNamespace; +//--- Special condition. +['WFBE_UPGRADECONDITION',[true,true,true,true,true,true,true,true,true,paramCounterMeasures,paramArty,paramICBM,if (('WFBE_FASTTRAVEL' Call GetNamespace) > 0) then {true} else {false},true,true,paramEASA,true,true],true] Call SetNamespace; +//--- [Supply,Money]. +['WFBE_UPGRADEPRICESLEVEL1',[[300,750],[800,1850],[3600,4000],[5600,11000],[3200,7400],[2500,5600],[1800,6200],[500,1800],[950,2450],[3400,8200],[1200,2950],[50000,80000],[1350,3550],[250,500],[750,2250],[4400,12500],[3250,8800],[2400,4550]],true] Call SetNamespace; +['WFBE_UPGRADEPRICESLEVEL2',[[400,1150],[1400,2450],[4500,6750],[7600,16000],[3800,8700],[],[3600,12400],[700,2400],[],[],[1800,4400],[],[],[650,2550],[],[],[],[3500,8500]],true] Call SetNamespace; +['WFBE_UPGRADEPRICESLEVEL3',[[500,1620],[1900,3400],[5500,8050],[9500,21250],[4400,9800],[],[],[],[],[],[3000,7500],[],[],[1400,4250],[],[],[],[6200,12000]],true] Call SetNamespace; +//--- Time required per upgrade. +['WFBE_UPGRADETIMESLEVEL1',[40,60,80,100,120,120,140,120,100,120,100,240,260,180,170,160,140,120],true] Call SetNamespace; +['WFBE_UPGRADETIMESLEVEL2',[60,80,100,120,140,0,160,140,0,0,140,0,0,200,0,0,0,140],true] Call SetNamespace; +['WFBE_UPGRADETIMESLEVEL3',[80,100,120,180,160,0,0,0,0,0,160,0,0,220,0,0,0,160],true] Call SetNamespace; +// ['WFBE_UPGRADETIMESLEVEL1',[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],true] Call SetNamespace; +// ['WFBE_UPGRADETIMESLEVEL2',[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],true] Call SetNamespace; +// ['WFBE_UPGRADETIMESLEVEL3',[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],true] Call SetNamespace; +//--- AI COMMANDER priority, we use the upgrade index (0: Barracks, 4: Paratroops...). +['WFBE_UPGRADEAIORDER',[0,13,1,6,2,12,3,7,10,3,8,4,5,9,11,14,15,16,17],true] Call SetNamespace; + +/* Handle the missions (Server Only) */ +if (isServer && paramSecondaryMissions) then { + Private ['_initExt','_tpath']; + _tpath = 'Server\Missions\'; + _initExt = '\m_init.sqf'; + + //--- Maximum amount of missions allowed per side at a time. + ['WFBE_MISSIONSMAXIMUM_WEST',1,true] Call SetNamespace; + ['WFBE_MISSIONSMAXIMUM_EAST',1,true] Call SetNamespace; + //--- Time randomizer (Affect the timeout). + ['WFBE_MISSIONSRANDOMIZER',160,true] Call SetNamespace; + //--- Re-usability, after x missions, mission y is available again. + ['WFBE_MISSIONSREUSABILITY',10,true] Call SetNamespace; + //--- Time to wait between each missions. + ['WFBE_MISSIONSTIMEOUT',2400,true] Call SetNamespace; + + //--- Assign a content. + /* + all templates need at least a m_init.sqf + + [ + [island array, * = all, ! = not in, put the worldnames in otherwise], + temp path + folder name in templates + init name (path to the template folder), + unique identifier (template name or something, avoid duplicated names), + starting index (used in case of duplicated template allowed), 0 is ok to start with, + condition for template to be 'selectable', keep it as if it was a if (true/false condition), as it will be compiled inside a if on the fly (i.e: time > 600). + run for who? both(civ)? west? east? + ]. + + Each mission receive 3 defaults parameters, the unique identifier, the starting index and the selected index. + */ + + ['WFBE_M_CONTENT',[ + [['*'],(_tpath + 'M_UAV_RetrieveModule' + _initExt),'M_UAV_RetrieveModule',0,"true",civilian], /* UAV Retrieving Mission, Any islands, No conditions, Both. */ + [['*'],(_tpath + 'M_TOWN_Attack' + _initExt),'M_TOWN_AttackWest',0,"time > 1200",west], /* Town Assault, resistance attack a town, require at least a town (we wait a bit), west. */ + [['*'],(_tpath + 'M_TOWN_Attack' + _initExt),'M_TOWN_AttackEast',0,"time > 1200",east], /* Town Assault, resistance attack a town, require at least a town (we wait a bit), east. */ + [['*'],(_tpath + 'M_BASE_Attack' + _initExt),'M_BASE_Attack',0,"(count WestBaseStructures > 0) && (time > 600)",west], /* Resistance attack a base, require at least one building (we wait a bit), west. */ + [['*'],(_tpath + 'M_BASE_Attack' + _initExt),'M_BASE_Attack',0,"(count EastBaseStructures > 0) && (time > 600)",east], /* Resistance attack a base, require at least one building (we wait a bit), east. */ + [['*'],(_tpath + 'M_PLAYERS_Attack_Air' + _initExt),'M_PLAYERS_Attack_Air',0,"!WF_A2_Vanilla && paramDLCPMC",west], /* Resistance PMC attack players, requires PMC, west. */ + [['*'],(_tpath + 'M_PLAYERS_Attack_Air' + _initExt),'M_PLAYERS_Attack_Air',0,"!WF_A2_Vanilla && paramDLCPMC",east] /* Resistance PMC attack players, requires PMC, east. */ + ],true] Call SetNamespace; + + //--- Ensure that the re-usability is not higher than the content. + if (('WFBE_MISSIONSREUSABILITY' Call GetNamespace) > count('WFBE_M_CONTENT' Call GetNamespace)-1) then { + ['WFBE_MISSIONSREUSABILITY',count('WFBE_M_CONTENT' Call GetNamespace),true] Call SetNamespace; + }; +}; + +//--- UPSMON Parameters. +if (paramUPSMON) then { + //--- Size of the marker (x,y) from the center of a town. + ['WFBE_UPSMONTOWNAREASIZE',[550,550],true] Call SetNamespace; +}; + +//--- Income System is Commander System? +if (('WFBE_INCOMESYSTEM' Call GetNamespace) in [3,4]) then { + //--- Town Multiplicator Coefficient (SV * x). + ['WFBE_INC_COEFFICIENT',10, true] Call SetNamespace; + //--- Prevent commander from being a millionaire, and add the rest to the players pool. + ['WFBE_INC_DIVIDE_COM',2.75, true] Call SetNamespace; + + //--- Commander Income %. + if (isNil "EastCommanderPercent") then {EastCommanderPercent = 70}; + if (isNil "WestCommanderPercent") then {WestCommanderPercent = 70}; +}; + +diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_CommonConstants: Constants Initialization - [Done]",diag_frameno,diag_tickTime]; \ No newline at end of file diff --git a/Common/Init/Init_Location.sqf b/Common/Init/Init_Location.sqf new file mode 100644 index 0000000..d0d97df --- /dev/null +++ b/Common/Init/Init_Location.sqf @@ -0,0 +1,87 @@ +Private ['_camps','_location','_locationName','_marker','_maxSupplyValue','_probability','_range','_resistanceTeamTypes','_startingSupplyValue']; + +_location = _this select 0; +_locationName = _this select 1; +_resistanceTeamTypes = ["Group","Group"]; +_probability = 70; +_startingSupplyValue = 10; +_maxSupplyValue = 50; +_range = 400; + +if (count _this > 3) then {_startingSupplyValue = _this Select 2}; +if (count _this > 4) then {_maxSupplyValue = _this Select 3}; +if (count _this > 5) then {_range = _this Select 4}; +if (count _this > 6) then {_resistanceTeamTypes = _this Select 5}; +if (count _this > 7) then {_probability = _this Select 6}; + +if (isNull _location) exitWith {}; + +_camps = _location getVariable "camps"; +if (isNil "_camps") then {_location setVariable ["camps",[]]}; + +_location setVariable ["name",_locationName]; +_location setVariable ["range",_range]; +_location setVariable ["startingSupplyValue",_startingSupplyValue]; +_location setVariable ["maxSupplyValue",_maxSupplyValue]; + +diag_log Format["[WFBE (INIT)][frameno:%3 | ticktime:%4] Init_Location: Town '%1' (%2) initialization - [Done]",str _location,_locationName,diag_frameno,diag_tickTime]; + +waitUntil {commonInitComplete}; + +if (isServer) then { + if (isNil 'EastMHQ' || isNil 'WestMHQ') exitWith {}; + //--- Don't pause. + [_location,_startingSupplyValue,_range,_resistanceTeamTypes,_probability,_maxSupplyValue] Spawn { + Private ["_defenses","_isSet","_location","_marker","_maxSupplyValue","_probability","_range","_resistanceTeamTypes","_size","_startingSupplyValue"]; + _location = _this select 0; + _startingSupplyValue = _this select 1; + _range = _this select 2; + _resistanceTeamTypes = _this select 3; + _probability = _this select 4; + _maxSupplyValue = _this select 5; + + /* OA Depots are made of kryptonite */ + if (WF_A2_Arrowhead || WF_A2_CombinedOps) then {_location addEventHandler ['handleDamage',{false}]}; + _isSet = _location getVariable 'sideID'; + if (isNil '_isSet') then {_location setVariable ["sideID",RESISTANCEID,true]}; + _location setVariable ["supplyValue",_startingSupplyValue,true]; + _location setVariable ["resistanceTypes",_resistanceTeamTypes]; + sleep (random 1); + waitUntil {serverInitComplete && townInit}; + //--- Town SV & Control script. + [_location,_range] ExecFSM "Server\FSM\updatetown.fsm"; + if !(paramRes) then { + _defenses = _location nearEntities['WFBE_RESISTANCEDEFENSENAMES' Call GetNamespace,_range]; + {deleteVehicle _x} forEach _defenses; + }; + //--- Main AI Script + if (paramOccup || paramRes) then {[_location, _resistanceTeamTypes, _probability] ExecFSM "Server\FSM\updatetownai.fsm"}; + + //--- UPSMON Area Definition. + if (paramUPSMON) then { + _marker = Format['UPSMON_TOWN_%1',str _location]; + createMarkerLocal [_marker, getPos _location]; + _marker setMarkerColorLocal "ColorBlue"; + _marker setMarkerShapeLocal "RECTANGLE"; + _marker setMarkerBrushLocal "BORDER"; + _size = 'WFBE_UPSMONTOWNAREASIZE' Call GetNamespace; + _marker setMarkerSizeLocal [_size select 0,_size select 1]; + _marker setMarkerAlphaLocal 0; + }; + }; + + if (('WFBE_TOWNCONQUESTMODE' Call GetNamespace) > 0) then { + _location setVariable ["wfbe_cancap_w", false]; + _location setVariable ["wfbe_cancap_e", false]; + }; +}; + +towns = towns + [_location]; + +if (local player) then { + waitUntil {clientInitComplete}; + _marker = Format["%1Depot",str _location]; + createMarkerLocal [_marker,getPos _location]; + _marker setMarkerTypeLocal "Depot"; + _marker setMarkerColorLocal ("Resistance" Call GetMarkerColoration); +}; \ No newline at end of file diff --git a/Common/Init/Init_Neighbors.sqf b/Common/Init/Init_Neighbors.sqf new file mode 100644 index 0000000..727e0d1 --- /dev/null +++ b/Common/Init/Init_Neighbors.sqf @@ -0,0 +1,232 @@ +/* + Neighbors town per world. +*/ + +Private ["_index","_townMode"]; +_index = 0; +for [{_i = 0},{_i < (count (missionConfigFile/"Params"))},{_i = _i + 1}] do {if ((configName ((missionConfigFile >> "Params") select _i)) == "townsAmount") exitWith {_index =_i}}; +_townMode = if (isMultiplayer) then {paramsArray select _index} else {getNumber (missionConfigFile >> "Params" >> "townsAmount" >> "default")}; + +switch (toLower(worldName)) do { + case "chernarus": { + switch (_townMode) do { + case 4: {//--- Full. + Kamenka setVariable ["neighbors", [Pavlovo, Komarovo]]; + Komarovo setVariable ["neighbors", [Pavlovo, Komarovo, Bor, Chernogorsk]]; + Chernogorsk setVariable ["neighbors", [Komarovo, Nadezhdino, Prigorodki, Kozlovka]]; + Prigorodki setVariable ["neighbors", [Chernogorsk, Elektrozavodsk]]; + Elektrozavodsk setVariable ["neighbors", [Prigorodki, Chernogorsk, Pusta, Kamyshovo, Staroye]]; + Kamyshovo setVariable ["neighbors", [Tulga, Elektrozavodsk]]; + Tulga setVariable ["neighbors", [Kamyshovo, Msta, Solnichniy]]; + Solnichniy setVariable ["neighbors", [Kamyshovo, Msta, Nizhnoye, Dolina]]; + Nizhnoye setVariable ["neighbors", [Solnichniy, Berezino]]; + Berezino setVariable ["neighbors", [Nizhnoye, Khelm, Orlovets, Dubrovka]]; + Khelm setVariable ["neighbors", [Berezino, Krasnostav]]; + Krasnostav setVariable ["neighbors", [Olsha, Gvozdno, Dubrovka, Khelm]]; + Olsha setVariable ["neighbors", [Krasnostav]]; + Gvozdno setVariable ["neighbors", [Krasnostav, Grishino]]; + Grishino setVariable ["neighbors", [Gvozdno, Petrovka, Kabanino]]; + Petrovka setVariable ["neighbors", [Grishino, Lopatino]]; + Lopatino setVariable ["neighbors", [Petrovka, Vybor, Pustoshka]]; + Myshkino setVariable ["neighbors", [Sosnovka, Pustoshka]]; + Sosnovka setVariable ["neighbors", [Zelenogorsk, Myshkino, Pustoshka]]; + Zelenogorsk setVariable ["neighbors", [Sosnovka, Pogorevka, Kozlovka, Pavlovo]]; + Pavlovo setVariable ["neighbors", [Kamenka, Komarovo, Bor, Zelenogorsk]]; + Bor setVariable ["neighbors", [Pavlovo, Kozlovka, Komarovo]]; + Kozlovka setVariable ["neighbors", [Bor, Zelenogorsk, Nadezhdino, Chernogorsk]]; + Nadezhdino setVariable ["neighbors", [Kozlovka, Chernogorsk]]; + Mogilevka setVariable ["neighbors", [Vyshnoye, Pusta]]; + Pusta setVariable ["neighbors", [Mogilevka, Elektrozavodsk]]; + Staroye setVariable ["neighbors", [Shakhovka, Guglovo, Elektrozavodsk, Msta]]; + Msta setVariable ["neighbors", [Staroye, Tulga, Solnichniy]]; + Dolina setVariable ["neighbors", [Staroye, Solnichniy, Solnichniy, Polana]]; + Orlovets setVariable ["neighbors", [Berezino, Polana]]; + Polana setVariable ["neighbors", [Orlovets, Polana, Dolina, Shakhovka, Gorka]]; + Gorka setVariable ["neighbors", [Dubrovka, NovySobor, Polana]]; + Dubrovka setVariable ["neighbors", [Gorka, Krasnostav, Berezino]]; + Shakhovka setVariable ["neighbors", [Staroye, Polana]]; + Guglovo setVariable ["neighbors", [Staroye, NovySobor]]; + NovySobor setVariable ["neighbors", [Guglovo, Gorka, StarySobor]]; + Vyshnoye setVariable ["neighbors", [StarySobor, Gorka]]; + StarySobor setVariable ["neighbors", [Vyshnoye, NovySobor, Kabanino, Pogorevka]]; + Pulkovo setVariable ["neighbors", [Pogorevka]]; + Pogorevka setVariable ["neighbors", [Pulkovo, Zelenogorsk, StarySobor]]; + Kabanino setVariable ["neighbors", [Vybor, Grishino, StarySobor]]; + Vybor setVariable ["neighbors", [Kabanino, Lopatino, Pustoshka]]; + Pustoshka setVariable ["neighbors", [Kabanino, Vybor, Myshkino]]; + }; + case 3: {//--- Large. + Chernogorsk setVariable ["neighbors", [Komarovo, Nadezhdino, Elektrozavodsk]]; + Elektrozavodsk setVariable ["neighbors", [Chernogorsk, Pusta, Kamyshovo, Staroye]]; + Kamyshovo setVariable ["neighbors", [Solnichniy, Elektrozavodsk]]; + Solnichniy setVariable ["neighbors", [Kamyshovo, Dolina, Berezino]]; + Berezino setVariable ["neighbors", [Solnichniy, Dubrovka]]; + Krasnostav setVariable ["neighbors", [Gvozdno, Dubrovka]]; + Dubrovka setVariable ["neighbors", [Gorka, Krasnostav, Berezino]]; + Gorka setVariable ["neighbors", [Dubrovka, Polana, StarySobor]]; + Polana setVariable ["neighbors", [Gorka, Dolina]]; + Dolina setVariable ["neighbors", [Polana, Solnichniy, Staroye]]; + Staroye setVariable ["neighbors", [Elektrozavodsk, Dolina, Guglovo]]; + Pusta setVariable ["neighbors", [Elektrozavodsk, Mogilevka]]; + Guglovo setVariable ["neighbors", [Staroye, StarySobor]]; + Mogilevka setVariable ["neighbors", [Pusta, Vyshnoye, Nadezhdino]]; + Vyshnoye setVariable ["neighbors", [Mogilevka, StarySobor]]; + StarySobor setVariable ["neighbors", [Mogilevka, Kabanino, Gorka, Pogorevka, Guglovo]]; + Gvozdno setVariable ["neighbors", [Grishino, Krasnostav]]; + Grishino setVariable ["neighbors", [Kabanino, Petrovka, Gvozdno]]; + Kabanino setVariable ["neighbors", [StarySobor, Grishino, Vybor]]; + Petrovka setVariable ["neighbors", [Grishino, Lopatino]]; + Lopatino setVariable ["neighbors", [Vybor, Petrovka]]; + Vybor setVariable ["neighbors", [Lopatino, Myshkino, Kabanino]]; + Pogorevka setVariable ["neighbors", [StarySobor, Zelenogorsk]]; + Myshkino setVariable ["neighbors", [Zelenogorsk, Lopatino]]; + Nadezhdino setVariable ["neighbors", [Mogilevka, Chernogorsk]]; + Zelenogorsk setVariable ["neighbors", [Pogorevka, Myshkino, Pavlovo]]; + Pavlovo setVariable ["neighbors", [Zelenogorsk, Komarovo]]; + Komarovo setVariable ["neighbors", [Pavlovo, Chernogorsk]]; + }; + case 2: {//--- Medium. + Chernogorsk setVariable ["neighbors", [Komarovo, Nadezhdino, Kozlovka, Mogilevka]]; + Mogilevka setVariable ["neighbors", [Vyshnoye, Nadezhdino]]; + Vyshnoye setVariable ["neighbors", [Mogilevka, StarySobor]]; + StarySobor setVariable ["neighbors", [Mogilevka, Kabanino, Pogorevka]]; + Grishino setVariable ["neighbors", [Kabanino]]; + Kabanino setVariable ["neighbors", [StarySobor, Grishino, Vybor]]; + Lopatino setVariable ["neighbors", [Vybor]]; + Vybor setVariable ["neighbors", [Lopatino, Pustoshka, Kabanino]]; + Myshkino setVariable ["neighbors", [Zelenogorsk, Pustoshka]]; + Nadezhdino setVariable ["neighbors", [Mogilevka, Chernogorsk]]; + Zelenogorsk setVariable ["neighbors", [Pogorevka, Myshkino, Pavlovo, Kozlovka]]; + Pavlovo setVariable ["neighbors", [Zelenogorsk, Komarovo, Kamenka]]; + Komarovo setVariable ["neighbors", [Pavlovo, Chernogorsk, Kamenka]]; + Kamenka setVariable ["neighbors", [Pavlovo, Komarovo]]; + Kozlovka setVariable ["neighbors", [Zelenogorsk, Nadezhdino, Chernogorsk]]; + Pustoshka setVariable ["neighbors", [Vybor, Myshkino]]; + Pogorevka setVariable ["neighbors", [StarySobor, Zelenogorsk]]; + }; + case 1: {//--- Small. + Berezino setVariable ["neighbors", [Khelm, Orlovets, Dubrovka]]; + Orlovets setVariable ["neighbors", [Berezino, Polana]]; + Polana setVariable ["neighbors", [Gorka, Orlovets]]; + Gorka setVariable ["neighbors", [Dubrovka, Polana]]; + Dubrovka setVariable ["neighbors", [Gorka, Krasnostav, Berezino]]; + Khelm setVariable ["neighbors", [Berezino, Krasnostav]]; + Krasnostav setVariable ["neighbors", [Olsha, Gvozdno, Dubrovka, Khelm]]; + Olsha setVariable ["neighbors", [Krasnostav]]; + Gvozdno setVariable ["neighbors", [Krasnostav]]; + }; + case 0: {//--- Extra Small. + Grishino setVariable ["neighbors", [Kabanino]]; + Kabanino setVariable ["neighbors", [Grishino, Vybor]]; + Vybor setVariable ["neighbors", [Kabanino, Lopatino, Pustoshka]]; + Pustoshka setVariable ["neighbors", [Vybor]]; + Lopatino setVariable ["neighbors", [Vybor]]; + }; + }; + }; + case "takistan": { + switch (_townMode) do { + case 4: {//--- Full. + Landay setVariable ["neighbors", [ChakChak]]; + ChakChak setVariable ["neighbors", [Landay, Sakhee, Huzrutimam]]; + Huzrutimam setVariable ["neighbors", [ChakChak, Sultansafee]]; + Sultansafee setVariable ["neighbors", [Huzrutimam, LoyManara]]; + LoyManara setVariable ["neighbors", [Sultansafee, Jaza, Chardarakht, Timurkalay]]; + Chardarakht setVariable ["neighbors", [LoyManara, HazarBagh]]; + HazarBagh setVariable ["neighbors", [Chardarakht]]; + Timurkalay setVariable ["neighbors", [LoyManara, Anar, Garmarud]]; + Garmarud setVariable ["neighbors", [Timurkalay, Garmsar, Imarat]]; + Garmsar setVariable ["neighbors", [Garmarud]]; + Imarat setVariable ["neighbors", [Garmarud, Zavarak, Bastam]]; + Zavarak setVariable ["neighbors", [Imarat, Karachinar, Ravanay]]; + Karachinar setVariable ["neighbors", [Zavarak]]; + Ravanay setVariable ["neighbors", [Zavarak]]; + Bastam setVariable ["neighbors", [Imarat, Falar, Rasman, Gospandi]]; + Rasman setVariable ["neighbors", [Shamali, Bastam]]; + Shamali setVariable ["neighbors", [Rasman, Nagara]]; + Nagara setVariable ["neighbors", [Nur, Gospandi, Shamali]]; + Nur setVariable ["neighbors", [Nagara]]; + Gospandi setVariable ["neighbors", [Nagara, Bastam, Mulladoost]]; + Mulladoost setVariable ["neighbors", [Gospandi, Khushab]]; + Khushab setVariable ["neighbors", [Mulladoost, Jilavur, Shukurkalay]]; + Shukurkalay setVariable ["neighbors", [Khushab, Jilavur, Chaman]]; + Chaman setVariable ["neighbors", [Shukurkalay]]; + Jilavur setVariable ["neighbors", [Shukurkalay, Khushab, Sakhee, FeeruzAbad]]; + Sakhee setVariable ["neighbors", [Jilavur, ChakChak, FeeruzAbad, Kakaru]]; + Kakaru setVariable ["neighbors", [Sakhee, Anar, FeeruzAbad]]; + FeeruzAbad setVariable ["neighbors", [Jilavur, Anar, Kakaru, Falar, Sakhee]]; + Anar setVariable ["neighbors", [FeeruzAbad, Kakaru, Timurkalay, Falar]]; + Falar setVariable ["neighbors", [FeeruzAbad, Anar, Bastam]]; + }; + case 3: {//--- Large. + Landay setVariable ["neighbors", [ChakChak]]; + ChakChak setVariable ["neighbors", [Landay, Sakhee, Huzrutimam]]; + Huzrutimam setVariable ["neighbors", [ChakChak, Sultansafee]]; + Sultansafee setVariable ["neighbors", [Huzrutimam, LoyManara]]; + LoyManara setVariable ["neighbors", [Sultansafee, Jaza, Chardarakht, Timurkalay]]; + Chardarakht setVariable ["neighbors", [LoyManara]]; + Timurkalay setVariable ["neighbors", [LoyManara, Anar, Garmarud]]; + Garmarud setVariable ["neighbors", [Timurkalay, Garmsar, Imarat]]; + Garmsar setVariable ["neighbors", [Garmarud]]; + Imarat setVariable ["neighbors", [Garmarud, Zavarak, Bastam]]; + Zavarak setVariable ["neighbors", [Imarat, Karachinar, Ravanay]]; + Karachinar setVariable ["neighbors", [Zavarak]]; + Ravanay setVariable ["neighbors", [Zavarak]]; + Bastam setVariable ["neighbors", [Imarat, Falar, Rasman, Gospandi]]; + Rasman setVariable ["neighbors", [Shamali, Bastam]]; + Shamali setVariable ["neighbors", [Rasman, Nagara]]; + Nagara setVariable ["neighbors", [Gospandi, Shamali]]; + Gospandi setVariable ["neighbors", [Nagara, Bastam, Mulladoost]]; + Mulladoost setVariable ["neighbors", [Gospandi, Khushab]]; + Khushab setVariable ["neighbors", [Mulladoost, Jilavur, Shukurkalay]]; + Shukurkalay setVariable ["neighbors", [Khushab, Jilavur]]; + Jilavur setVariable ["neighbors", [Shukurkalay, Khushab, Sakhee, FeeruzAbad]]; + Sakhee setVariable ["neighbors", [Jilavur, ChakChak, FeeruzAbad, Kakaru]]; + Kakaru setVariable ["neighbors", [Sakhee, Anar, FeeruzAbad]]; + FeeruzAbad setVariable ["neighbors", [Jilavur, Anar, Kakaru, Falar, Sakhee]]; + Anar setVariable ["neighbors", [FeeruzAbad, Kakaru, Timurkalay, Falar]]; + Falar setVariable ["neighbors", [FeeruzAbad, Anar, Bastam]]; + }; + case 2: {//--- Medium. + Garmarud setVariable ["neighbors", [Imarat]]; + Imarat setVariable ["neighbors", [Garmarud, Bastam]]; + Bastam setVariable ["neighbors", [Imarat, Falar, Rasman, Gospandi]]; + Rasman setVariable ["neighbors", [Shamali, Bastam]]; + Shamali setVariable ["neighbors", [Rasman, Nagara]]; + Nagara setVariable ["neighbors", [Gospandi, Shamali]]; + Gospandi setVariable ["neighbors", [Nagara, Bastam, Mulladoost]]; + Mulladoost setVariable ["neighbors", [Gospandi, Khushab]]; + Khushab setVariable ["neighbors", [Mulladoost]]; + Falar setVariable ["neighbors", [Anar, Bastam]]; + }; + case 1: {//--- Small. + Bastam setVariable ["neighbors", [Imarat, Falar, Rasman, Gospandi]]; + Rasman setVariable ["neighbors", [Shamali, Bastam]]; + Shamali setVariable ["neighbors", [Rasman, Nagara]]; + Nagara setVariable ["neighbors", [Gospandi, Shamali]]; + Nur setVariable ["neighbors", [Nagara]]; + Gospandi setVariable ["neighbors", [Nagara, Bastam, Mulladoost]]; + }; + case 0: {//--- Extra Small. + Huzrutimam setVariable ["neighbors", [LoyManara]]; + LoyManara setVariable ["neighbors", [Chardarakht, Huzrutimam]]; + Chardarakht setVariable ["neighbors", [LoyManara]]; + }; + }; + }; + case "zargabad": { + Qeslaq setVariable ["neighbors", [Shahbaz, Zargabad]]; + Shahbaz setVariable ["neighbors", [Qeslaq, Yarum]]; + Yarum setVariable ["neighbors", [Zargabad, Shahbaz]]; + Zargabad setVariable ["neighbors", [Qeslaq, Yarum, Nango, Azizajt, HazarBagh]]; + Azizajt setVariable ["neighbors", [Zargabad, Nango]]; + Nango setVariable ["neighbors", [Zargabad, Azizajt, HazarBagh]]; + HazarBagh setVariable ["neighbors", [Zargabad, Nango]]; + }; + default { + ['WFBE_TOWNCONQUESTMODE', 0, true] Call SetNamespace; + }; +}; + +objnull setVariable ["neighbors",objnull]; + diff --git a/Common/Init/Init_PublicVariables.sqf b/Common/Init/Init_PublicVariables.sqf new file mode 100644 index 0000000..535b47b --- /dev/null +++ b/Common/Init/Init_PublicVariables.sqf @@ -0,0 +1,62 @@ +Private ['_clientCommandPV','_count','_l','_serverCommandPV']; + +_l = ["RequestVehicleLock"]; +_l = _l + ["RequestChangeScore"]; +_l = _l + ["RequestCommanderVote"]; +_l = _l + ["RequestStructure"]; +_l = _l + ["RequestDefense"]; +_l = _l + ["RequestJoin"]; +_l = _l + ["RequestMHQRepair"]; +_l = _l + ["RequestSpecial"]; +_l = _l + ["RequestTeamUpdate"]; +_l = _l + ["RequestUpgrade"]; +if (paramUseWorkers) then {_l = _l + ["RequestWorker"]}; + +_serverCommandPV = _l; + +_l = ["AllCampsCaptured"]; +_l = _l + ["AwardBounty"]; +_l = _l + ["CampCaptured"]; +_l = _l + ["CanJoin"]; +_l = _l + ["ChangeScore"]; +_l = _l + ["CommanderVote"]; +_l = _l + ["DisplayICBM"]; +_l = _l + ["EndGame"]; +_l = _l + ["ISIS_AddAction"]; +_l = _l + ["LocalizeMessage"]; +_l = _l + ["Penalty"]; +_l = _l + ["PerformAction"]; +_l = _l + ["SetHQStatus"]; +_l = _l + ["SetTask"]; +_l = _l + ["SetVehicleLock"]; +_l = _l + ["TownCaptured"]; +_l = _l + ["TownCapturedPublic"]; +_l = _l + ["UAV_Reveal"]; +_l = _l + ["VoteForCommander"]; + +/* Add missions Clients PVF here */ +if (paramSecondaryMissions) then { + _l = _l + ['M_BASE_Attack']; + _l = _l + ['M_TOWN_Attack']; + _l = _l + ['M_UAV_RetrieveModule']; + /* OA/CO Specific PVF */ + if !(WF_A2_Vanilla) then { + _l = _l + ['M_PLAYERS_Attack_Air']; + }; +}; + +_clientCommandPV = _l; + +for [{_count = Count _clientCommandPV - 1},{_count >= 0},{_count = _count - 1}] do {Call Compile Format["CLTFNC%1 = Compile PreprocessFile 'Client\PVFunctions\%1.sqf'",_clientCommandPV Select _count,_count]}; +for [{_count = Count _serverCommandPV - 1},{_count >= 0},{_count = _count - 1}] do {Call Compile Format["SRVFNC%1 = Compile PreprocessFile 'Server\PVFunctions\%1.sqf'",_serverCommandPV Select _count,_count]}; + +//--- Handle the client side publicVariable. +if (local player) then { + {Format['WFBE_%1',_x] addPublicVariableEventHandler {(_this select 1) Spawn HandlePVF}} forEach _clientCommandPV; +}; +//--- Handle the server side publicVariable. +if (isServer) then { + {Format['WFBE_%1',_x] addPublicVariableEventHandler {(_this select 1) Spawn HandleSPVF}} forEach _serverCommandPV; +}; + +diag_log Format["[WFBE (INIT)][frameno:%3 | ticktime:%4] Init_PublicVariables: Public Variable Initialization (SRV: %1 CLT: %2) - [Done]",count _serverCommandPV, count _clientCommandPV,diag_frameno,diag_tickTime]; \ No newline at end of file diff --git a/Common/Init/Init_TownMode.sqf b/Common/Init/Init_TownMode.sqf new file mode 100644 index 0000000..bafc29a --- /dev/null +++ b/Common/Init/Init_TownMode.sqf @@ -0,0 +1,53 @@ +/* + Town mode initialization. + the town that have to be removed need to be stored on the desired variable over WF_Logic. If those ain't set, the full town setting will be used. + Custom templates can be added bellow. +*/ +private ['_index','_i','_paramName','_value']; +Private ['_i','_index','_paramName','_value']; + +_index = 0; +for [{_i = 0},{_i < (count (missionConfigFile/"Params"))},{_i = _i + 1}] do { + _paramName = (configName ((missionConfigFile >> "Params") select _i)); + if (_paramName == "townsAmount") exitWith {_index =_i}; +}; + +_value = if (isMultiplayer) then {paramsArray select _index} else {getNumber (missionConfigFile >> "Params" >> "townsAmount" >> "default")}; + +/* + Chernarus Template (WF_Logic init field): + this setVariable ["Towns_RemovedXSmall",["Zelenogorsk","Dolina","StarySobor","Myshkino","Chernogorsk","Dubrovka","Pogorevka","Bor","Staroye","Pulkovo","Khelm","Kamyshovo","Pavlovo","Nadezhdino","Mogilevka","Vyshnoye","Berezino","Krasnostav","Gorka","Elektrozavodsk","Msta","Komarovo","Petrovka","Shakhovka","Prigorodki","Olsha","Orlovets","Nizhnoye","Solnichniy","Tulga","Kozlovka","Polana","Kamenka","Gvozdno","NovySobor","Pusta","Guglovo"]]; + this setVariable ["Towns_RemovedSmall",["Zelenogorsk","Dolina","StarySobor","Lopatino","Myshkino","Chernogorsk","Pogorevka","Bor","Kabanino","Staroye","Pulkovo","Kamyshovo","Vybor","Pavlovo","Nadezhdino","Grishino","Mogilevka","Vyshnoye","Elektrozavodsk","Msta","Komarovo","Petrovka","Shakhovka","Prigorodki","Nizhnoye","Solnichniy","Tulga","Kozlovka","Pustoshka","Kamenka","NovySobor","Pusta","Guglovo"]]; + this setVariable ["Towns_RemovedMedium",["Dolina","Dubrovka","Bor","Staroye","Elektrozavodsk","Berezino","Krasnostav","Pulkovo","Khelm","Kamyshovo","Vyshnoye","Gorka","Msta","Petrovka","Shakhovka","Prigorodki","Olsha","Orlovets","Nizhnoye","Solnichniy","Tulga","Polana","Gvozdno","NovySobor","Pusta","Guglovo","Sosnovka"]]; + this setVariable ["Towns_RemovedLarge",["Bor","Pulkovo","Khelm","Msta","Shakhovka","Prigorodki","Olsha","Orlovets","Nizhnoye","Tulga","Kozlovka","Pustoshka","Kamenka","NovySobor","Sosnovka"]]; +*/ + +TownTemplate = []; +switch (_value) do { + case 0: {TownTemplate = WF_Logic getVariable "Towns_RemovedXSmall"}; + case 1: {TownTemplate = WF_Logic getVariable "Towns_RemovedSmall"}; + case 2: {TownTemplate = WF_Logic getVariable "Towns_RemovedMedium"}; + case 3: {TownTemplate = WF_Logic getVariable "Towns_RemovedLarge"}; + //--- case 4 = full. useless. + /* Add your templates here ! + Custom templates can be added here, just set a new variable with the towns to remove in WF_Logic and add your template name/value in the parameter class + - WF_Logic: this setVariable ["myRemovedTowns",["Chernogorsk","Pavlovo","Zelenogorsk"]]; + - parameter (Add it at the end!!!): + class townsAmount { + title = "$STR_WF_PARAMETER_TownsAmount"; + values[] = {0,1,2,3,4,5}; + texts[] = {"Extra Small","Small","Medium","Large","Full","MyOwnTemplate"}; + default = 3; + }; + - Init_TownMode.sqf (Here!): case 5: {TownTemplate = WF_Logic getVariable "myRemovedTowns"} + + As a result, Chernogorsk, Pavlovo and Zelenogorsk will be removed. + */ +}; + +if (isNil "TownTemplate") then {TownTemplate = []};//--- The field is not defined, we use the default island setting. +totalTowns = (WF_Logic getVariable "totalTowns") - (count TownTemplate); + +townModeSet = true; + +diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_TownMode: Towns mode initialization (world: %3) - [Done]",diag_frameno,diag_tickTime,worldName]; \ No newline at end of file diff --git a/Common/Init/Init_Towns.sqf b/Common/Init/Init_Towns.sqf new file mode 100644 index 0000000..4ee8796 --- /dev/null +++ b/Common/Init/Init_Towns.sqf @@ -0,0 +1,25 @@ +Private ["_startAt","_txt"]; + +waitUntil{townModeSet}; +_startAt = time; +waitUntil {!isNil "totalTowns" || time - _startAt > 120}; +waitUntil {(count towns == totalTowns) || time - _startAt > 120}; +if ((count towns != totalTowns) && local player) then { + _txt = Format["DEBUG: \n\n Something might be wrong with the town initialization process... \n\n This could be related to the towns amount set in WF_Logic or to the initialization itself, try to rejoin the game if the auto-fix doesn't work... \n\n Extra Info: \n count towns: %1 \n totalTowns: %2... \n\n The game will now attempt to fix itself...",count towns,totalTowns]; + _txt Call DebugHint; + + /* Attempt to fix Null over JIP */ + towns = towns - [objNull]; + if (count towns == totalTowns) then + { + townInit = true; + } + else + { + diag_log Format["[WFBE (INIT)] Init_Towns: Fail with count towns = %1, totalTowns = %2",count towns, totalTowns]; + sleep 5; + failMission "END1"; + }; +} else {townInit = true}; + +diag_log Format["[WFBE (INIT)][frameno:%1 | ticktime:%2] Init_Towns: Towns initialization - [Done]",diag_frameno,diag_tickTime]; \ No newline at end of file -- cgit v1.3.1