AI.plist Help

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
Charlie
---- E L I T E ----
---- E L I T E ----
Posts: 262
Joined: Wed Sep 27, 2006 5:33 pm

AI.plist Help

Post by Charlie »

Ok, this is a bit of a long one - apologies.
Also this post reveals rather more about my up-comming ( honest ) Orb.oxp release than I wanted.
{
"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 = (); };
}
A bit of a multi-role AI this one.
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 :cry:

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. :twisted:

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... :lol:
Benulobiweed.inc
By Appointment to
--- : GalCoop : ---

Your nearest Benulobiweed.inc dealer:
http://www.box.net/public/b2tic3tjsk#main

Charlie
User avatar
Dr. Nil
---- E L I T E ----
---- E L I T E ----
Posts: 983
Joined: Thu Sep 28, 2006 5:11 pm
Location: Nearest Hoopy Casino
Contact:

Post by Dr. Nil »

Looking forward to your take on the thargoids.

You can make an AI dump to the error log to see what states your entities are in by pressing zero while paused. If you've already done so, then what state are they in, when they just hang there?

You might also want to try to start with a very basic version of your AI adding more states, as the first states work.
Image

300 billboards in Your Ad Here!
Astromines and more in Commies.
AVAILABLE HERE along with other Oolite eXpansion Packs.
User avatar
Charlie
---- E L I T E ----
---- E L I T E ----
Posts: 262
Joined: Wed Sep 27, 2006 5:33 pm

Post by Charlie »

Thanks - didn't know about the pressing zero thing...

Hummm - I've never been methodical enough in my approach:- have an idea; do it.

This probaly explains why I still can't get any script.plist to work that isn't just a 'borrowed' + adapted one! ( even then it doesn't usually work! :roll: )

On the 'big ship' front - I'm sort-of going for greater depth in Oolite:
It's a big bad universe out there - more Thargoids turning up; Orb turning up; Navy now turning up in persuit. ( A first for system-space? )
Get involved? You'd better be a bl**dy good pilot with one serious ship under you - just to survive!
BUT, most of this stays in the background if you're careful. ( or new commanders won't last long )

I've whitnessed a few battles between Thargoids & Condors & thought 'more of that please'. :D

Flashes of: The eight galaxies are just the settled bit under GalCop contol, but 'foreign powers' along with the whole big-roaring anachy that is the Universe @ large occ encroaches...
Benulobiweed.inc
By Appointment to
--- : GalCoop : ---

Your nearest Benulobiweed.inc dealer:
http://www.box.net/public/b2tic3tjsk#main

Charlie
Post Reply