For debugging formation movement and UnitAI it's useful to be able to see and select the formation controllers during a game. This patch updates the commented out parts of the formation template to allow that to happen. See D1423.
Details
- Reviewers
elexis - Commits
- rP21700: Formation debug update
To not get errors, we still have to add
FormationAttack.prototype.GetAttackTypes = function() { return []; };
(or something more correct) to FormationAttack.js, or
Index: binaries/data/mods/public/simulation/components/GuiInterface.js =================================================================== --- binaries/data/mods/public/simulation/components/GuiInterface.js (revision 21627) +++ binaries/data/mods/public/simulation/components/GuiInterface.js (working copy) @@ -382,7 +382,7 @@ let cmpAttack = Engine.QueryInterface(ent, IID_Attack); if (cmpAttack) { - let types = cmpAttack.GetAttackTypes(); + let types = cmpAttack.GetAttackTypes ? cmpAttack.GetAttackTypes() : []; if (types.length) ret.attack = {};
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
FormationAttack.prototype.GetAttackTypes = function() { return []; };
I'd say adding this is ok and doesn't require a justification for debug mode, because the component implements the Attack interface and that function might be called under other circumstances too in the future. (Then it should likely return either the attack types of the members or whatever the formation allows.)
Perhaps we can add // Only called when making formation entities selectable for debugging as a clarification.
(It doesn't reduce the performance in release mode as it will never be called)
Thanks for updating it. It will enable us to fix more formation issues that were neglected for so long.
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/differential/378/display/redirect