Specific escort ships.

General discussion for players of Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Specific escort ships.

Post by Smivs »

Can anyone help.
I am hoping to use a specific escort ship for the new Liner OXP, and was wondering how I can make this particular escort only escort the liner. At the moment they are always appearing with the Liner, but also appear occassionally escorting other ships, and even appear as Offenders from time to time.
I've noticed the same thing happening with the special Viper escorts from the Armoured Transport OXP.
Is there a simple way of ensuring that they only escort the type of ship they should be escorting?
Currently I have it set as role "escort" in the shipdata.plist, and it uses the EscortAI, with autoAI on.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Don't use a role 'escort' for your unique escorts. Give them their own specific role like ' escort(0.000001) smivs-projX-escort' or something. Then you can tell the mom to only use 'smivs-projX-escort' as escorts.

Have a look at how it's done inside transports.oxp, version 2.45 (sorry Eric, I'm not too familiar with the newer versions...)! :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

The shipdata.plist keys escort-role and escort-ship are your friends here.

As of course is the wiki, invariably :twisted:
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Kaks wrote:
escort(0.000001)
Actually, "escort(0)" suffices.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Commander McLane wrote:
Kaks wrote:
escort(0.000001)
Actually, "escort(0)" suffices.
Or don't use the role escort at all in your role definition. Its not needed for selection when you use the keys escort-role or escort-ship. And the game still will give it an escort role as soon as its added in game.
But they still won't be 100% exclusive because when mom dies, they might look for new mothers.
Smivs wrote:
've noticed the same thing happening with the special Viper escorts from the Armoured Transport OXP.
That the armoredTransport escorts are sometimes added to other ships is because they have an escort(0.05) role definition. That makes it deliberate that they sometimes take other mothers.
Kaks wrote:
Have a look at how it's done inside transports.oxp, version 2.45 (sorry Eric, I'm not too familiar with the newer versions...)!
They have an escort(0.001) role definition. No idea why I never changed that. Such a value only confuses people. When one means zero one should write zero and not 0.001 :P
(I have now deleted it for a next release.)
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Point taken! I seem to vaguely remember the reasoning behind that (0.00001) was that 1.65 would have some problems with escorts if they didn't have any escort role at all, but it's all so very hazy now... :P
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Post by Smivs »

Thanks, looks like I'm already part of the way there.
The escort is an adder variant for the P&Oo cruise company so

Code: Select all

escort_ship = "p&ooescort-adder";
is already in the shipdata.plist for the mother (Liner).
Eric Walch wrote:
Or don't use the role escort at all in your role definition. Its not needed for selection when you use the keys escort-role or escort-ship. And the game still will give it an escort role as soon as its added in game.
But they still won't be 100% exclusive because when mom dies, they might look for new mothers.
Just to check, you're saying I don't need to specify a role of escort in the shipdata.plist code for the escort? No 'role' at all?
Not too worried about the last point...these Mothers don't die easy :D

Edit:- Ah, just had a look at Transports, so I need

Code: Select all

roles = "escort(0) p&ooescort-adder";
in the adder's shipdata.plist. Yes?
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Smivs wrote:
Just to check, you're saying I don't need to specify a role of escort in the shipdata.plist code for the escort? No 'role' at all?
Not too worried about the last point...these Mothers don't die easy :D

Edit:- Ah, just had a look at Transports, so I need

Code: Select all

roles = "escort(0) p&ooescort-adder";
in the adder's shipdata.plist. Yes?
If you tie the escort to its mother through the escort-ship key, in principle you wouldn't need a roles key with the escort at all, because it would be identified by its entry-name, not by role. However, I think that the roles key is mandatory, and Oolite will throw out an error if it's missing, so you should use your custom role anyway. If you would tie the escort to its mother through the escort-role key, you would of course also need your custom role. But in any case, as Eric says, you don't need the "escort(0)" at all.

By the way, the ampersand is a command character at least in XML, perhaps in OpenStep as well, so I would advise you to not use it in your role name, or anywhere else, except in the masked form "&" (it happens to be the command character for masking command characters). The string "p&o" may lead to problems, so it is best to avoid it.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Post by Smivs »

Good point about the ampersand...I'll not use it. Thanks.
Commander Smivs, the friendliest Gourd this side of Riedquat.
Post Reply