Ok, good to know no OXPs designed for v1.75.x are likely to become depreciated for v1.x of the game due to removed methods/scripting/AI going forwards.
While testing various trader types, I'm also testing what they can end up fighting: pirates and Thargoids.
And what a mess my Thargoid/Thargon AI.plist files are at the moment!
Thargoids and Thargons often end up shooting each other because they bunch up in a long tailchase. The Thargoids in particular are huge targets, so friendly fire is much more likely with them than with pirates. So I'm trying to come up with code to reduce that in their "ATTACK_SHIP" section:
Code: Select all
"ATTACK_SHIP" = {
ENTER = (performAttack);
"NOTHING_FOUND" = (performIdle, "setStateTo: LOOK_FOR_TARGETS"); // no non-Thargoids around, quit attacking!
"ATTACKED" = (setTargetToPrimaryAggressor, checkTargetLegalStatus);
"TARGET_THARGOID" = (performIdle, scanForNonThargoid); // STOP friendly Thargoids fire!
"TARGET_FUGITIVE" = (performIdle, scanForNonThargoid); // STOP friendly Thargoids fire!
UPDATE = (scanForNonThargoid, "pauseAI: 10.0"); // 30 seconds is too long!
};
(I removed other lines for simplicity and clarity.)
But that doesn't seem to work because:
"TARGET_THARGOID" = (performIdle, scanForNonThargoid); // STOP friendly Thargoids fire!
...doesn't work/exist.
I can do this:
"TARGET_FUGITIVE" = (performIdle, scanForNonThargoid); // STOP friendly Thargoids fire!
since all Thargoids and Thargons have at least a 50 credit bounty (minimum for fugitive rating)...but that unfortunately also means they quit attacking fugitive pirates!
Another method I can use, which is even more indirect...is see if there's even any non-Thargoids in range:
"NOTHING_FOUND" = (performIdle, "setStateTo: LOOK_FOR_TARGETS"); // no non-Thargoids around, quit attacking!
UPDATE = (scanForNonThargoid, "pauseAI: 10.0"); // 30 seconds is too long!
However that only helps if nothing else is around or is cloaked.
Thargons don't have a "ATTACKED" line anywhere, but they may still be fired as a missile at another Thargoid or Thargon and will persist in trying to kill those until they lose contact with their mother or the target gets out of range or the target dies.
Argh!...now my test Thargons are exploding and killing all the Thargoids whenever there's nothing else near them! Here's the Thargon's AI.plist:
Code: Select all
GLOBAL = { ENTER = ("setStateTo: ATTACK_SHIP"); };
"ATTACK_SHIP" = {
ENTER = ("commsMessage: ATTACKING!", performAttack, checkTargetLegalStatus);
// "TARGET_THARGOID" = (performIdle, "setStateTo: LOOK_FOR_TARGETS"); // STOP friendly Thargoids fire!
// "TARGET_FUGITIVE" = (performIdle, "setStateTo: LOOK_FOR_TARGETS"); // STOP friendly Thargoids fire! (also quits attacking fugitive pirates.)
"TARGET_DESTROYED" = ("setStateTo: CHECK_FOR_CONTROL");
"TARGET_LOST" = ("setStateTo: CHECK_FOR_CONTROL");
"NOTHING_FOUND" = ("setStateTo: CHECK_FOR_CONTROL");
UPDATE = ("pauseAI: 10.0", scanForThargoid);
};
"CHECK_FOR_CONTROL" = {
ENTER = ("pauseAI: 1.0", "scanForNearestShipHavingRole: thargoid", "pauseAI: 1.0"); // was thargonCheckMother or scanForThargoid
"TARGET_FOUND" = (setTargetToFoundTarget, setDestinationToTarget, "setDesiredRangeTo: 1000.0", checkCourseToDestination);
"COURSE_OK" = ("setSpeedFactorTo: 1", performFlyToRangeFromDestination, "pauseAI: 10.0", "setStateTo: LOOK_FOR_TARGETS");
"NOTHING_FOUND" = (becomeEnergyBlast, "pauseAI: 30.0"); // ADDED for testing!
};
"LOOK_FOR_TARGETS" = {
ENTER = (scanForNonThargoid, "pauseAI: 1.0");
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"NOTHING_FOUND" = ("setStateTo: CHECK_FOR_CONTROL");
UPDATE = ("pauseAI: 10.0", scanForNonThargoid);
};
It almost seems like:
1.the LOOK_FOR_TARGETS section does a scanForNonThargoid, and returns "NOTHING_FOUND" and them jumps to the CHECK_FOR_CONTROL section.
2.CHECK_FOR_CONTROL section inherits this "NOTHING_FOUND" and does becomeEnergyBlast. (Maybe even before bothering to check "scanForNearestShipHavingRole: thargoid"?)
In this situation, it is statistically impossible for the Thargons to pick 16 random ships near themselves and *NOT* pick at least 1 Thargoid Warship. There's only the Thargons, Thargoids, and my cloaked ship within scanner range. And there is fewer than 10 Thargons. I tried thargonCheckMother and scanForThargoid instead of "scanForNearestShipHavingRole: thargoid" and got the same result. Super-unstable Thargons that explode almost at random.