Page 1 of 1

Removing target and setting target on other ship

Posted: Tue Jan 27, 2015 4:11 am
by phkb
If I remove a target from another ship in the middle of a complex battle (ie. a battle where there is more than 1 ship on the players side -- I'm sure there are even more complex scenarios, but that will do for the moment!), will that ship then automatically find another target, or do I need to force the AI to do a search for another target?

Also, can I remove a target from another ship's potential list of targets. So, if I remove a target from a ship, how do I stop that ship from re-acquiring the same target again?

Re: Removing target and setting target on other ship

Posted: Tue Jan 27, 2015 7:31 am
by cim
phkb wrote:
If I remove a target from another ship in the middle of a complex battle (ie. a battle where there is more than 1 ship on the players side -- I'm sure there are even more complex scenarios, but that will do for the moment!), will that ship then automatically find another target, or do I need to force the AI to do a search for another target?

Also, can I remove a target from another ship's potential list of targets. So, if I remove a target from a ship, how do I stop that ship from re-acquiring the same target again?
Removing the current target will send the ship a target lost event, which will cause it to re-evaluate its AI, which will usually cause it to acquire a new target from its list of known hostiles.

If you want to make it harder for it to reacquire the same target as before, you'll also need to do ship.removeDefenseTarget(oldTarget);

Events during the battle are likely to add it back at some point however, unless the removed target ceases firing on allied (non-player) ships.

Re: Removing target and setting target on other ship

Posted: Tue Jan 27, 2015 9:03 am
by phkb
Thanks cim!