Also this post reveals rather more about my up-comming ( honest ) Orb.oxp release than I wanted.
A bit of a multi-role AI this one.{
"ATTACK_SHIP" = {
"ATTACKED" = ("messageMother: ATTACKED", setTargetToPrimaryAggressor, deployEscorts, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = ("messageMother: INCOMING_MISSILE", fightOrFleeMissile, setTargetToPrimaryAggressor, deployEscorts, "setStateTo: ATTACK_SHIP");
"TARGET_DESTROYED" = ("messageMother: TARGET_DESTROYED", "setStateTo: LOOK_FOR_TAHRGOID");
"TARGET_FOUND" = ("messageMother: ATTACK_SHIP", setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"TARGET_LOST" = ("messageMother: TARGET_LOST", "setStateTo: LOOK_FOR_THARGOID");
ENTER = (performAttack);
EXIT = ();
UPDATE = (scanForHostiles, "pauseAI: 1.0");
};
"LOOK_FOR_TARGETS" = {
"ATTACKED" = ("messageMother: ATTACKED", setTargetToPrimaryAggressor, deployEscorts, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = ("messageMother: INCOMING_MISSILE", fightOrFleeMissile, setTargetToPrimaryAggressor, deployEscorts, "setStateTo: ATTACK_SHIP");
"TARGET_FOUND" = ("messageMother: ATTACK_SHIP", setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"NOTHING_FOUND" = ("setStateTo: BEGIN");
ENTER = (scanForNonThargoid, "pauseAI: 1.0");
EXIT = ();
UPDATE = (scanForNonThargoid, "pauseAI: 1.0");
};
"LOOK_FOR_THARGOID" = {
"ATTACKED" = ("messageMother: ATTACKED", setTargetToPrimaryAggressor, deployEscorts, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = ("messageMother: INCOMING_MISSILE", fightOrFleeMissile, setTargetToPrimaryAggressor, deployEscorts, "setStateTo: ATTACK_SHIP");
"TARGET_FOUND" = ("messageMother: ATTACK_SHIP", setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"ENERGY_LOW" = ("messageMother: ATTACKED", deployEscorts, groupAttackTarget, setDestinationWithinTarget);
"NOTHING_FOUND" = ("setStateTo: LOOK_FOR_TARGETS");
ENTER = (scanForThargoid, "pauseAI: 1.0");
EXIT = ();
UPDATE = (scanForThargoid, "pauseAI: 1.0");
};
"FLYING_ESCORT" = {
"GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
RESTARTED = ("setStateTo: BEGIN");
ESCORTING = ("setDesiredRangeTo: 0.0", performEscort);
"INCOMING_MISSILE" = ("messageMother: INCOMING_MISSILE");
"ATTACKED" = ("messageMother: ATTACKED");
"NOT_ESCORTING" = ("setStateTo: LOOK_FOR_BUSINESS");
"TARGET_LOST" = ("setStateTo: LOOK_FOR_BUSINESS");
"TARGET_DESTROYED" = ("setStateTo: LOOK_FOR_BUSINESS");
"ENTER WORMHOLE" = ("setStateTo: ENTER_WORMHOLE");
ENTER = (performEscort);
EXIT = ();
UPDATE = (escortCheckMother, "pauseAI: 15");
};
"BEGIN" = {
"LAUNCHED OKAY" = ("setStateTo: CLEAR_STATION");
ATTACKED = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
ESCORTING = ("setDesiredRangeTo: 0.0", performEscort);
"NOT_ESCORTING" = ("setStateTo: LOOK_FOR_BUSINESS");
ENTER = (escortCheckMother);
EXIT = ();
UPDATE = ();
};
"ENTER_WORMHOLE" = {
ENTER = (setDestinationToTarget, "setDesiredRangeTo: 1.0", "setSpeedFactorTo: 1.0", performFlyToRangeFromDestination);
"PLAYER WITCHSPACE" = (enterTargetWormhole);
UPDATE = ();
EXIT = ();
};
"CLEAR_STATION" = {
ENTER = (setTargetToStation, setDestinationWithinTarget, "setDesiredRangeTo: 8000.0", "setSpeedFactorTo: 0.5", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: LOOK_FOR_BUSINESS");
UPDATE = (scanForFormationLeader, "pauseAI: 15.0");
"TARGET_FOUND" = (setTargetToFoundTarget, suggestEscort);
ESCORTING = ("setDesiredRangeTo: 0.0", "setStateTo: FLYING_ESCORT");
EXIT = ();
};
"LOOK_FOR_BUSINESS" = {
"LAUNCHED OKAY" = ("setStateTo: CLEAR_STATION");
ATTACKED = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
RESTARTED = ("setStateTo: BEGIN");
ESCORTING = ("setDesiredRangeTo: 0.0", "setStateTo: FLYING_ESCORT");
"TARGET_FOUND" = (setTargetToFoundTarget, suggestEscort);
"NOTHING_FOUND" = ("setStateTo: LOOK_FOR_TAHRGOID");
ENTER = (scanForFormationLeader);
EXIT = ();
UPDATE = ("pauseAI: 7.5", scanForFormationLeader);
};
GLOBAL = {ENTER = ("setStateTo: BEGIN"); EXIT = (); UPDATE = (); };
}
What's it supposed to do?
1 ) An Orb ship looks for buddies to fly about with ( also a mother ship if it hasn't got one )
2 ) They mind their own business until fired upon when they go crackers & attack anything in range - regardless! ( though for preferance Thargoids ) They also tend to engauge in massed attacks on their target.
3 ) For the moment they witch-space out if 'bored' - I have a working docking AI & BaseShip AI for when this one is running.
What does it do?
1 ) They just sit there!
2 ) If fired upon Oolite crashes
Ok - so it's maybe a little ambitious for a first attempt at an AI.plist ( apart from mildly modidng others work. ) Bits of this may be a little familliar as in an attempt at getting it to work I scrapped the first version in favour of hacking together bits from working AI.plists.
Where am I going wrong?
I was tempted to 'borrow' LB's hardpirateAI.plist but these little buggers were conceived as working co-operatively ( individually they are no threat ). Also I want them to leave players & NPC's alone for the most part - only to make them wish they had if provoked.
PS
Just in case anyone thinks I have it in for the Thargoids, just you wait for the new Thargoid ships I've got in 3DS-Max @ present!
Any sane commander will be glad for all the help they can get!!
PPS
D*mn - done it again! Started yet another project before any of the ( currently ) other seven are done...