Couple of questions...

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

Moderators: winston, another_commander

User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2876
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Away for weekend at the moment so don't have Oolite available, but Won't it be easier to use escortAI? (see Giles's AIs)? A ship with escort AI will defend itself if attacked and will fly escorting the mothership, defending her if she is attacked, provided you define in the mother's shipdata that the escortships are your oxp escort ship.s EG: key <escort-role> <string>myescortship<\string>. Unless of course you want the escorts to do somthing other than flying in formation with the mother!
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Post by Roberto »

I tried escortAI - same problem. Also, regardless of the fighting, these ships aren't intended to behave as "standard escorts" anyway.

Also, I've been looking at escortAI to see if there's something I'm missing... and I don't see it.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2876
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Odd!

Using escortAI my ecorts defend themselves well and will group attack if one of them is attacked. 9 times out of ten, they defend the mother, but occasionally sit there whilst you blast her!
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Post by Roberto »

I just tried replacing groupAttackTarget with fightOrFleeHostiles (as used in the route1traderAI) in the mother's main AI - still no dice! In fact, it made it worse - when I attacked the mother directly, only two of the escorts responded. Which is just weird.

Think Giles may be the only one who can help me on this. I'm pretty much out of ideas.
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Post by Roberto »

Yep, *now* I'm out of ideas!

I replaced the TARGET_DESTROYED and TARGET_LOST lines (under "FLYING_ESCORT" in the main escort AI) with a MOTHER_LOST line, just in case the escorts were reading TARGET_LOST and getting stuck in "LOOK_FOR_MOTHER" - not very likely, but hey. And of course, it didn't work.

Wish I had a big searchlight with the Oolite logo on it I could shine up into the sky :)
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

try to do an object dumb debug when this is happening

to check whether the mother is getting stuck somewhere.

Also usefull to check for misspelt methods. :wink:
Riding the Rocket!
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Post by Roberto »

Hey there :) So how would I do that?

Actually, I'm pretty sure the mother isn't getting stuck - I've followed it as it flies between its various waypoints, and it responds as it should when it's attacked, triggering the escorts as well (the only problem is the Q-bomb issue). It even seems to respond properly when an escort is attacked. It's the escorts that are the problem: when I start by attacking one of them, they seem to refuse to go red - despite the fact that the mother goes red (indicating successful communication).
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2876
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

under attacked you have setTargetToPrimaryAggressor,

try : "setTargetToPrimaryAggressor",

I wrote a AI that was meant to scan for Nearest ship with role and then atatck it. I tore my hair out cursing it as it refused to function at all until I put the the scanforNearestshipwithrole: erebel in quotes. I still have no idea why this made it work, but it worked perfectly as soon as put the command in ""s. Perhaps this is why the mother goes red but the escort doesn't attack. The commincation is quotes works, but the unquoted setTarget to PrimaryAgressor does not. Just an idea!

EDIT: Perhaps you also need a performattack here as well!
Last edited by LittleBear on Sun Aug 27, 2006 9:00 pm, edited 1 time in total.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Post by Roberto »

It's my understanding that you only need quotes if the instruction has a space or an underscore in it. So I think it's something elsewhere... elusive...
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2876
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

I know. But when I wrote a "killplayer" AI, I just took ThargoidAI changed the ScanforNonThargoid (not in quotes) with ScanforNearestShipwithRole : player (not in quotes) and the ships just tumbled. Added the quotes and the ships attacked me without pity! I cannot think of any reason why this worked, but it did! :?
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Post by Roberto »

Because in that instance you had an instruction with a space in it :)
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2876
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Oh. Sorry stumped then! Perhaps add performattack.

Under the attacked bit, you don't seem to either have a "setAITo: taranisGeckoFightAI.plist"); or a SetStateto : ATTACK SHIP. Could this be why they message mummy (and she goes red), but don't attack themselves? The code only tells them to message mum?

EDIT:-
(I mean in this bit of the code)

Code: Select all

{ 
    "FLYING_ESCORT" = { 
        ENTER = (performEscort); 
   ESCORTING = ("setDesiredRangeTo: 0.0", performEscort); 
        "NOT_ESCORTING" = ("setStateTo: LOOK_FOR_MOTHER"); 
   ATTACKED = ("messageMother: ATTACKED"); 
        EXIT = (); 
I'm not brilliant at AI's but could this mean that when attacked whilst "Flying_Escort" the ships only messege mum, but don't attack themselves as they are not being told to?
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Post by Roberto »

If I added an attack command there, then that individual would probably attack - but the thing is, I need to get all of the escorts to attack. Which the mother should be telling them to do (via a groupAttackTarget command, sent back in response).

What's really confusing me is that after I start on the second or third escort, it *does* kick in. So it's *almost* working! Or working at least some of the time.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2876
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Would MessageEscorts: ATTACKED be vaild? Or perhaps have a performGroupAttack at this point (I mean in the escort's AI). That should get them all attacking if one of their number is attacked.
Last edited by LittleBear on Sun Aug 27, 2006 9:48 pm, edited 1 time in total.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Roberto
---- E L I T E ----
---- E L I T E ----
Posts: 318
Joined: Sun Jun 11, 2006 1:16 pm
Location: London, UK

Post by Roberto »

I'm not sure the former is a valid command, and I've tried the latter.

I've just had a thought, though - maybe it's the pause...
Post Reply