Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#642) unscheduled wave logic #648

Draft
wants to merge 134 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
c408c2b
(#642): changed references to BLWK_mustKillArray macro
Ansible2 Jul 8, 2023
007da6b
(#000): adjusted some header comments
Ansible2 Jul 8, 2023
f910b0d
(#000): added sleep time while awaiting player selection of custom pl…
Ansible2 Jul 8, 2023
4657123
(#642): renamed BLWK_fnc_addToMustKillArrray -> BLWK_fnc_addToMustKil…
Ansible2 Jul 8, 2023
dd974b7
(#0): header comment change
Ansible2 Jul 8, 2023
53fd4bb
(#642): implemented BLWK_fnc_getMustKillList and renamed BLWK_fnc_cle…
Ansible2 Jul 8, 2023
3ebcf58
(#642): removed old list clearing from start wave function
Ansible2 Jul 8, 2023
2cc9993
(#642): made adjustments to loot spawn and made initial call unscheduled
Ansible2 Jul 8, 2023
59a1040
(#642): added guard against undefined array for BLWK_lootMarkers
Ansible2 Jul 8, 2023
c8c6a1c
(#642): simplified BLWK_fnc_cleanUpTheDead
Ansible2 Jul 8, 2023
a885842
(#642): renamed BLWK_fnc_decideWaveType -> BLWK_fnc_spawnWaveEnemies
Ansible2 Jul 8, 2023
bd918ab
(#642): added KISKA_fnc_selectRandom
Ansible2 Jul 8, 2023
8fbce5e
(#642): added notifyAdminsOrHostOfError
Ansible2 Jul 8, 2023
9cd336a
(#642): updated description for BLWK_fnc_notifyAdminsOrHostOfError
Ansible2 Jul 8, 2023
cd622fe
(#642): convert indents
Ansible2 Jul 8, 2023
020d5fb
(#642): started refactor of queue
Ansible2 Jul 9, 2023
9df1d71
(#642): started on refactor of wave creation
Ansible2 Jul 9, 2023
10bb815
(#642): started on refactor of standard wave
Ansible2 Jul 9, 2023
9a7b17e
(#642): WIP implementing refactor for wave spawns
Ansible2 Jul 9, 2023
196c697
(#642): renamed event functions for hit and killed enemies
Ansible2 Jul 9, 2023
1ca3467
(#642): removed a number of functions
Ansible2 Jul 9, 2023
3bf5d6e
(#642): updated spawn queue functions
Ansible2 Jul 9, 2023
fabfe1d
(#642): added standardWave_onManCreated
Ansible2 Jul 9, 2023
057d8af
(#642): moved wave create function
Ansible2 Jul 9, 2023
74424ce
(#642): added spawnQueue_get function
Ansible2 Jul 9, 2023
96ca5ea
(#642): used BLWK_fnc_spawnQueue_get in add function
Ansible2 Jul 9, 2023
0a9c46c
(#000): removed old todo
Ansible2 Jul 9, 2023
8a1f30a
(#642): added and removed todos
Ansible2 Jul 9, 2023
10c895a
(#642): WIP setting up on init for wave
Ansible2 Jul 9, 2023
2689be7
(#642): replaced several old standard wave functions
Ansible2 Jul 9, 2023
e654f9d
(#642): fixed function definiton and removed olf wave lib
Ansible2 Jul 9, 2023
36c8e82
(#642): removed old comments
Ansible2 Jul 9, 2023
a2e2e8f
(#642): fixed incorrect function name
Ansible2 Jul 9, 2023
750f68a
(#642): updated wave config documentation
Ansible2 Jul 9, 2023
69247cd
(#642): added config event call for when a man is created
Ansible2 Jul 9, 2023
cdba971
(#642): updated wave cleared logic and renamed
Ansible2 Jul 9, 2023
f71dc02
(#642): added BLWK_fnc_spawnQueue_unitKilled
Ansible2 Jul 10, 2023
2dda426
(#642): adjusted BLWK_fnc_standardWave_vehicles to use dynamic crew c…
Ansible2 Jul 10, 2023
f288ed6
(#642): updated extraction script with new wave creation
Ansible2 Jul 10, 2023
332b917
(#642): added defector wave config and fixed function call for standa…
Ansible2 Jul 10, 2023
b2afc53
(#642): reconfigured paratrooper wave
Ansible2 Jul 10, 2023
53da81f
(#642): replaced suicide wave with new wave system
Ansible2 Jul 10, 2023
92803b9
(#642): replaced BLWK_fnc_endWave
Ansible2 Jul 11, 2023
5df7e30
(#642): added wave condition check to BLWK_fnc_getConfigForWave
Ansible2 Jul 11, 2023
a5e9909
(#642): updated overrun wave to newer system
Ansible2 Jul 11, 2023
f94ad2d
(#642): implemented BLWK_fnc_waves_end
Ansible2 Jul 11, 2023
a29879e
(#642): fixed network oversite on overrun wave
Ansible2 Jul 11, 2023
c8c70b2
(#642): updated civilian wave to new system
Ansible2 Jul 11, 2023
ce26b99
(#642): reimplemented drone wave for new system
Ansible2 Jul 11, 2023
cd531df
(#642): updated helicopter wave to new standard
Ansible2 Jul 12, 2023
f5339cc
(#642): removed old helicopter wave lib
Ansible2 Jul 12, 2023
b400613
(#642): updated mortar wave to new standard
Ansible2 Jul 12, 2023
3b0d662
(#642): renamed blwk_fnc_startWave to blwk_fnc_waves_start
Ansible2 Jul 12, 2023
efc8302
(#642): fixed some invalid file paths for funcitons
Ansible2 Jul 12, 2023
db72539
(#642): adjusted location of addVehicleKilledHandler
Ansible2 Jul 12, 2023
ad1b0f9
(#642): fixed incorrect file path in functions.hpp and header comment
Ansible2 Jul 12, 2023
30ddab1
(#642): fixed all compilation issues
Ansible2 Jul 12, 2023
5d13827
(#642): Fixed syntax error
Ansible2 Jul 14, 2023
6274645
(#642): Fixed logic error with standardWave man class generation and …
Ansible2 Jul 14, 2023
2450384
(#642): fixed onManCreated not being called
Ansible2 Jul 14, 2023
6729523
(#642): fixed incorrect function call when unit is killed
Ansible2 Jul 14, 2023
f58e974
(#642): fixed error for default config in getFunctionFromConfig
Ansible2 Jul 14, 2023
5d681fa
(#642): fixed undefined stalker macro on wave end
Ansible2 Jul 14, 2023
277480a
(#642): added todo
Ansible2 Jul 14, 2023
c5ed0c4
(#642): fixed premature wave end when deleting units from old wave
Ansible2 Jul 15, 2023
7cc772e
(#642): adjusted formatting and language of comments
Ansible2 Jul 15, 2023
e1de870
(#642): format changes
Ansible2 Jul 15, 2023
d83a58a
(#642): refactored for limited queue groups and multiple units in group
Ansible2 Jul 16, 2023
ba60b6d
(#642): fixed incorrect args passed to function
Ansible2 Jul 16, 2023
6a6c47b
(#642): fixed syntax errors that causes units not to spawn
Ansible2 Jul 16, 2023
890c696
(#642): fixed groups not being deleted after last unit is deleted
Ansible2 Jul 16, 2023
413408f
(#642): WIP refactoring stalking for new group system
Ansible2 Jul 16, 2023
45c7307
(#642): refactored stalker system
Ansible2 Jul 16, 2023
5e0d99a
(#642): updated stalker systems interaction with other systems
Ansible2 Jul 16, 2023
d7ebe1f
(#642): fixed syntax errors with new stalker system
Ansible2 Jul 16, 2023
a7d8ab3
(#642): added missing function definitions and fixed syntax error
Ansible2 Jul 16, 2023
d138b9d
(#642): tweaked stalking system and fixed init bug for spawning units
Ansible2 Jul 17, 2023
3725679
(#642): fixed stalkers not behaving correctly during aircraft gunner
Ansible2 Jul 18, 2023
0d326ec
(#642): fixed paratrooper wave errors
Ansible2 Jul 18, 2023
6ea4b47
(#642): fixed errors with player respawn and managed runs
Ansible2 Jul 18, 2023
218b91b
Updated error message output for KISKA_fnc_setCrew
Ansible2 Jul 19, 2023
4019911
(#642): fixed vehicles not spawning on vehicle wave
Ansible2 Jul 19, 2023
e9425d9
(#642): fixed drone hits giving points to host
Ansible2 Jul 19, 2023
75264cd
(#642): fixed drone wave error
Ansible2 Jul 19, 2023
f328a51
(#642): fixed supply drop aircraft flying away during drone waves
Ansible2 Jul 19, 2023
a8fc016
(#642): fixed being able to call multiple wave ends
Ansible2 Jul 19, 2023
9b9bf44
(#642): fixed drone waves not ending when drones are deleted or kille…
Ansible2 Jul 19, 2023
e0bdc49
(#642): cleaned up old drone wave functions
Ansible2 Jul 19, 2023
5eef27e
(#642): allowed BLWK_fnc_addToMustKillList to take object as first arg
Ansible2 Jul 19, 2023
8752bc3
(#642): fixed params definition for BLWK_fnc_addToMustKillList
Ansible2 Jul 19, 2023
9d7e9d1
(#642): fixed logic error in BLWK_fnc_waves_getFunctionFromConfig
Ansible2 Jul 19, 2023
9b43d65
(#642): fixed a number of spawns over water and implemented new logic…
Ansible2 Jul 20, 2023
be2ad13
(#642): fixed syntax error for mortar wave
Ansible2 Jul 20, 2023
f7c57f9
(#642): implemented new helicopter gunner script to fix auto delete i…
Ansible2 Jul 22, 2023
551fc0c
(#642): fixed incorrect variable name in BLWK_fnc_overrunWave_onWaveInit
Ansible2 Jul 22, 2023
e303571
(#642): fixed all wave types having a weight of zero causing undefine…
Ansible2 Jul 22, 2023
bf9265e
(#642): started on suicide wave testing, added todo for issue
Ansible2 Jul 22, 2023
97d7461
(#642): fixed deleted event running when sucide bombers were killed
Ansible2 Jul 22, 2023
2342d69
(#642): fixed stalker and drone eventhandler removals
Ansible2 Jul 22, 2023
a9c0e81
(#642): updated KISKA_fnc_getPosRelativeSurface to latest
Ansible2 Jul 22, 2023
ea3c613
(#642): added turret engagment loop to extraction helicopters
Ansible2 Jul 22, 2023
9a4cb4a
(#642): updated stalking script
Ansible2 Jul 29, 2023
b533e47
(#642): removed todo
Ansible2 Jul 29, 2023
1748e6a
(#642): removed outdated pathing functions and updted collision function
Ansible2 Jul 29, 2023
4ab3002
(#642): fixed stalking only working on a single player
Ansible2 Aug 6, 2023
7dcc19e
(#642): adjusted behaviour of aircraft gunners to careless in order t…
Ansible2 Aug 6, 2023
5ae58ae
(#642): fixed extraction helicopter spawning in water
Ansible2 Aug 6, 2023
815907b
(#642): fixed arsenal drop not having arsenal on it
Ansible2 Aug 7, 2023
c5e0811
(#642): adjusted collision loop detection frequency
Ansible2 Aug 7, 2023
0a9e495
(#642): fixed extraction wave having vehicles spawn
Ansible2 Aug 7, 2023
0984749
(#642): fixed managed run kiska function not working with secondary runs
Ansible2 Sep 21, 2023
c09579c
Updated kiska music functions
Ansible2 Jan 18, 2025
b5277d6
Commented out debug log
Ansible2 Jan 18, 2025
ea4f94b
Added CBA function imitations for add and remove per frame handlers
Ansible2 Jan 19, 2025
68a544a
Formatting
Ansible2 Jan 19, 2025
460c4bf
Updated kiska CAS functions
Ansible2 Jan 19, 2025
08d9034
Updated KISKA_fnc_classTurretsWithGuns
Ansible2 Jan 19, 2025
30d0150
Updated KISKA_fnc_clearWaypoints
Ansible2 Jan 19, 2025
cc29da9
Updated KISKA_fnc_countdown
Ansible2 Jan 19, 2025
e061ebe
Updated KISKA_fnc_spawnVehicle
Ansible2 Jan 19, 2025
5194585
KISKA_fnc_selectRandom
Ansible2 Jan 19, 2025
01acf5b
Updated KISKA_fnc_paratroopers
Ansible2 Jan 19, 2025
8de01a2
Updated KISKA_fnc_notify
Ansible2 Jan 19, 2025
230e692
Updated KISKA_fnc_managedRun_updateCode
Ansible2 Jan 19, 2025
8bdb2f9
Updated KISKA_fnc_managedRun_isDefined
Ansible2 Jan 19, 2025
9377608
Updated KISKA_fnc_heliLand
Ansible2 Jan 19, 2025
4567bfb
Updated KISKA_fnc_helicopterGunner
Ansible2 Jan 19, 2025
c602940
Updated KISKA_fnc_getVariableTarget
Ansible2 Jan 19, 2025
b39a0bf
Updated KISKA_fnc_deleteRandomIndex
Ansible2 Jan 19, 2025
d3f7d6e
#642: upgraded view distance limiter
Ansible2 Jan 23, 2025
a522d9a
Merge pull request #649 from Ansible2/(#642)-update-kiska
Ansible2 Jan 24, 2025
1d0871a
#642 added KISKA_fnc_ACEX_setHCTransfer
Ansible2 Jan 25, 2025
346bd1c
#642 added moscow bombing files to main blacklist
Ansible2 Jan 25, 2025
120280e
#642: fixed CAS attack infinite loops
Ansible2 Jan 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions Functions/AI Pathing/fn_pathing_checkLeaderVelocity.sqf

This file was deleted.

176 changes: 76 additions & 100 deletions Functions/AI Pathing/fn_pathing_collisionLoop.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,130 +2,106 @@
Function: BLWK_fnc_pathing_collisionLoop

Description:
Used to keep the AI from attempting to walk through a placed object.
Used to keep the AI from attempting to walk through a placed object.

Units on roads sometimes follow predetermined paths that can have them walk
through objects a user places down.
Units on roads sometimes follow predetermined paths that can have them walk
through objects a user places down.

Parameters:
0: _unit : <OBJECT> - The unit to run the loop on
0: _unit : <OBJECT> - The unit to run the loop on

Returns:
NOTHING
NOTHING

Examples:
(begin example)

[myUnit] spawn BLWK_fnc_pathing_collisionLoop;

[myUnit] spawn BLWK_fnc_pathing_collisionLoop;
(end)

Author(s):
Ansible2 // Cipher
Ansible2
---------------------------------------------------------------------------- */
scriptName "BLWK_fnc_pathing_collisionLoop";

if (!BLWK_doDetectCollision) exitWith {
["BLWK_doDetectCollision is set to be false, exiting...",false] call KISKA_fnc_log;
["BLWK_doDetectCollision is set to be false, exiting...",false] call KISKA_fnc_log;
};

if (!canSuspend) exitWith {
["Needs to be run in scheduled, exting to run in scheduled",true] call KISKA_fnc_log;
_this spawn BLWK_fnc_pathing_collisionLoop;
["Needs to be run in scheduled, exting to run in scheduled",true] call KISKA_fnc_log;
_this spawn BLWK_fnc_pathing_collisionLoop;
};

params ["_unit"];

params [
["_unit",objNull,[objNull]]
];


sleep 5;

if (isNull _unit) exitWith {};
private _unitGroup = group _unit;

private ["_objects","_position","_index","_moveToPosition"];
while {BLWK_doDetectCollision AND {alive _unit}} do {
sleep 0.1;

// don't run while a unit is in a vehicle
if (isNull (objectParent _unit)) then {
_position = getposASL _unit;
_objects = lineIntersectsObjs [_position,AGLToASL (_unit getRelPos [1,0]), objNull, _unit, false, 4];

if (_objects isNotEqualTo []) then {

// check if any encountered object is a built one
_index = _objects findIf {
!(isNull _x) AND
{_x getVariable ["BLWK_collisionObject",false]}
};

if (_index != -1) then {
private _collisionObject = _objects select _index;
_moveToPosition = (_unit getRelPos [20,180]);
// push the unit back from the object
_unit setPosATL (_unit getRelPos [2,180]);

_unitGroup setCombatMode "BLUE";
_unitGroup setBehaviour "SAFE";
_unitGroup setSpeedMode "FULL";
_unit disableAI "TARGET";
_unit disableAI "AUTOTARGET";

waitUntil {
if (isNull _unit OR {!alive _unit}) exitWith {true};
if (_unit distance2D _collisionObject >= 10) exitWith {true};
// tell the unit to move away
[_unit,_moveToPosition] remoteExec ["move", _unit];
sleep 0.1;
false
};

// return unit state
if (!isNull _unit AND {alive _unit}) then {
_unitGroup setCombatMode "YELLOW";
_unitGroup setBehaviour "AWARE";
_unit enableAI "TARGET";
_unit enableAI "AUTOTARGET";
//_unit enableAI "AUTOCOMBAT";
};
};
};
};
};


// FSM testing
/*
private ["_objects","_position","_index","_moveToPosition"];
while {BLWK_doDetectCollision AND {alive _unit}} do {
sleep 0.1;

// don't run while a unit is in a vehicle
if (isNull (objectParent _unit)) then {
_position = getposASL _unit;
_objects = lineIntersectsObjs [_position,AGLToASL (_unit getRelPos [1,0]), objNull, _unit, false, 4];

if !(_objects isEqualTo []) then {

// check if any encountered object is a built one
_index = _objects findIf {!(isNull _x) AND {_x getVariable ["BLWK_collisionObject",false]}};
if (_index != -1) then {
private _collisionObject = _objects select _index;
_moveToPosition = (_unit getRelPos [20,180]);
// push the unit back from the object
_unit setPosATL (_unit getRelPos [2,180]);

private _fsmHandle = [_unit,_moveToPosition,_collisionObject] execFSM "Functions\Other\testFSM.fsm";

waitUntil {
if (isNull _unit OR {completedFSM _fsmHandle}) exitWith {
diag_log "exited wait loop";
true
};
sleep 1;
false
};
};
};
};
while {BLWK_doDetectCollision AND (alive _unit)} do {
sleep 0.2;

// don't run while a unit is in a vehicle
private _unitIsInVehicle = !(isNull (objectParent _unit));
if (_unitIsInVehicle) then { continue };


private _objects = lineIntersectsObjs [
(getposASL _unit),
AGLToASL (_unit getRelPos [1,0]),
objNull,
_unit,
false,
4
];
private _notNearAnyObjects = _objects isEqualTo [];
if (_notNearAnyObjects) then { continue };


// check if any encountered object is a built one
private _index = _objects findIf {_x getVariable ["BLWK_collisionObject",false]};
private _notNearBuiltObject = _index == -1;
if (_notNearBuiltObject) then { continue };


private _collisionObject = _objects select _index;
private _moveToPosition = (_unit getRelPos [20,180]);
// push the unit back from the object
_unit setPosATL (_unit getRelPos [2,180]);

private _previousCombatBehaviour = combatBehaviour _unit;
private _previousCombatMode = unitCombatMode _unit;
_unit setUnitCombatMode "BLUE";
_unit setCombatBehaviour "SAFE";
_unit disableAI "TARGET";
_unit disableAI "AUTOTARGET";

waitUntil {
if (
!(alive _unit) OR
{
(_unit distance2D _collisionObject) >= 10
}
) exitWith {true};

// tell the unit to move away
[_unit,_moveToPosition] remoteExec ["move", _unit];

sleep 1;

false
};

// return unit state
if (alive _unit) then {
_unit setUnitCombatMode _previousCombatMode;
_unit setCombatBehaviour _previousCombatBehaviour;
_unit enableAI "TARGET";
_unit enableAI "AUTOTARGET";
};
};
*/
78 changes: 0 additions & 78 deletions Functions/AI Pathing/fn_pathing_detailedStuckCheck.sqf

This file was deleted.

48 changes: 0 additions & 48 deletions Functions/AI Pathing/fn_pathing_isGroupAlive.sqf

This file was deleted.

Loading