Skip to content

Add populating buildings via a module#1049

Open
AnAngrySalad1 wants to merge 17 commits intomainfrom
feature/populate
Open

Add populating buildings via a module#1049
AnAngrySalad1 wants to merge 17 commits intomainfrom
feature/populate

Conversation

@AnAngrySalad1
Copy link
Contributor

When merged this pull request will:

  • PR of the auto populate for initial review

private _pos = [0,0,0];
private _dir = -1;

if (_numberOfPositionsToOccupy <= 1) exitWith {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the count of _statics is less than _numberOfPositionsToOccupy this will never exit as the only subtraction for _numberOfPositionsToOccupy is when _statics is not empty, requiring it to be equal or greater in length

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No other exit condition for the pfh with quite a few bits going on is very risky and will likley lead to a runaway endless spawning

Return value:
Nothing
*/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rework this to separate the spawning of units into statics, positions, and patrols


private _group = grpNull;
private _currenGrouptUnitCount = 0;
private _patrolSize = _module getVariable [QGVAR(patrolSize), 0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 is a bad default, should exit if value from the module is 0 otherwise the patrols will never be tasked

Return value:
Nothing
*/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could simplify this quite a bit by making use of common,spawnGroupInfantry.
Take the nubmer of units remaining and divide by the patrol size. Do that many iterations plus one more for the remainder.
The spawning can be staggered by using a waitAndExecute with the time based on the index of an array multiplied by seconds

@tbeswick96 tbeswick96 changed the title Feature/populate Add populating buildings via a module Jul 18, 2024
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

Successfully merging this pull request may close these issues.

2 participants