Page 1 of 1

Specific escort ships.

Posted: Tue Nov 09, 2010 8:11 pm
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.

Posted: Tue Nov 09, 2010 8:40 pm
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...)! :)

Posted: Tue Nov 09, 2010 8:51 pm
by Thargoid
The shipdata.plist keys escort-role and escort-ship are your friends here.

As of course is the wiki, invariably :twisted:

Posted: Tue Nov 09, 2010 9:03 pm
by Commander McLane
Kaks wrote:
escort(0.000001)
Actually, "escort(0)" suffices.

Posted: Tue Nov 09, 2010 9:31 pm
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.)

Posted: Tue Nov 09, 2010 9:47 pm
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

Posted: Tue Nov 09, 2010 9:55 pm
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?

Posted: Wed Nov 10, 2010 10:13 pm
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.

Posted: Wed Nov 10, 2010 10:48 pm
by Smivs
Good point about the ampersand...I'll not use it. Thanks.