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

Harrass System: Players in Populated FOBs can be assigned both Attack and Pursuit AI objectives? #5

Open
dijksterhuis opened this issue Sep 12, 2023 · 0 comments

Comments

@dijksterhuis
Copy link
Contributor

dijksterhuis commented Sep 12, 2023

TL;DR -- The server/functions/harass/fn_harass_create_squads.sqf script reads like players inside populated FOBs shouldn't have tracker teams sent to them, but variables may be assigned in the wrong order, meaning FOBs do have tracker AI assigned.

Unsure if this is by design / intention (hacking the assignment order to also assign tracker teams to the FOB for higher AI count) or if it's just no-one has noticed the possible out of order assignment.

If the former, some clarification that it is intended would be appreciated.

If the latter, should be a simple fix and happy to push a PR.


1. Find players to send tracker teams towards

_friendlyPlayersToHarass variable based on the original _harrasablePlayers variable defined here

// server/functions/harass/fn_harass_create_squads.sqf#L70

// Find players that aren't harassed enough.
private _friendlyPlayersToHarass = _harassablePlayers select {_x getVariable "harass_level" < 1};

2. Send attacks towards populated FOBs

// server/functions/harass/fn_harass_create_squads.sqf#L73-L91

// Keep occupied FOBs harassed
private _playersToRemove = [];
{
    // ...
    _playersToRemove append _players;
    // logic where each populated FOB has Attack AI obj assigned
} forEach para_g_bases;

3. Exclude players in populated FOBs from the list of players for tracker teams ....

POTENTIAL BUG modify _harassablePlayers -- this variable is never used after this point

// server/functions/harass/fn_harass_create_squads.sqf#L93

// prune the list of harrassable players to exclqude those inside FOBs under attack
private _harassablePlayers = _harassablePlayers - _playersToRemove;

4. Assign tracker teams to players who should be harrassed

Uses _friendlyPlayersToHarass variable, defined before the FOB attack logic and based on the original _harrasablePlayers variable defined here

The tracker team / pursuit AI logic includes players in a populated FOB.

// server/functions/harass/fn_harass_create_squads.sqf#L97-L148

while {!(_friendlyPlayersToHarass isEqualTo []) && count _friendlyPlayersToHarass != _lastPlayersToHarassLength} do {
    _lastPlayersToHarassLength = count _friendlyPlayersToHarass;
    private _target = selectRandom _friendlyPlayersToHarass;

     // logic stuff
};
@dijksterhuis dijksterhuis changed the title Harrass System: Players in Populated FOBs can be assigned both Attack and Pursuit AI objectives Harrass System: Players in Populated FOBs can be assigned both Attack and Pursuit AI objectives? Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant