Strange problem with unresponsive ships
Posted: Wed Jul 12, 2017 3:14 pm
If I may ask for help again . .
I've got a ship type, the name and role of which is IST_thargoidDefenceShip. This ship type has a plist ai and a script. And ships of this type are launched from a - huge - ship. The problem is, these defence ships won't do anything when they go into performAttack. They come up red on the scanner, and my player ship's turrets fire on them when they are red, but they do not actually attack but rather sail on off into the void.
Here is some more detail. My ai checks for the LAUNCHED OKAY message, and the problem occurs after that message has been received. Moreover, while the ship script decides what the ships should attack, I've tried replacing that functionality with a 'scanForNonThargoid' and same attacking-without-attacking behavour occurs. I've even tried removing the huge launch ship - once the defence ships find a target - and still the defence ships won't attack. (I had thought that perhaps that some sort of misfiring anti-collision routine was stopping the shifts from attacking.) Any tharglets launched by the defence ships attack fine.
Now I'm completely stumped.
Here's the relevant part of the AI.
I've got a ship type, the name and role of which is IST_thargoidDefenceShip. This ship type has a plist ai and a script. And ships of this type are launched from a - huge - ship. The problem is, these defence ships won't do anything when they go into performAttack. They come up red on the scanner, and my player ship's turrets fire on them when they are red, but they do not actually attack but rather sail on off into the void.
Here is some more detail. My ai checks for the LAUNCHED OKAY message, and the problem occurs after that message has been received. Moreover, while the ship script decides what the ships should attack, I've tried replacing that functionality with a 'scanForNonThargoid' and same attacking-without-attacking behavour occurs. I've even tried removing the huge launch ship - once the defence ships find a target - and still the defence ships won't attack. (I had thought that perhaps that some sort of misfiring anti-collision routine was stopping the shifts from attacking.) Any tharglets launched by the defence ships attack fine.
Now I'm completely stumped.
Here's the relevant part of the AI.
Code: Select all
GLOBAL =
{
"LAUNCHED OKAY" = ("setStateTo: SCAN");
};
SCAN =
{
ENTER = (performIdle, "randomPauseAI: 0.5 3.0");
UPDATE = ("sendScriptMessage: $_findTarget", "pauseAI: 4.0");
TARGET_FOUND = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
[ . . code omitted . .]
};
ATTACK_SHIP =
{
ENTER = (performAttack);
INCOMING_MISSILE = (fightOrFleeMissile, setTargetToPrimaryAggressor, "setStateTo: CONSIDER_RETALIATION");
TARGET_DESTROYED = ("setStateTo: SCAN"); // I tried removing this line; doing so made no difference.
TARGET_LOST = ("setStateTo: SCAN"); // I tried removing this line; doing so made no difference.
};