From 85c85e6d4fb9d23957c512eb29108dbb466bebfd Mon Sep 17 00:00:00 2001 From: second_coming Date: Fri, 22 Apr 2016 13:19:51 +0100 Subject: [PATCH] v26 fixes fixed public bus spawn issue on Namalsk --- config.sqf | 16 ++++++++++------ initServer.sqf | 7 +++++-- scripts/functions/fnc_spawnStatics.sqf | 2 ++ scripts/occupationPublicBus.sqf | 20 ++++++++++++-------- scripts/startOccupation.sqf | 10 +++++----- 5 files changed, 34 insertions(+), 21 deletions(-) diff --git a/config.sqf b/config.sqf index 2921c0f..6eb5868 100644 --- a/config.sqf +++ b/config.sqf @@ -21,10 +21,10 @@ SC_mapMarkers = false; // Place map markers at the occupied areas (o SC_minFPS = 5; // any lower than minFPS on the server and additional AI won't spawn SC_scaleAI = 10; // any more than _scaleAI players on the server and _maxAIcount is reduced for each extra player -SC_fastNights = false; // true if you want night time to go faster than daytime +SC_fastNights = true; // true if you want night time to go faster than daytime SC_fastNightsStarts = 18; // Start fast nights at this hour (24 hour clock) eg. 18 for 6pm SC_fastNightsMultiplierNight= 16; // the time multiplier to use at night (12 = 12x speed) -SC_fastNightsEnds = 6; // Start fast nights at this hour (24 hour clock) eg. 6 for 6am +SC_fastNightsEnds = 6; // End fast nights at this hour (24 hour clock) eg. 6 for 6am SC_fastNightsMultiplierDay = 4; // the time multiplier to use during daylight hours (4 = 4x speed) SC_useWaypoints = true; // When spawning AI create waypoints to make them enter buildings (can affect performance when the AI is spawned and the waypoints are calculated) @@ -42,9 +42,9 @@ SC_occupyTraderDetails = [ ["Test Trader2",[10666,10262,0],true] ]; //["Name",[x,y,z],true] trader name, location, safezone true/false -SC_SurvivorsChance = 33; // chance in % to spawn survivors instead of bandits (for places and land vehicles) +SC_SurvivorsChance = 20; // chance in % to spawn survivors instead of bandits (for places and land vehicles) SC_occupyPlacesSurvivors = true; // true if you want a chance to spawn survivor AI as well as bandits (SC_occupyPlaces must be true to use this option) -SC_occupyVehicleSurvivors = true; // true if you want a chance to spawn survivor AI as well as bandits (SC_occupyVehicle must be true to use this option) +SC_occupyVehicleSurvivors = false; // true if you want a chance to spawn survivor AI as well as bandits (SC_occupyVehicle must be true to use this option) SC_SurvivorsFriendly = true; // true if you want survivors to be friendly to players (until they are attacked by players) // false if you want survivors to be aggressive to players @@ -216,7 +216,7 @@ CIVILIAN setFriend[EAST,0]; CIVILIAN setFriend[WEST,0]; EAST setFriend[CIVILIAN,0]; WEST setFriend[CIVILIAN,0]; - + SC_SurvivorSide = CIVILIAN; SC_BanditSide = EAST; SC_liveVehicles = 0; @@ -225,6 +225,7 @@ SC_liveHelis = 0; SC_liveHelisArray = []; SC_liveBoats = 0; SC_liveBoatsArray = []; +SC_liveStaticGroups = []; SC_publicBusArray = []; publicVariable "SC_liveVehicles"; @@ -233,7 +234,10 @@ publicVariable "SC_liveHelis"; publicVariable "SC_liveHelisArray"; publicVariable "SC_liveBoats"; publicVariable "SC_liveBoatsArray"; +publicVariable "SC_liveStaticGroups"; publicVariable "SC_numberofLootCrates"; publicVariable "SC_publicBusArray"; publicVariable "SC_SurvivorSide"; -publicVariable "SC_BanditSide"; \ No newline at end of file +publicVariable "SC_BanditSide"; + +SC_CompiledOkay = true; \ No newline at end of file diff --git a/initServer.sqf b/initServer.sqf index 73dbd14..2a114a4 100644 --- a/initServer.sqf +++ b/initServer.sqf @@ -2,7 +2,7 @@ // // Server Occupation script by second_coming // -SC_occupationVersion = "v25 (20-04-2016)"; +SC_occupationVersion = "v26 (22-04-2016)"; // // http://www.exilemod.com/profile/60-second_coming/ // @@ -24,11 +24,14 @@ SC_occupationVersion = "v25 (20-04-2016)"; { diag_log format ["[OCCUPATION]:: Occupation %2 Giving the server time to start before starting [OCCUPATION] (%1)",time,SC_occupationVersion]; waitUntil { !(isNil "DMS_MinMax_Y_Coords") }; - sleep 1; + + sleep 10; diag_log format ["[OCCUPATION MOD]:: Occupation %2 Loading Config at %1",time,SC_occupationVersion]; // Get the config for Occupation call compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\config.sqf"; + + if(!SC_CompiledOkay) exitWith { diag_log format ["[OCCUPATION]:: Occupation failed to read config.sqf, check for typos (time: %1)",time]; }; // Select the log style depending on config settings SC_fnc_log = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationLog.sqf"; diff --git a/scripts/functions/fnc_spawnStatics.sqf b/scripts/functions/fnc_spawnStatics.sqf index fceafba..1a3db07 100644 --- a/scripts/functions/fnc_spawnStatics.sqf +++ b/scripts/functions/fnc_spawnStatics.sqf @@ -66,6 +66,8 @@ if(_side == "survivor") then { _currentSide = SC_SurvivorSide }; _group setVariable ["DMS_SpawnedGroup",true]; _group setVariable ["DMS_Group_Side", _side]; + SC_liveStaticGroups = SC_liveStaticGroups + [_group,_spawnPosition]; + { _unit = _x; [_unit] joinSilent grpNull; diff --git a/scripts/occupationPublicBus.sqf b/scripts/occupationPublicBus.sqf index 4dbd2a5..5791364 100644 --- a/scripts/occupationPublicBus.sqf +++ b/scripts/occupationPublicBus.sqf @@ -1,18 +1,22 @@ if (!isServer) exitWith {}; -_middle = worldSize/2; -_spawnCenter = [_middle,_middle,0]; // Centre point for the map -_maxDistance = _middle; // Max radius for the map - -if(!isNil "SC_occupyPublicBusStartPos") then { _spawnCenter = SC_occupyPublicBusStartPos }; - _logDetail = format ["[OCCUPATION:publicBus]:: Starting @ %1",time]; [_logDetail] call SC_fnc_log; -_logDetail = format ["[OCCUPATION:publicBus]:: Spawning near map centre %1 @ %2",_spawnCenter,time]; +if( count SC_occupyPublicBusStartPos == 0) then +{ + //if(worldName == 'Namalsk') then { _spawnCenter = [6400,6400,0]; } else + //{ + _middle = worldSize/2; + _spawnCenter = [_middle,_middle,0]; + //}; + SC_occupyPublicBusStartPos = _spawnCenter; +}; + +_logDetail = format ["[OCCUPATION:publicBus]:: Spawning near map centre %1 @ %2",SC_occupyPublicBusStartPos,time]; [_logDetail] call SC_fnc_log; -_positionOfBus = [_spawnCenter,0,500,25,0,10,0] call BIS_fnc_findSafePos; +_positionOfBus = [SC_occupyPublicBusStartPos,0,500,25,0,10,0] call BIS_fnc_findSafePos; // Get position of nearest roads _nearRoads = _positionOfBus nearRoads 2000; diff --git a/scripts/startOccupation.sqf b/scripts/startOccupation.sqf index f397918..887722f 100644 --- a/scripts/startOccupation.sqf +++ b/scripts/startOccupation.sqf @@ -4,6 +4,7 @@ if (!isServer) exitWith {}; _logDetail = format ["[OCCUPATION]:: Occupation %2 Initialised at %1",time,SC_occupationVersion]; [_logDetail] call SC_fnc_log; +[] call ExileClient_system_map_initialize; if(SC_debug) then { SC_refreshTime = 60; }else{ SC_refreshTime = 300; }; @@ -21,11 +22,6 @@ if(SC_occupyTraders) then call compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationTraders.sqf"; }; -if(SC_occupyPublicBus) then -{ - [] execVM "\x\addons\a3_exile_occupation\scripts\occupationPublicBus.sqf"; -}; - if(SC_occupyLootCrates) then { if(SC_occupyLootCratesMarkers) then @@ -85,6 +81,10 @@ if(SC_occupyMilitary) then [SC_refreshTime, fnc_occupationMilitary, [], true] call ExileServer_system_thread_addTask; }; +if(SC_occupyPublicBus) then +{ + [] execVM "\x\addons\a3_exile_occupation\scripts\occupationPublicBus.sqf"; +}; uiSleep 15; // delay the start fnc_occupationMonitor = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationMonitor.sqf";