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

Add override capability to fnc_taskAttack #356

Merged
merged 5 commits into from
Jun 6, 2016

Conversation

Wired-Tiger
Copy link
Contributor

When playing around with the attack, defend, and patrol functions I noticed that if the group was already set to either patrol or defend that their behavior would change but not move or change course. Probably not needed often, but still nice to have the capability of redirecting the group.

@@ -31,4 +31,6 @@ params ["_group","_position", ["_radius",0]];
_group = _group call CBA_fnc_getGroup;
if !(local _group) exitWith {}; // Don't create waypoints on each machine

[_group] call CBA_fnc_clearWaypoints; // Clear existing waypoints
Copy link
Contributor

Choose a reason for hiding this comment

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

A comment should explain why a piece of code does what it does. Ie a very brief summary of what you wrote in the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm a little confused. Is that not what I did at the end with " // Clear existing waypoints" ? Should it be on top instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

// Clear existing waypoints tells the reader what the line does, not why it is being done. (and it feels a bit redundant, since the name of the function being called hints at that).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay. Thanks for the clarification!

@Killswitch00
Copy link
Contributor

This should be optional so as to not change how the function behaves for existing uses of it. (Keep backwards compatibility)

@Killswitch00 Killswitch00 added this to the 2.4.2 milestone Jun 6, 2016
@Killswitch00 Killswitch00 merged commit caf0721 into CBATeam:master Jun 6, 2016
@Wired-Tiger Wired-Tiger deleted the AddFnc_TaskAttackOverride branch June 7, 2016 03:50
@kymckay
Copy link
Contributor

kymckay commented Jul 16, 2016

Late to the party, but it should be noted that any AI function used after taskDefend probably won't work 100% as expected due to the use of doStop.

Now that CBA is supporting 1.62 I'll change that to disableAI "PATH" in my next PR related to the AI functions. Will see if I can perhaps make them play better together when used in sequence too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants