Does anyone have any info or examples on using fleet assignments in combat? At the moment I have this:
// Get fleet manager for target ship
CombatFleetManagerAPI combatFleetManagerAPI = Global.getCombatEngine().getFleetManager(ship.getOwner());
// Create a light escort order on target ship
CombatFleetManagerAPI.AssignmentInfo assignmentInfo = combatFleetManagerAPI.getTaskManager(true).createAssignment(CombatAssignmentType.LIGHT_ESCORT, (AssignmentTargetAPI)this.getDeployedFleetMemberAPI(ship), false);
// Assign other ship to the light escort order
combatFleetManagerAPI.getTaskManager(true).giveAssignment(this.getDeployedFleetMemberAPI(otherShip), this.assignmentInfo, false);
But it doesn't seem to work (the LIGHT_ESCORT assignment doesn't appear to be created nor is it followed by otherShip).
Also tried testing with this:
// Create waypoint for assignment
AssignmentTargetAPI assignmentTargetAPI = combatFleetManagerAPI.createWaypoint(ship.getLocation(), false);
// Create assignment
CombatFleetManagerAPI.AssignmentInfo assignmentInfo = combatFleetManagerAPI.getTaskManager(true).createAssignment(CombatAssignmentType.DEFEND, assignmentTargetAPI, false);
// Assign other ship to assignment
combatFleetManagerAPI.getTaskManager(true).giveAssignment(this.getDeployedFleetMemberAPI(otherShip), assignmentInfo, false);
In this case, the waypoint is created (I can see it in the tactical map) but it does not get the DEFEND assignment and then the otherShip does not get the defend order.
Am I missing a step somewhere?