Merge remote-tracking branch 'refs/remotes/origin/development'

This commit is contained in:
second_coming 2016-04-18 23:47:20 +01:00
commit 34aeba948e
16 changed files with 288 additions and 136 deletions

1
$PBOPREFIX$ Normal file
View File

@ -0,0 +1 @@
x\addons\a3_exile_occupation

1
PboPrefix.txt Normal file
View File

@ -0,0 +1 @@
x\addons\a3_exile_occupation

View File

@ -12,18 +12,16 @@
// Shared Config for each occupation monitor
SC_debug = false; // set to true to turn on debug features (not for live servers)
SC_debug = false; // set to true to turn on debug features (not for live servers)
SC_extendedLogging = false; // set to true for additional logging
SC_infiSTAR_log = true; // true Use infiSTAR logging, false logs to server rpt
SC_maxAIcount = 100; // the maximum amount of AI, if the AI count is above this then additional AI won't spawn
SC_mapMarkers = false; // Place map markers at the occupied areas (occupyPlaces and occupyMilitary only) true/false
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_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)
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)
SC_occupyPlaces = true; // true if you want villages,towns,cities patrolled by bandits
@ -31,12 +29,20 @@ SC_occupyVehicle = true; // true if you want to have roaming AI vehicles
SC_occupyVehiclesLocked = true; // true if AI vehicles to stay locked until all the linked AI are dead
SC_SurvivorsChance = 33; // 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_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
SC_occupyMilitary = true; // true if you want military buildings patrolled (specify which types of building below)
// Array of uniforms for survivor AI to use
SC_SurvivorUniforms = ["Exile_Uniform_BambiOverall"];
SC_occupyMilitary = false; // true if you want military buildings patrolled
// Array of buildings to add military patrols to
SC_buildings = [ "Land_TentHangar_V1_F","Land_Hangar_F",
"Land_Airport_Tower_F","Land_Cargo_House_V1_F",
"Land_Cargo_House_V3_F","Land_Cargo_HQ_V1_F",
@ -68,13 +74,13 @@ SC_buildings = [ "Land_TentHangar_V1_F","Land_Hangar_F",
];
SC_occupyStatic = true; // true if you want to garrison AI in specific locations
SC_occupyStatic = false; // true if you want to garrison AI in specific locations
SC_occupySky = true; // true if you want to have roaming AI helis
SC_occupySea = false; // true if you want to have roaming AI boats
SC_occupyPublicBus = true; // true if you want a roaming bus service
SC_occupyPublicBusClass = "Exile_Car_Ikarus_Party"; // class name for the vehicle to use as the public bus
SC_occupyPublicBusClass = "Exile_Car_Ikarus_Party"; // class name for the vehicle to use as the public bus
SC_occupyLootCrates = true; // true if you want to have random loot crates with guards
SC_numberofLootCrates = 6; // if SC_occupyLootCrates = true spawn this many loot crates (overrided below for Namalsk)
@ -82,29 +88,79 @@ SC_LootCrateGuards = 4; // number of AI to spawn at
SC_LootCrateGuardsRandomize = true; // Use a random number of guards up to a maximum = SC_numberofGuards (so between 1 and SC_numberofGuards)
SC_occupyLootCratesMarkers = true; // true if you want to have markers on the loot crate spawns
// Array of possible common items to go in loot crates ["classname",fixed amount,random amount]
// ["Exile_Item_Matches",1,2] this example would add between 1 and 3 Exile_Item_Matches to the crate (1 + 0 to 2 more)
// to add a fixed amount make the second number 0
SC_LootCrateItems = [
["Exile_Melee_Axe",1,0],
["Exile_Item_GloriousKnakworst",1,2],
["Exile_Item_PlasticBottleFreshWater",1,2],
["Exile_Item_Beer",5,1],
["Exile_Item_BaseCameraKit",0,2],
["Exile_Item_InstaDoc",1,1],
["Exile_Item_Matches",1,0],
["Exile_Item_CookingPot",1,0],
["Exile_Item_MetalPole",1,0],
["Exile_Item_LightBulb",1,0],
["Exile_Item_FuelCanisterEmpty",1,0],
["Exile_Item_WoodPlank",1,8],
["Exile_Item_woodFloorKit",1,2],
["Exile_Item_WoodWindowKit",1,1],
["Exile_Item_WoodDoorwayKit",1,1],
["Exile_Item_WoodFloorPortKit",1,2],
["Exile_Item_Laptop",0,1],
["Exile_Item_CodeLock",0,1]
];
SC_occupyHeliCrashes = true; // true if you want to have Dayz style helicrashes
SC_numberofHeliCrashes = 5; // if SC_occupyHeliCrashes = true spawn this many loot crates (overrided below for Namalsk)
// Array of possible common items to go in heli crash crates ["classname",fixed amount,random amount] NOT INCLUDING WEAPONS
// ["HandGrenade",0,2] this example would add between 0 and 2 HandGrenade to the crate (fixed 0 plus 0-2 random)
// to add a fixed amount make the second number 0
SC_HeliCrashItems = [
["HandGrenade",0,2],
["APERSBoundingMine_Range_Mag",0,2],
["B_Parachute",1,1],
["H_CrewHelmetHeli_B",1,1],
["ItemGPS",0,1],
["Exile_Item_InstaDoc",0,1],
["Exile_Item_PlasticBottleFreshWater",2,2],
["Exile_Item_EMRE",2,2]
];
// Array of possible weapons to place in the crate
SC_HeliCrashWeapons = ["srifle_DMR_02_camo_F","srifle_DMR_03_woodland_F","srifle_DMR_04_F","srifle_DMR_05_hex_F"];
SC_HeliCrashWeaponsAmount = [1,3]; // [fixed amount to add, random amount to add]
SC_HeliCrashMagazinesAmount = [2,2]; // [fixed amount to add, random amount to add]
SC_statics = [ [[1178,2524,0],8,250,true] ]; //[[pos],ai count,radius,search buildings]
SC_maximumCrewAmount = 2; // Maximum amount of AI allowed in a vehicle
// (essential crew like drivers and gunners will always spawn regardless of this setting)
// Settings for roaming ground vehicle AI
SC_maxNumberofVehicles = 4;
SC_VehicleClassToUse = [ "Exile_Car_LandRover_Green","Exile_Bike_QuadBike_Black","Exile_Car_Octavius_White"];
SC_maxNumberofVehicles = 4;
// Array of ground vehicles which can be used by AI patrols
SC_VehicleClassToUse = [ "Exile_Car_LandRover_Green","Exile_Bike_QuadBike_Black","Exile_Car_UAZ_Open_Green"];
// Settings for roaming airborne AI (non armed helis will just fly around)
SC_maxNumberofHelis = 1;
// Array of aircraft which can be used by AI patrols
SC_HeliClassToUse = [ "Exile_Chopper_Huey_Armed_Green"];
// Settings for roaming seaborne AI (non armed boats will just sail around)
SC_maxNumberofBoats = 1;
// Array of boats which can be used by AI patrols
SC_BoatClassToUse = [ "B_Boat_Armed_01_minigun_F","I_Boat_Armed_01_minigun_F","O_Boat_Transport_01_F","Exile_Boat_MotorBoat_Police" ];
// AI Custom Loadouts
// namalsk specific settings
// namalsk specific settings (if you want to override settings for specific maps if you run multiple servers)
if (worldName == 'Namalsk') then
{
SC_maxAIcount = 80;
@ -116,17 +172,40 @@ if (worldName == 'Namalsk') then
SC_occupyPublicBusClass = "Exile_Car_LandRover_Urban"; // the ikarus bus gets stuck on Namalsk
};
// Don't alter anything below this point
SC_SurvivorSide = CIVILIAN;
SC_BanditSide = EAST;
SC_liveVehicles = 0;
SC_liveVehiclesArray = [];
SC_liveHelis = 0;
SC_liveHelisArray = [];
SC_liveBoats = 0;
SC_liveBoatsArray = [];
SC_publicBusArray = [];
SC_StopTheBus = false;
if (SC_debug) then
{
SC_extendedLogging = true;
SC_mapMarkers = true;
SC_occupyPlaces = true;
SC_occupyVehicle = true;
SC_occupyMilitary = true;
SC_occupyStatic = true;
SC_occupySky = true;
SC_occupySea = true;
SC_occupyPublicBus = true;
SC_occupyLootCrates = true;
SC_occupyHeliCrashes = true;
};
// Don't alter anything below this point, unless you want your server to explode :)
if(!SC_SurvivorsFriendly) then
{
CIVILIAN setFriend[RESISTANCE,0];
};
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;
SC_liveVehiclesArray = [];
SC_liveHelis = 0;
SC_liveHelisArray = [];
SC_liveBoats = 0;
SC_liveBoatsArray = [];
SC_publicBusArray = [];
publicVariable "SC_liveVehicles";
publicVariable "SC_liveVehiclesArray";
@ -136,6 +215,5 @@ publicVariable "SC_liveBoats";
publicVariable "SC_liveBoatsArray";
publicVariable "SC_numberofLootCrates";
publicVariable "SC_publicBusArray";
publicVariable "SC_StopTheBus";
publicVariable "SC_SurvivorSide";
publicVariable "SC_BanditSide";

View File

@ -2,7 +2,7 @@
//
// Server Occupation script by second_coming
//
SC_occupationVersion = "v20 (15-04-2016)";
SC_occupationVersion = "v24 (18-04-2016)";
//
// http://www.exilemod.com/profile/60-second_coming/
//
@ -31,22 +31,22 @@ SC_occupationVersion = "v20 (15-04-2016)";
call compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\config.sqf";
// Select the log style depending on config settings
SC_fnc_log = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationLog.sqf";
SC_fnc_log = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\occupationLog.sqf";
// EventHandlers for AI reactions & player interactions
SC_fnc_repairVehicle = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\repairVehicle.sqf";
SC_fnc_vehicleDestroyed = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\vehicleDestroyed.sqf";
SC_fnc_reactUnit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\reactUnit.sqf";
SC_fnc_driverKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\driverKilled.sqf";
SC_fnc_airHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\airHit.sqf";
SC_fnc_boatHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\boatHit.sqf";
SC_fnc_getIn = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getIn.sqf";
SC_fnc_refuel = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\refuel.sqf";
SC_fnc_comeUnstuck = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\comeUnstuck.sqf";
SC_fnc_unitMPHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\unitMPHit.sqf";
SC_fnc_unitMPKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\unitMPKilled.sqf";
SC_fnc_getOnBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getOnBus.sqf";
SC_fnc_getOffBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getOffBus.sqf";
SC_fnc_repairVehicle = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\repairVehicle.sqf";
SC_fnc_vehicleDestroyed = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\vehicleDestroyed.sqf";
SC_fnc_reactUnit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\reactUnit.sqf";
SC_fnc_driverKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\driverKilled.sqf";
SC_fnc_airHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\airHit.sqf";
SC_fnc_boatHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\boatHit.sqf";
SC_fnc_getIn = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getIn.sqf";
SC_fnc_refuel = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\refuel.sqf";
SC_fnc_comeUnstuck = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\comeUnstuck.sqf";
SC_fnc_unitMPHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\unitMPHit.sqf";
SC_fnc_unitMPKilled = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\unitMPKilled.sqf";
SC_fnc_getOnBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getOnBus.sqf";
SC_fnc_getOffBus = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\getOffBus.sqf";
_logDetail = "=============================================================================================================";
[_logDetail] call SC_fnc_log;

View File

@ -47,26 +47,48 @@ for "_i" from 1 to SC_numberofHeliCrashes do
_box enableRopeAttach false;
_box setVariable ["permaLoot",true];
_box allowDamage false;
_box addMagazineCargoGlobal ["HandGrenade", (random 2)];
_box addMagazineCargoGlobal ["APERSBoundingMine_Range_Mag", (random 2)];
_box addBackpackCargoGlobal ["B_Parachute", 1 + (random 1)];
_box addItemCargoGlobal ["H_CrewHelmetHeli_B", 1 + (random 1)];
_box addItemCargoGlobal ["U_B_HeliPilotCoveralls", 1 + (random 1)];
_box addItemCargoGlobal ["ItemGPS", (random 1)];
_box addItemCargoGlobal ["Exile_Item_InstaDoc", (random 1)];
_box addItemCargoGlobal ["Exile_Item_PlasticBottleFreshWater", 2 + (random 2)];
_box addItemCargoGlobal ["Exile_Item_EMRE", 2 + (random 2)];
{
_item = _x select 0;
_amount = _x select 1;
_randomAmount = _x select 2;
_amount = _amount + (random _randomAmount);
_itemType = _x call BIS_fnc_itemType;
if((_itemType select 0) == "Weapon") then
{
_box addWeaponCargoGlobal [_item, _amount];
};
if((_itemType select 0) == "Magazine") then
{
_box addMagazineCargoGlobal [_item, _amount];
};
if((_itemType select 0) == "Item") then
{
_box addItemCargoGlobal [_item, _amount];
};
if((_itemType select 0) == "Equipment") then
{
_box addItemCargoGlobal [_item, _amount];
};
if((_itemType select 0) == "Backpack") then
{
_box addBackpackCargoGlobal [_item, _amount];
};
}forEach SC_HeliCrashItems;
// Add weapons with ammo to the Box
_possibleWeapons = ["srifle_DMR_02_camo_F","srifle_DMR_03_woodland_F","srifle_DMR_04_F","srifle_DMR_05_hex_F"];
_amountOfWeapons = 1 + (random 3);
_possibleWeapons = SC_HeliCrashWeapons;
_amountOfWeapons = (SC_HeliCrashWeaponsAmount select 0) + round random (SC_HeliCrashWeaponsAmount select 1);
for "_i" from 1 to _amountOfWeapons do
{
_weaponToAdd = _possibleWeapons call BIS_fnc_selectRandom;
_box addWeaponCargoGlobal [_weaponToAdd,1];
_magazinesToAdd = getArray (configFile >> "CfgWeapons" >> _weaponToAdd >> "magazines");
_magazineAmount = (SC_HeliCrashMagazinesAmount select 0) + round random (SC_HeliCrashMagazinesAmount select 1);
_box addMagazineCargoGlobal [(_magazinesToAdd select 0),round random 5];
};

View File

@ -2,7 +2,7 @@
_logDetail = _this select 0;
if(SC_infiSTAR_log) then
if(SC_infiSTAR_log && !isNil "INFISTARVERSION") then
{
['A3_EXILE_OCCUPATION',_logDetail] call FNC_A3_CUSTOMLOG;
}

View File

@ -80,22 +80,34 @@ for "_i" from 1 to SC_numberofLootCrates do
_box setVariable ["permaLoot",true]; // Crate stays until next server restart
_box allowDamage false; // Stop crates taking damage
_box addItemCargoGlobal ["Exile_Melee_Axe", 1];
_box addItemCargoGlobal ["Exile_Item_GloriousKnakworst", 1 + (random 2)];
_box addItemCargoGlobal ["Exile_Item_PlasticBottleFreshWater", 1 + (random 2)];
_box addItemCargoGlobal ["Exile_Item_Beer", 5 + (random 1)];
_box addItemCargoGlobal ["Exile_Item_Laptop", (random 1)];
_box addItemCargoGlobal ["Exile_Item_BaseCameraKit", (random 2)];
_box addItemCargoGlobal ["Exile_Item_InstaDoc", 1 + (random 1)];
_box addItemCargoGlobal ["Exile_Item_Matches", 1];
_box addItemCargoGlobal ["Exile_Item_CookingPot", 1];
_box addItemCargoGlobal ["Exile_Item_CodeLock", (random 1)];
_box addItemCargoGlobal ["Exile_Item_MetalPole", 1];
_box addItemCargoGlobal ["Exile_Item_LightBulb", 1];
_box addItemCargoGlobal ["Exile_Item_FuelCanisterEmpty", 1];
_box addItemCargoGlobal ["Exile_Item_WoodPlank", 1 + (random 8)];
_box addItemCargoGlobal ["Exile_Item_woodFloorKit", 1 + (random 2)];
_box addItemCargoGlobal ["Exile_Item_WoodWindowKit", 1 + (random 1)];
_box addItemCargoGlobal ["Exile_Item_WoodDoorwayKit", 1 + (random 1)];
_box addItemCargoGlobal ["Exile_Item_WoodFloorPortKit", 1 + (random 2)];
{
_item = _x select 0;
_amount = _x select 1;
_randomAmount = _x select 2;
_amount = _amount + (random _randomAmount);
_itemType = _x call BIS_fnc_itemType;
if((_itemType select 0) == "Weapon") then
{
_box addWeaponCargoGlobal [_item, _amount];
};
if((_itemType select 0) == "Magazine") then
{
_box addMagazineCargoGlobal [_item, _amount];
};
if((_itemType select 0) == "Item") then
{
_box addItemCargoGlobal [_item, _amount];
};
if((_itemType select 0) == "Equipment") then
{
_box addItemCargoGlobal [_item, _amount];
};
if((_itemType select 0) == "Backpack") then
{
_box addBackpackCargoGlobal [_item, _amount];
};
}forEach SC_LootCrateItems;
};

View File

@ -127,7 +127,7 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
}
else
{
if(_nearBanditAI == 0 AND _nearSurvivorAI == 0) then
if(_nearSurvivorAI == 0) then
{
_sideToSpawn = random 100;
if(_sideToSpawn <= SC_SurvivorsChance) then
@ -141,14 +141,7 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
}
else
{
if(_nearSurvivorAI == 0) then
{
_side = "survivor";
}
else
{
_side = "bandit";
};
_side = "bandit";
};
};
@ -192,8 +185,10 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
if(_side == "survivor") then
{
_unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"];
_unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"];
removeUniform _unit;
_unit forceAddUniform "Exile_Uniform_BambiOverall";
_survivorUniform = SC_SurvivorUniforms call BIS_fnc_selectRandom;
_unit forceAddUniform _survivorUniform;
if(SC_debug) then
{
_tag = createVehicle ["Sign_Arrow_Green_F", position _unit, [], 0, "CAN_COLLIDE"];
@ -289,8 +284,10 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
if(_side == "survivor") then
{
_unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"];
_unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"];
removeUniform _unit;
_unit forceAddUniform "Exile_Uniform_BambiOverall";
_survivorUniform = SC_SurvivorUniforms call BIS_fnc_selectRandom;
_unit forceAddUniform _survivorUniform;
if(SC_debug) then
{
_tag = createVehicle ["Sign_Arrow_Green_F", position _unit, [], 0, "CAN_COLLIDE"];
@ -312,28 +309,54 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
_group2 setCombatMode "RED";
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
_markerName = "Occupation Area";
_markerColour = "ColorOrange";
if(SC_mapMarkers) then
{
_marker = createMarker [format ["%1", _spawnPosition],_pos];
deleteMarker format ["%1", _spawnPosition];
_nearBanditAI = { side _x == SC_BanditSide AND _x distance _pos < 500 } count allUnits;
_nearSurvivorAI = { side _x == SC_SurvivorSide AND _x distance _pos < 500 } count allUnits;
if(_nearBanditAI > 0 && _nearSurvivorAI > 0) then
{
_markerName = "Survivors and Bandits";
_markerColour = "ColorOrange";
};
if(_nearBanditAI == 0 && _nearSurvivorAI > 0) then
{
_markerName = "Survivors";
_markerColour = "ColorGreen";
};
if(_nearBanditAI > 0 && _nearSurvivorAI == 0) then
{
_markerName = "Bandits";
_markerColour = "ColorRed";
};
_marker = createMarker [format ["%1", _spawnPosition],_pos];
_marker setMarkerShape "Icon";
_marker setMarkerSize [3,3];
_marker setMarkerType "mil_dot";
_marker setMarkerBrush "Solid";
_marker setMarkerText _markerName;
_marker setMarkerColor _markerColour;
_marker setMarkerAlpha 0.5;
_marker setMarkerColor "ColorOrange";
_marker setMarkerText "Occupied Area";
};
if(_side == "survivor") then
{
_logDetail = format ["[OCCUPATION:Places]:: Spawning %2 survivor AI in at %3 to patrol %1",_locationName,_aiCount,_spawnPosition];
}
else
{
_logDetail = format ["[OCCUPATION:Places]:: Spawning %2 bandit AI in at %3 to patrol %1",_locationName,_aiCount,_spawnPosition];
};
[_logDetail] call SC_fnc_log;
if(_side == "survivor") then
{
_logDetail = format ["[OCCUPATION:Places]:: Spawning %2 survivor AI in at %3 to patrol %1",_locationName,_aiCount,_spawnPosition];
}
else
{
_logDetail = format ["[OCCUPATION:Places]:: Spawning %2 bandit AI in at %3 to patrol %1",_locationName,_aiCount,_spawnPosition];
};
[_logDetail] call SC_fnc_log;
_logDetail = format ["[OCCUPATION:Places]:: %1 Bandits:%2 Survivors:%3 Marker Colour:%4 Marker Name:%5",_locationName,_nearBanditAI,_nearSurvivorAI,_markerColour,_markerName];
[_logDetail] call SC_fnc_log;
};
_okToSpawn = false;
};

View File

@ -36,6 +36,7 @@ busDriver setCaptive true;
_publicBus = createVehicle [SC_occupyPublicBusClass, _spawnLocation, [], 0, "CAN_COLLIDE"];
SC_publicBusArray = SC_publicBusArray + [_publicBus];
_publicBus setVariable ["SC_assignedDriver", busDriver,true];
_publicBus setVariable ["SC_publicBus", true,true];
_publicBus setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true];
_publicBus addEventHandler ["getin", "_this call SC_fnc_getOnBus;"];
_publicBus addEventHandler ["getout", "_this call SC_fnc_getOffBus;"];
@ -116,15 +117,6 @@ while {true} do
busDriver enableAI "MOVE";
if(!Alive busDriver) exitWith {};
};
if(SC_StopTheBus) then
{
uiSleep 0.5;
_publicBus setFuel 0;
busDriver disableAI "MOVE";
uiSleep 5;
SC_StopTheBus = false;
};
uiSleep 5;
};

View File

@ -71,6 +71,8 @@ for "_i" from 1 to _vehiclesToSpawn do
sleep 0.2;
_group addVehicle _vehicle;
_amountOfCrew = 0;
_unitPlaced = false;
// Calculate the crew requried
_vehicleRoles = (typeOf _vehicle) call bis_fnc_vehicleRoles;
@ -80,7 +82,8 @@ for "_i" from 1 to _vehiclesToSpawn do
_vehicleSeat = _x select 1;
if(_vehicleRole == "Driver") then
{
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit assignAsDriver _vehicle;
_unit moveInDriver _vehicle;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
@ -88,19 +91,22 @@ for "_i" from 1 to _vehiclesToSpawn do
};
if(_vehicleRole == "Turret") then
{
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit moveInTurret [_vehicle, _vehicleSeat];
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unitPlaced = true;
};
if(_vehicleRole == "CARGO") then
if(_vehicleRole == "CARGO" && _amountOfCrew <= SC_maximumCrewAmount) then
{
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit assignAsCargo _vehicle;
_unit moveInCargo _vehicle;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unitPlaced = true;
};
if(SC_extendedLogging && _unitPlaced) then
{
_logDetail = format['[OCCUPATION:Sky] %1 added to %2',_vehicleRole,_vehicle];

View File

@ -90,39 +90,47 @@ for "_i" from 1 to _vehiclesToSpawn do
_vehicle setVariable ["ExileIsLocked", 0, true];
_vehicle action ["LightOn", _vehicle];
_amountOfCrew = 0;
_unitPlaced = false;
// Calculate the crew requried
_vehicleRoles = (typeOf _vehicle) call bis_fnc_vehicleRoles;
{
_vehicleRole = _x select 0;
_unitPlaced = false;
_vehicleRole = _x select 0;
_vehicleSeat = _x select 1;
if(_vehicleRole == "Driver") then
{
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit assignAsDriver _vehicle;
_unit moveInDriver _vehicle;
//_vehicle lockDriver true;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
removeBackpackGlobal _unit;
_unit addBackpackGlobal "B_Parachute";
_unitPlaced = true;
};
if(_vehicleRole == "Turret") then
{
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit moveInTurret [_vehicle, _vehicleSeat];
_unit setVariable ["DMS_AssignedVeh",_vehicle];
removeBackpackGlobal _unit;
_unit addBackpackGlobal "B_Parachute";
_unitPlaced = true;
};
if(_vehicleRole == "CARGO") then
if(_vehicleRole == "CARGO" && _amountOfCrew <= SC_maximumCrewAmount) then
{
_unit = [_group,_spawnLocation,"assault","random","bandit","Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit assignAsCargo _vehicle;
_unit moveInCargo _vehicle;
_unit setVariable ["DMS_AssignedVeh",_vehicle];
removeBackpackGlobal _unit;
_unit addBackpackGlobal "B_Parachute";
_unitPlaced = true;
};
if(SC_extendedLogging) then
{
@ -137,13 +145,11 @@ for "_i" from 1 to _vehiclesToSpawn do
[_unit] joinSilent _group;
}foreach units _group;
if(SC_infiSTAR_log) then
if(SC_extendedLogging && _unitPlaced) then
{
_logDetail = format['[OCCUPATION:Sky] %1 spawned @ %2',_VehicleClassToUse,_spawnLocation];
[_logDetail] call SC_fnc_log;
};
clearMagazineCargoGlobal _vehicle;
clearWeaponCargoGlobal _vehicle;

View File

@ -149,6 +149,9 @@ if(_vehiclesToSpawn >= 1) then
_vehicle limitSpeed 60;
_vehicle action ["LightOn", _vehicle];
_amountOfCrew = 0;
_unitPlaced = false;
// Calculate the crew requried
_vehicleRoles = (typeOf _vehicle) call bis_fnc_vehicleRoles;
{
@ -158,11 +161,16 @@ if(_vehiclesToSpawn >= 1) then
if(_vehicleRole == "Driver") then
{
_unit = [_group,_spawnLocation,"assault","random",_side,"Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
_unit removeAllMPEventHandlers "mphit";
_unit removeAllMPEventHandlers "mpkilled";
_unit disableAI "FSM";
if(_side == "survivor") then
{
removeUniform _unit;
_unit forceAddUniform "Exile_Uniform_BambiOverall";
sleep 0.1;
_survivorUniform = SC_SurvivorUniforms call BIS_fnc_selectRandom;
_unit forceAddUniform _survivorUniform;
};
_unit disableAI "TARGET";
_unit disableAI "AUTOTARGET";
@ -186,27 +194,35 @@ if(_vehiclesToSpawn >= 1) then
_vehicle addMPEventHandler ["mpkilled", "_this call SC_fnc_vehicleDestroyed;"];
_vehicle addMPEventHandler ["mphit", "_this call SC_fnc_repairVehicle;"];
};
if(_vehicleRole == "Turret") then
if(_vehicleRole == "Turret" && _amountOfCrew <= SC_maximumCrewAmount) then
{
_unit = [_group,_spawnLocation,"assault","random",_side,"Vehicle"] call DMS_fnc_SpawnAISoldier;
_unit = [_group,_spawnLocation,"assault","random",_side,"Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
if(_side == "survivor") then
{
_unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"];
_unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"];
removeUniform _unit;
_unit forceAddUniform "Exile_Uniform_BambiOverall";
sleep 0.1;
_survivorUniform = SC_SurvivorUniforms call BIS_fnc_selectRandom;
_unit forceAddUniform _survivorUniform;
};
_unit moveInTurret [_vehicle, _vehicleSeat];
_unit setVariable ["DMS_AssignedVeh",_vehicle];
_unitPlaced = true;
};
if(_vehicleRole == "CARGO") then
if(_vehicleRole == "CARGO" && _amountOfCrew <= SC_maximumCrewAmount) then
{
_unit = [_group,_spawnLocation,"assault","random",_side,"Vehicle"] call DMS_fnc_SpawnAISoldier;
_unit = [_group,_spawnLocation,"assault","random",_side,"Vehicle"] call DMS_fnc_SpawnAISoldier;
_amountOfCrew = _amountOfCrew + 1;
if(_side == "survivor") then
{
_unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"];
_unit addMPEventHandler ["mpkilled", "_this call SC_fnc_unitMPKilled;"];
removeUniform _unit;
_unit forceAddUniform "Exile_Uniform_BambiOverall";
sleep 0.1;
_survivorUniform = SC_SurvivorUniforms call BIS_fnc_selectRandom;
_unit forceAddUniform _survivorUniform;
};
_unit assignAsCargo _vehicle;
_unit moveInCargo _vehicle;

View File

@ -8,10 +8,9 @@ if(SC_extendedLogging) then
};
_deadDriver = _this select 0;
_deadDriver removeAllMPEventHandlers "mpkilled";
//_deadDriver removeAllMPEventHandlers "mpkilled";
_vehicle = _deadDriver getVariable "SC_drivenVehicle";
if(SC_debug) then
{
{ detach _x; deleteVehicle _x; } forEach attachedObjects _deadDriver;
@ -48,6 +47,7 @@ if(count units _group > 0) then
_driver setVariable ["SC_drivenVehicle", _vehicle,true];
_vehicle setVariable ["SC_assignedDriver", _driver,true];
_vehicle addMPEventHandler ["mphit", "_this call SC_fnc_repairVehicle;"];
_driver removeAllMPEventHandlers "mpkilled";
_driver addMPEventHandler ["mpkilled", "_this call SC_fnc_driverKilled;"];
if(SC_debug) then

View File

@ -3,7 +3,9 @@
_bus = _this select 0;
_unit = _this select 2;
if(isPlayer _unit) then
{
_bus removeAction SC_bustop;
};
_bus setFuel 0;
_busDriver = driver _bus;
_busDriver disableAI "MOVE";
_bus animateDoor ["Doors_1", 1];
_bus animateDoor ["Doors_2", 1];
_bus animateDoor ["Doors_3", 1];

View File

@ -3,9 +3,3 @@
_bus = _this select 0;
_unit = _this select 2;
if(isPlayer _unit) then
{
hint "You got on the bus";
SC_bustop = _bus addAction ["Stop the bus", { SC_StopTheBus = true } ];
};

View File

@ -4,7 +4,6 @@ _killer = _this select 1;
// remove all eventhandlers from the dead unit
_unit removeAllMPEventHandlers "mphit";
_unit removeAllMPEventHandlers "mpkilled";
if(SC_debug) then
{