Couple of questions...

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

Moderators: winston, another_commander

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 »

Nope, not the pause! Removing it seemed to result in them taking even longer to "wake up" and all turn red (think I'd destroyed three ships before they finally responded).

This is what I don't get - it works, *eventually*. What the hell?!
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 »

As a desperation measure, I stuck groupAttackTarget everywhere. Doesn't work (in fact, Oolite crashed, though that may have been unrelated).

Argh!!

Here are the two "main" AIs again, for the mother and the escorts. Giles, wherever you are, I need you! (You're probably doing sensible bank-holiday-weekend things...)

Code: Select all

{
    "HEAD_FOR_WAYPOINT1" = {
	ENTER = ("setCoordinates: pwm 1378683 33206 -619642", setDestinationFromCoordinates, "setDesiredRangeTo: 300.0", checkCourseToDestination);
	"COURSE_OK" = ("setSpeedFactorTo: 0.6", performFlyToRangeFromDestination);
	"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
	"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_WAYPOINT2");
        "INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor, groupAttackTarget, "sendTargetCommsMessage: [shark-threat]", "setAITo: taranisSharkFightAI.plist"); 
        ATTACKED = (setTargetToPrimaryAggressor, groupAttackTarget, "sendTargetCommsMessage: [shark-threat]", "setAITo: taranisSharkFightAI.plist"); 
        "TARGET_FOUND" = (setTargetToFoundTarget, groupAttackTarget); 
        "GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "sendTargetCommsMessage: [shark-threat]", "setAITo: taranisSharkFightAI.plist"); 
	UPDATE = (setDestinationFromCoordinates, checkCourseToDestination, "scanForNearestShipWithRole: thargoid", "pauseAI: 6.0");
	EXIT = ();
    }; 
    "HEAD_FOR_WAYPOINT2" = { 	
	ENTER = ("setCoordinates: pwm 1406255 76105 -669229", setDestinationFromCoordinates, "setDesiredRangeTo: 300.0", checkCourseToDestination);
	"COURSE_OK" = ("setSpeedFactorTo: 0.6", performFlyToRangeFromDestination);
	"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
	"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_WAYPOINT3");
        "INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor, groupAttackTarget, "sendTargetCommsMessage: [shark-threat]", "setAITo: taranisSharkFightAI.plist"); 
        ATTACKED = (setTargetToPrimaryAggressor, groupAttackTarget, "sendTargetCommsMessage: [shark-threat]", "setAITo: taranisSharkFightAI.plist"); 
        "TARGET_FOUND" = (setTargetToFoundTarget, groupAttackTarget); 
        "GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "sendTargetCommsMessage: [shark-threat]", "setAITo: taranisSharkFightAI.plist"); 
	UPDATE = (setDestinationFromCoordinates, checkCourseToDestination, "scanForNearestShipWithRole: thargoid", "pauseAI: 6.0");
	EXIT = ();
    }; 
    "HEAD_FOR_WAYPOINT3" = { 	
	ENTER = ("setCoordinates: pwm 1387775 65636 -623440", setDestinationFromCoordinates, "setDesiredRangeTo: 300.0", checkCourseToDestination);
	"COURSE_OK" = ("setSpeedFactorTo: 0.6", performFlyToRangeFromDestination);
	"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
	"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_WAYPOINT4");
        "INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor, groupAttackTarget, "sendTargetCommsMessage: [shark-threat]", "setAITo: taranisSharkFightAI.plist"); 
        ATTACKED = (setTargetToPrimaryAggressor, groupAttackTarget, "sendTargetCommsMessage: [shark-threat]", "setAITo: taranisSharkFightAI.plist"); 
        "TARGET_FOUND" = (setTargetToFoundTarget, groupAttackTarget); 
        "GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "sendTargetCommsMessage: [shark-threat]", "setAITo: taranisSharkFightAI.plist"); 
	UPDATE = (setDestinationFromCoordinates, checkCourseToDestination, "scanForNearestShipWithRole: thargoid", "pauseAI: 6.0");
	EXIT = ();
    }; 
    "HEAD_FOR_WAYPOINT4" = { 	
	ENTER = ("setCoordinates: pwm 1406207 46599 -677143", setDestinationFromCoordinates, "setDesiredRangeTo: 300.0", checkCourseToDestination);
	"COURSE_OK" = ("setSpeedFactorTo: 0.6", performFlyToRangeFromDestination);
	"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
	"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_WAYPOINT1");
        "INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor, groupAttackTarget, "sendTargetCommsMessage: [shark-threat]", "setAITo: taranisSharkFightAI.plist"); 
        ATTACKED = (setTargetToPrimaryAggressor, groupAttackTarget, "sendTargetCommsMessage: [shark-threat]", "setAITo: taranisSharkFightAI.plist"); 
        "TARGET_FOUND" = (setTargetToFoundTarget, groupAttackTarget); 
        "GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "sendTargetCommsMessage: [shark-threat]", "setAITo: taranisSharkFightAI.plist"); 
	UPDATE = (setDestinationFromCoordinates, checkCourseToDestination, "scanForNearestShipWithRole: thargoid", "pauseAI: 6.0");
	EXIT = ();
    }; 
    GLOBAL = {
	ENTER = (setUpEscorts, "setStateTo: HEAD_FOR_WAYPOINT1");
	EXIT = ();
	UPDATE = ();
    }; 
}

Code: Select all

{
    "FLYING_ESCORT" = {
        ENTER = (performEscort); 
	ESCORTING = ("setDesiredRangeTo: 0.0", performEscort);
        "NOT_ESCORTING" = ("setStateTo: LOOK_FOR_MOTHER"); 
	ATTACKED = ("messageMother: ATTACKED"); 
        EXIT = (); 
        "INCOMING_MISSILE" = (fightOrFleeMissile, "messageMother: INCOMING_MISSILE"); 
        "MOTHER_LOST" = ("setStateTo: LOOK_FOR_MOTHER"); 
        "GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setAITo: taranisGeckoFightAI.plist"); 
        UPDATE = (escortCheckMother, "pauseAI: 7.5"); 
    }; 
    "LOOK_FOR_MOTHER" = {
        ATTACKED = (setTargetToPrimaryAggressor, "setAITo: taranisGeckoFightAI.plist");
        ENTER = (scanForFormationLeader); 
        EXIT = ();
	ESCORTING = ("setDesiredRangeTo: 0.0", "setStateTo: FLYING_ESCORT");
        "TARGET_FOUND" = (setTargetToFoundTarget, suggestEscort); 
        "NOTHING_FOUND" = ("setStateTo: HEAD_FOR_WAYPOINT"); 
        UPDATE = ("pauseAI: 7.5", scanForFormationLeader); 
    }; 
    "HEAD_FOR_WAYPOINT" = {
	ENTER = ("setCoordinates: pwm 1398448 54128 -649486", setDestinationFromCoordinates, "setDesiredRangeTo: 300.0", checkCourseToDestination);
	"COURSE_OK" = ("setSpeedFactorTo: 0.9", performFlyToRangeFromDestination);
	"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
	"DESIRED_RANGE_ACHIEVED" = ("setStateTo: LOOK_FOR_MOTHER");
        "INCOMING_MISSILE" = (fightOrFleeMissile, setTargetToPrimaryAggressor, "setAITo: taranisGeckoFightAI.plist"); 
        ATTACKED = (setTargetToPrimaryAggressor, "setAITo: taranisGeckoFightAI.plist"); 
	UPDATE = (setDestinationFromCoordinates, checkCourseToDestination, "pauseAI: 6.0");
	EXIT = ();
    }; 
    GLOBAL = {
	ENTER = ("setStateTo: FLYING_ESCORT");
	EXIT = ();
        UPDATE = (); 
    }; 
}
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 »

Sorry. I've no answer. It may be a problem with the game though rather than your coding. I've noticed that a lot of ships with escorts often suffer from this sort of problem. With the native Annaconda, I've often blasted its escorts away, with only the ship attacked returned fire.

There are other ways to cause a group of ships to attack the player though. One of the hits in my assassins.oxp involves taking out a pirate captain, heading a pirate fleet. I gave the OXP mission ship and the 4 OXP pirates pirate AI and for good measure threw in 20 ships with the general role "pirate". They all attacked me en mass and would also attack tarders enmass.
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
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 »

For the escort under ATTACKED in ESCORTING you may want to SetAI to gecko_attackAI.plist too, besides messaging the mother.
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 »

Fair enough - I guess it's just a programming quirk (maybe Giles can confirm this). And it's hardly a disaster, as in 99% of cases the ships will attack you first anyway (when I change "thargoid" back to "player" in the mother's main AI). Just me being a perfectionist!

Arexack - yes, I'll do that, so at least the ship attacked should respond :)
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 »

OK - I'm returning to this after a break of a couple of weeks :)

Arexack - I added "setAITo: taranisGeckoFightAI.plist" under ATTACKED in FLYING_ESCORT, and it made no difference! Incredibly, even when the escort you've attacked is directly ordered to retaliate, it doesn't. I think LittleBear must be right - there's something weird about escort behaviour that's (to quote the Vicomte de Valmont) beyond my control. Fortunately, I'm going to set the mothership back to scanning for "player" in its main AI - which means that all the ships will attack you first anyway. Only those who are able to attack first without being spotted, i.e. those with cloaking devices or (possibly in the future) a long-range scanner, will observe the phenomenon. It's beyond my control!

Also, I would still really, really like to know how to get a ship to launch a Q-mine from its AI. There *must* be a way, but I've tried everything. I don't want to give anything away, but the encounter I'm planning will be extremely cool if I can achieve this!
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 »

Griff had exactly the same problem with his Escort BattleBots. They refused to follow the AI he gave them and defaulted to escortAI, as they were being "called into existance" by an entry in the Nemesis Ship's shipdated rather than by their own role. I think however much you findle with the OXP escorts AI they will ignore it and use escortAI instead if they are called as escorts by the Motherships shipdata. Was skulling the wall over this for days over my Hockey Team VIP Transports, escorted by Hockey Team Minders! With Griff having the same problem, I'm pretty sure that I'm right! An escort will only follow escortAI no matter what AI you tell it to follow!

The best work round I found was to NOT give the ship any escorts in ship data, but to do it this way:-

Load up Oolite and fly to the place where you what the mothership to first appear. Press SHIFT F. The game will shown you three co-ordinate positions. (these are the pwm co-ordinates of your position).

Now add your Mothership with an AddShipsPresicleyAt pwm XXX YYY ZZZ.

Have your next command in the script add the escorts with an AddShipsWithinRadius pwm XXX YYY ZZZ 150. The ships you want to escort the Mother will be called into existance within 150 meters of the Mother. That way they appear together and follow the AI that you asign the "escort ships" in shipdata.
Last edited by LittleBear on Sun Sep 10, 2006 6:58 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 »

Damned escorts :)

Your way makes sense - the only problem I can see is that then there'd be nothing to keep the escorts with the mothership as they flew around and performed manoeuvres (I'm having my ships follow a little patrol pattern until they engage you, or you engage them). Even if I matched up the speeds exactly (two different ship types), the presence of obstacles and the different manouevring characteristics would probably mean they got separated.

Unless I'm wrong about this, think I'll leave it as it is, as 99.9% of the time they should see you first and attack en masse anyway (hopefully).

If you're right in what you say, I wonder if Giles would be able to fix/modify this at some point? :)
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 »

That is the problem! I've been usesing a holdAI that causes the ships to stay where they are until they detect the player / triad ship / mafia ship / trader etc or whatever they are meant to be attacking! Works in assassins, but can see how it could be a problem for u! If they all have the same Go somewhere AI though, they should stay pretty much together!
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
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 »

I have a problem....

with detonating the station, but more specifically with triggering the clearing of an expeditous exitroute.
(as detonations can cause subentites to detonate quite efficiently, but in doing so would destroy the playership.)

I need a NEW method to 'sendAImessageTo:' or 'performScriptActionOn:' subentities. (or anyentity withinRange/withRole)

I cannot use

Code: Select all

KABOOM = ("scanForShipWithRole: subentity", setTargetToFoundTarget, "performScriptActionOnTarget: action");
as subentities are a sub-part of the mother entity and not scanable as separate entities.

Any genius thoughts on doing this with the methods available to us
or should I start PM-ing Giles and lobbying for these new methods?


EDIT: On escorting: try adding requestEscort to the escorteeAI. so that the escorts will offer escort service to the ship after being spawned.
Riding the Rocket!
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 »

When the core is on energy low, could it send a comms message giving a clue to the way out. "Warning : Core Shielding critical! All personel evacuate by the red route!" Have some subenties near the core with a distinctive colour with energy of 1. The player could then blast a path to freedom before the blowing subentries blow his ship up.

Edit : Idea being, you weaken the core then blast your escape path. Fly into the tunnel you've made. Then take the core out with your rear gun and hit the injectors!
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
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 »

problem is; making such a path creates too easy a way in.

I force the player to use the trench or docking bay for acces.
Riding the Rocket!
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 »

If the other side of the subentries was the same colour as the outside of the station though, the player won't know this and would fly down the trench.

Edit: Had a better idea!

When the core dies have it spawn a ship. This ship would be use the metal fragment modle and be the same size, but give it high energy and recharge so it cannot be destroyed and make it non-scoopable, so although it looks like a fragment it is a ship in game code terms.

Give the special metal fragment an AI that causes it to performidle, then pause AI for however many seconds you feel gives the player a chance to get out, then have its next command be a detonate and deal (massive) enegydamagewithin radius to take out the rest of the station.
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
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 »

I was planning on putting in vent-ducts, one exiting out into the exposed area.
A grille would be blown off by the initial explosion of the core-stabiliser, exposing the vent.

Maybe I'll just have multiple way of entering the base.

the grille exit will be hidden behind an overhanging bridge.
One should come to a halt and shoot the grille to enter the tube from outside.
Thus giving thew 'n' turrets a good chance of hitting the playership.

Initial base v1.0 internalmodel has waaaaay too much polies. :( drat.
Riding the Rocket!
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 »

Sounds amazing!

Would the metal fragment idea that I put in the edit to my last post work?
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.
Post Reply