-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Patcom patrol attack flanks #2901
base: unstable
Are you sure you want to change the base?
Patcom patrol attack flanks #2901
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First-pass review.
_flankPosition = [(_position select 0) + (sin (random 360)) * (random 100 + 100), (_position select 1) + (cos (random 360)) * (random 100 + 100), 0]; | ||
} else { | ||
// Selects random from _bestPositions, array contains x number of defined sources in selectBestPlaces | ||
private _randomPosition = selectRandom _bestPositions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be selectRandomWeighted? Otherwise you're throwing away a lot of info from selectBestPlaces.
Maybe that's intentional and you're doing something more like "select random place without bodies in it".
|
||
// If no position is found, we create a random one. | ||
if (_bestPositions isEqualTo []) then { | ||
_flankPosition = [(_position select 0) + (sin (random 360)) * (random 100 + 100), (_position select 1) + (cos (random 360)) * (random 100 + 100), 0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getPos [random 360, 100 + random 100]
?
// We check to see if the waypoint is still active after 3 minutes. If waypoint isn't complete the unit is likely stuck. | ||
if (_group getVariable "PATCOM_WaypointTime" < serverTime) exitWith { | ||
// Return home | ||
[_group, _groupHomePosition, "MOVE", "PATCOM_PATROL_DEFEND", -1, _patrolParams # 1] call A3A_fnc_patrolCreateWaypoint; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't you better off giving a random waypoint to a stuck group? Otherwise they might stay stuck forever because they can't find a path to home. Maybe questionable if the home waypoint is guaranteed safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Home waypoint is their initial spawn point so should always be considered "safe".
@@ -65,7 +65,7 @@ if (_group getVariable "PATCOM_WaypointTime" < serverTime) exitWith { | |||
}; | |||
|
|||
// Check for current waypoints and make sure they are type MOVE for patrol | |||
if (currentWaypoint _group == count waypoints _group || waypointType [_group, currentWaypoint _group] != "MOVE") then { | |||
if ((waypointType [_group, currentWaypoint _group] != "MOVE") || ((waypointName [_group, currentWaypoint _group]) != "PATCOM_PATROL_AREA")) then { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the first check required?
// Set Waypoint Name | ||
private _waypointName = "PATROL_ATTACK_DIRECT"; | ||
|
||
if !((waypointName [_group, currentWaypoint _group]) in _attackWaypointNames) then { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be a do-nothing case for all three attack types. Any reason not to move these checks after the static-arming and exitWith there?
private _finalWaypoint = _group addwaypoint [_enemyPosition, 0, 2, _waypointName]; | ||
_finalWaypoint setWaypointType "MOVE"; | ||
[_group, (_finalWaypoint select 1)] setWaypointCompletionRadius 50; | ||
deleteWaypoint [_group, 3]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the logic with the waypoint deletion here? Feels like you're creating a lot more waypoints than you're deleting, overall.
What type of PR is this.
What have you changed and why?
Information:
Adds in flank attacks for Patrol Attack behavior.
Please specify which Issue this PR Resolves.
N/A
Please verify the following and ensure all checks are completed.
Is further testing or are further changes required?
How can the changes be tested?
Steps:
Load into Mission.
Watch units move around.
Notes: