v18 fixes & tweaks
This commit is contained in:
parent
8f0ef587a8
commit
6d1e98ab6c
@ -120,8 +120,6 @@ if (worldName == 'Namalsk') then
|
|||||||
SC_occupyPublicBusClass = "Exile_Car_LandRover_Urban"; // the ikarus bus gets stuck on Namalsk
|
SC_occupyPublicBusClass = "Exile_Car_LandRover_Urban"; // the ikarus bus gets stuck on Namalsk
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Don't alter anything below this point
|
// Don't alter anything below this point
|
||||||
SC_liveVehicles = 0;
|
SC_liveVehicles = 0;
|
||||||
SC_liveVehiclesArray = [];
|
SC_liveVehiclesArray = [];
|
||||||
@ -129,7 +127,8 @@ SC_liveHelis = 0;
|
|||||||
SC_liveHelisArray = [];
|
SC_liveHelisArray = [];
|
||||||
SC_liveBoats = 0;
|
SC_liveBoats = 0;
|
||||||
SC_liveBoatsArray = [];
|
SC_liveBoatsArray = [];
|
||||||
SC_publicBusArray = [];
|
SC_publicBusArray = [];
|
||||||
|
SC_StopTheBus = false;
|
||||||
|
|
||||||
publicVariable "SC_liveVehicles";
|
publicVariable "SC_liveVehicles";
|
||||||
publicVariable "SC_liveVehiclesArray";
|
publicVariable "SC_liveVehiclesArray";
|
||||||
@ -138,4 +137,5 @@ publicVariable "SC_liveHelisArray";
|
|||||||
publicVariable "SC_liveBoats";
|
publicVariable "SC_liveBoats";
|
||||||
publicVariable "SC_liveBoatsArray";
|
publicVariable "SC_liveBoatsArray";
|
||||||
publicVariable "SC_numberofLootCrates";
|
publicVariable "SC_numberofLootCrates";
|
||||||
publicVariable "SC_publicBusArray";
|
publicVariable "SC_publicBusArray";
|
||||||
|
publicVariable "SC_StopTheBus";
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Server Occupation script by second_coming
|
// Server Occupation script by second_coming
|
||||||
//
|
//
|
||||||
SC_occupationVersion = "v16 (14-04-2016)";
|
SC_occupationVersion = "v18 (14-04-2016)";
|
||||||
//
|
//
|
||||||
// http://www.exilemod.com/profile/60-second_coming/
|
// http://www.exilemod.com/profile/60-second_coming/
|
||||||
//
|
//
|
||||||
@ -44,6 +44,8 @@ SC_occupationVersion = "v16 (14-04-2016)";
|
|||||||
SC_fnc_refuel = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\refuel.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_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_unitMPHit = compile preprocessFileLineNumbers "\x\addons\a3_exile_occupation\scripts\reactions\unitMPHit.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 = "=============================================================================================================";
|
||||||
[_logDetail] call SC_fnc_log;
|
[_logDetail] call SC_fnc_log;
|
||||||
|
@ -121,12 +121,21 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
|
|||||||
|
|
||||||
|
|
||||||
// Don't spawn additional AI if there are already AI in range
|
// Don't spawn additional AI if there are already AI in range
|
||||||
_aiNear = count(_pos nearEntities ["O_recon_F", 500]);
|
|
||||||
if(_aiNear > 0) then
|
_nearEastAI = { side _x == EAST AND _x distance _pos < 500 } count allUnits;
|
||||||
|
_nearWestAI = { side _x == WEST AND _x distance _pos < 500 } count allUnits;
|
||||||
|
|
||||||
|
if(_nearEastAI > 0 AND _nearWestAI > 0) then
|
||||||
{
|
{
|
||||||
_nearEastAI = { side _x == EAST AND _x distance _pos < 500 } count allUnits;
|
_okToSpawn = false;
|
||||||
_nearWestAI = { side _x == WEST AND _x distance _pos < 500 } count allUnits;
|
if(SC_extendedLogging) then
|
||||||
|
{
|
||||||
|
_logDetail = format ["[OCCUPATION:Places]:: %1 already has %2 active AI patrolling",_locationName,_aiNear];
|
||||||
|
[_logDetail] call SC_fnc_log;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if(_nearEastAI == 0 AND _nearWestAI == 0) then
|
if(_nearEastAI == 0 AND _nearWestAI == 0) then
|
||||||
{
|
{
|
||||||
_sideToSpawn = random 100;
|
_sideToSpawn = random 100;
|
||||||
@ -138,27 +147,20 @@ _locations = (nearestLocations [_spawnCenter, ["NameVillage","NameCity", "NameCi
|
|||||||
{
|
{
|
||||||
_side = "bandit";
|
_side = "bandit";
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
if(_nearEastAI > 0 AND _nearWestAI == 0) then
|
else
|
||||||
{
|
{
|
||||||
_side = "survivor";
|
if(_nearWestAI == 0) then
|
||||||
};
|
|
||||||
if(_nearEastAI == 0 AND _nearWestAI > 0) then
|
|
||||||
{
|
|
||||||
_side = "bandit";
|
|
||||||
};
|
|
||||||
if(_nearEastAI > 0 AND _nearWestAI > 0) then
|
|
||||||
{
|
|
||||||
_okToSpawn = false;
|
|
||||||
if(SC_extendedLogging) then
|
|
||||||
{
|
{
|
||||||
_logDetail = format ["[OCCUPATION:Places]:: %1 already has %2 active AI patrolling",_locationName,_aiNear];
|
_side = "survivor";
|
||||||
[_logDetail] call SC_fnc_log;
|
}
|
||||||
};
|
else
|
||||||
};
|
{
|
||||||
|
_side = "bandit";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if(_okToSpawn) then
|
if(_okToSpawn) then
|
||||||
{
|
{
|
||||||
if(!SC_occupyPlacesSurvivors) then { _side = "bandit"; };
|
if(!SC_occupyPlacesSurvivors) then { _side = "bandit"; };
|
||||||
|
@ -31,7 +31,8 @@ _publicBus = createVehicle [SC_occupyPublicBusClass, _spawnLocation, [], 0, "CAN
|
|||||||
SC_publicBusArray = SC_publicBusArray + [_publicBus];
|
SC_publicBusArray = SC_publicBusArray + [_publicBus];
|
||||||
_publicBus setVariable ["SC_assignedDriver", busDriver,true];
|
_publicBus setVariable ["SC_assignedDriver", busDriver,true];
|
||||||
_publicBus setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true];
|
_publicBus setVariable ["SC_vehicleSpawnLocation", _spawnLocation,true];
|
||||||
_publicBus addEventHandler ["getin", "_this call SC_fnc_getInBus;"];
|
_publicBus addEventHandler ["getin", "_this call SC_fnc_getOnBus;"];
|
||||||
|
_publicBus addEventHandler ["getout", "_this call SC_fnc_getOffBus;"];
|
||||||
|
|
||||||
_group addVehicle _publicBus;
|
_group addVehicle _publicBus;
|
||||||
clearBackpackCargoGlobal _publicBus;
|
clearBackpackCargoGlobal _publicBus;
|
||||||
@ -102,17 +103,16 @@ while {true} do
|
|||||||
busDriver enableAI "MOVE";
|
busDriver enableAI "MOVE";
|
||||||
if(!Alive busDriver) exitWith {};
|
if(!Alive busDriver) exitWith {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(SC_StopTheBus) then
|
||||||
|
{
|
||||||
|
uiSleep 0.5;
|
||||||
|
_publicBus setFuel 0;
|
||||||
|
busDriver disableAI "MOVE";
|
||||||
|
uiSleep 5;
|
||||||
|
SC_StopTheBus = false;
|
||||||
|
};
|
||||||
|
uiSleep 5;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
// Check for nearby missions
|
|
||||||
_missionPos = missionNamespace getVariable [format ["%1_pos",_x], []];
|
|
||||||
_missionDistance = _missionPos distance2D _pos;
|
|
||||||
if (_missionDistance<=500) then
|
|
||||||
{
|
|
||||||
// DMS Mission in range
|
|
||||||
_logDetail = format['[OCCUPATION:publicBus] Vehicle near DMS Mission @ %1 (%2 metres away)',_missionPos,(_missionPos distance2D _pos)];
|
|
||||||
[_logDetail] call SC_fnc_log;
|
|
||||||
};
|
|
||||||
} forEach allMapMarkers;
|
|
9
scripts/reactions/getOffBus.sqf
Normal file
9
scripts/reactions/getOffBus.sqf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// Triggered if a player gets off the public bus
|
||||||
|
// removes the addaction to stop the bus
|
||||||
|
_bus = _this select 0;
|
||||||
|
_unit = _this select 2;
|
||||||
|
|
||||||
|
if(isPlayer _unit) then
|
||||||
|
{
|
||||||
|
_unit removeAction _bustop;
|
||||||
|
};
|
10
scripts/reactions/getOnBus.sqf
Normal file
10
scripts/reactions/getOnBus.sqf
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// Triggered if a player gets on the public bus
|
||||||
|
// adds an addaction to stop the bus
|
||||||
|
_bus = _this select 0;
|
||||||
|
_unit = _this select 2;
|
||||||
|
|
||||||
|
if(isPlayer _unit) then
|
||||||
|
{
|
||||||
|
_bustop = _unit addAction ["Stop the bus", { SC_StopTheBus = true } ];
|
||||||
|
};
|
||||||
|
|
@ -10,8 +10,10 @@ if (side _aggressor == RESISTANCE) then
|
|||||||
{
|
{
|
||||||
// Make victim and his group aggressive to their attacker
|
// Make victim and his group aggressive to their attacker
|
||||||
_group = group _unit;
|
_group = group _unit;
|
||||||
|
_unit addRating -999999;
|
||||||
_group reveal [_aggressor, 2.5];
|
_group reveal [_aggressor, 2.5];
|
||||||
_group move (position _aggressor);
|
_group move (position _aggressor);
|
||||||
|
diag_log format["::testing:: unit %1 damaged by %2",_unit,_aggressor];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user