I have this bit of code in the ship script of a pirate ship I'm working on:
Code: Select all
this.shipTargetAcquired = function(target)
{
if (target.isPlayer && player.bounty > 0) {this.ship.reactToAIMessage("TARGET_LOST"); this.ship.commsMessage("Oho.")};
}
I always get those aforementioned hails, no problem there.
But, one or more blips turn quite soon red and they attack me.
At this point this.ship.commsMessage("Oho.") works, but this.ship.reactToAIMessage("TARGET_LOST") seems to do nothing. I even added a commsMessage to pirateAI.plist's "TARGET_LOST" handler of the state "ATTACK_SHIP", but that message is never displayed and the ships keep attacking me.
Is my code defective or why the buggers won't try to find other targets?