forked from SnarkIndustries/DZAI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request SnarkIndustries#11 from dayzai/Experimental-2.2.1
Update DZAI to 2.2.1
- Loading branch information
Showing
65 changed files
with
2,237 additions
and
999 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,37 @@ | ||
private ["_vehicle","_unitGroup"]; | ||
private ["_victim","_vehicle","_unitGroup","_groupIsEmpty"]; | ||
|
||
_unitGroup = _this select 0; | ||
_victim = _this select 0; | ||
_unitGroup = _this select 1; | ||
_groupIsEmpty = _this select 2; | ||
|
||
_vehicle = _unitGroup getVariable ["assignedVehicle",objNull]; | ||
if (_vehicle isKindOf "LandVehicle") then { | ||
{_vehicle removeAllEventHandlers _x} count ["HandleDamage","Killed"]; | ||
[_unitGroup,_vehicle] call DZAI_respawnAIVehicle; | ||
if (DZAI_debugLevel > 0) then {diag_log format ["DZAI Debug: AI vehicle patrol destroyed, adding vehicle %1 to cleanup queue.",(typeOf _vehicle)];}; | ||
if (_groupIsEmpty) then { | ||
if (_vehicle isKindOf "LandVehicle") then { | ||
{_vehicle removeAllEventHandlers _x} count ["HandleDamage","Killed"]; | ||
[_unitGroup,_vehicle] call DZAI_respawnAIVehicle; | ||
if (DZAI_debugLevel > 0) then {diag_log format ["DZAI Debug: AI vehicle patrol destroyed, adding vehicle %1 to cleanup queue.",(typeOf _vehicle)];}; | ||
}; | ||
_unitGroup setVariable ["GroupSize",-1]; | ||
} else { | ||
if (_victim getVariable ["isDriver",false]) then { | ||
_groupUnits = (units _unitGroup) - [_victim]; | ||
_newDriver = _groupUnits call BIS_fnc_selectRandom2; //Find another unit to serve as driver | ||
if (!isNil "_newDriver") then { | ||
_nul = [_newDriver,_vehicle] spawn { | ||
private ["_newDriver","_vehicle"]; | ||
_newDriver = _this select 0; | ||
_vehicle = _this select 1; | ||
unassignVehicle _newDriver; | ||
_newDriver assignAsDriver _vehicle; | ||
if (_newDriver in _vehicle) then { | ||
_newDriver moveInDriver _vehicle; | ||
}; | ||
[_newDriver] orderGetIn true; | ||
_newDriver setVariable ["isDriver",true]; | ||
if (DZAI_debugLevel > 0) then {diag_log format ["DZAI Debug: Replaced driver unit for group %1 vehicle %2.",(group _newDriver),(typeOf _vehicle)];}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
_unitGroup setVariable ["GroupSize",-1]; | ||
|
||
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
private ["_victim","_killer","_groupIsEmpty","_trigger","_unitGroup"]; | ||
|
||
_victim = _this select 0; | ||
_killer = _this select 1; | ||
_unitGroup = _this select 2; | ||
_groupIsEmpty = _this select 3; | ||
|
||
_trigger = _unitGroup getVariable ["trigger",DZAI_defaultTrigger]; | ||
if (_groupIsEmpty) then { | ||
[_trigger,true] spawn fnc_despawnBandits_random; //force despawning even if players are present in trigger area. | ||
}; | ||
|
||
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
private ["_maxRandomSpawns","_debugMarkers","_triggerArea","_attempts","_trigPos","_trigger","_markername","_marker"]; | ||
|
||
_maxRandomSpawns = _this; | ||
|
||
_debugMarkers = ((!isNil "DZAI_debugMarkersEnabled") && {DZAI_debugMarkersEnabled}); | ||
_triggerArea = 600; | ||
|
||
//waitUntil {sleep 1; !isNil "DZAI_locations_ready"}; | ||
|
||
if (DZAI_debugLevel > 0) then {diag_log format ["DZAI Debug: Attempting to place %1 random spawns on the map...",_maxRandomSpawns];}; | ||
|
||
for "_i" from 1 to _maxRandomSpawns do { | ||
_attempts = 0; | ||
_keepSearching = true; | ||
_trigPos = [0,0,0]; | ||
while { | ||
_keepSearching | ||
} do { | ||
_trigPos = ["DZAI_centerMarker",false,DZAI_randAreaBlacklist] call SHK_pos; | ||
_attempts = _attempts + 1; | ||
_keepSearching = ((count ((nearestLocations [_trigPos, ["Strategic"], 650])) > 0) && {_attempts < 3}); | ||
if (_keepSearching) then {uiSleep 0.25}; | ||
}; | ||
|
||
if (_attempts < 3) then { | ||
_trigger = createTrigger ["EmptyDetector",_trigPos]; | ||
|
||
_location = createLocation ["Strategic",(getPosASL _trigger),600,600]; //Create temporary dynamic spawn blacklist area | ||
_trigger setVariable ["triggerLocation",_location]; | ||
[_trigger,"DZAI_randTriggerArray"] call DZAI_updateSpawnCount; | ||
|
||
_trigger setTriggerArea [_triggerArea, _triggerArea, 0, false]; | ||
_trigger setTriggerActivation ["ANY", "PRESENT", true]; | ||
_trigger setTriggerTimeout [5, 5, 5, true]; | ||
_trigger setTriggerStatements ["{isPlayer _x} count thisList > 0;","0 = [300,thisTrigger,thisList] call fnc_spawnBandits_random;", "[thisTrigger] spawn fnc_despawnBandits_random;"]; | ||
if (_debugMarkers) then { | ||
_markername = str(_trigger); | ||
_marker = createMarker[_markername,_trigPos]; | ||
_marker setMarkerShape "ELLIPSE"; | ||
_marker setMarkerType "Flag"; | ||
_marker setMarkerBrush "SOLID"; | ||
_marker setMarkerSize [_triggerArea, _triggerArea]; | ||
_marker setMarkerColor "ColorYellow"; | ||
_marker setMarkerAlpha 0.6; | ||
DZAI_mapMarkerArray set [(count DZAI_mapMarkerArray),_marker]; | ||
}; | ||
_trigger setTriggerText format ["Random Spawn at %1",(mapGridPosition _trigger)]; | ||
_trigger setVariable ["timestamp",diag_tickTime]; | ||
if (DZAI_debugLevel > 0) then {diag_log format["DZAI Debug: Random spawn %1 of %2 placed at %3 (Retries: %4).",_i,_maxRandomSpawns,_trigPos,_attempts];}; | ||
//DZAI_randTriggerArray set [(count DZAI_randTriggerArray),_trigger]; | ||
} else { | ||
if (DZAI_debugLevel > 0) then {diag_log format["DZAI Debug: Could not find suitable location to place random spawn %1 of %2.",_i,_maxRandomSpawns];}; | ||
}; | ||
uiSleep 3; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
private["_trigger","_triggerLocation"]; | ||
_trigger = _this; | ||
|
||
[_trigger,"DZAI_randTriggerArray"] call DZAI_updateSpawnCount; | ||
if ((!isNil "DZAI_debugMarkersEnabled") && {DZAI_debugMarkersEnabled}) then {deleteMarker (str _trigger)}; | ||
|
||
_triggerLocation = _trigger getVariable "triggerLocation"; | ||
deleteLocation _triggerLocation; | ||
//_triggerLocation setVariable ["deletetime",(diag_tickTime + 900)]; | ||
//DZAI_tempBlacklist set [(count DZAI_tempBlacklist),_triggerLocation]; | ||
|
||
deleteVehicle _trigger; | ||
|
||
false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.