Compatibility questions

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

Moderators: winston, another_commander

Post Reply
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

Compatibility questions

Post by Lestradae »

Is it possible ... (one of those again :roll: )

... to use the commands "defense_ship_role" and "escort-ship" for the same ship, but with different ship types filling those roles?

Second question, if I have js scripts and a script.plist with diverse XML scripts in the same oxp, what do I have to keep in mind so that they don't clash or cancel each other out?

Thankful for competent replies

L
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Compatibility questions

Post by Eric Walch »

Lestradae wrote:
... to use the commands "defense_ship_role" and "escort-ship" for the same ship, but with different ship types filling those roles?
No problem, they are completely different things. Look in the Leviathan, that also uses both.
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:

Re: Compatibility questions

Post by Commander McLane »

Lestradae wrote:
... to use the commands "defense_ship_role" and "escort-ship" for the same ship, but with different ship types filling those roles?
Provided the 'ship' you are talking about is a station. Or in plain English: It makes sense only for a carrier. Because only a carrier can have escorts and defense ships.

Escorts only are needed for a moving ship. For a stationary station they would look stupid.

Defense ships are only needed for a station (read: something with a docking bay), because defense ships are what the station launches in case of an attack. Oh, and it needs an AI that actually has launchDefenseShip commands, or it would never launch them.

The only entity type that fits both categories: 'moving ship' and 'station', is a carrier. Have a look into the Behemoth's shipdata. I'm pretty sure it has both escorts and defense ships defined.

Note that you have used inconsistent keys in your question. defense_ship_role asks for a role, but escort-ship asks for a ship type (the unique name of its shipdata.entry). There is also defense_ship, which works analogous to escort-ship, asking for the unique shipdata-key; and escort-role, which asks for a role.

Of course you can use them as in your question. In that case the carrier would be escorted by one type of ship only, but would be able to launch a variety of defense ships in case of an attack (all those types that have the specified role in their role set).
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Compatibility questions

Post by JensAyton »

Lestradae wrote:
Second question, if I have js scripts and a script.plist with diverse XML scripts in the same oxp, what do I have to keep in mind so that they don't clash or cancel each other out?
Rename script.plist to uniqueprefix-something-else.plist, put it in the Scripts folder, and list it in world-scripts.plist.
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 »

And for the defense-ships ai you can best use a policeInterceptAI.plist when you don't want to write a custom AI. It does the same as the normal interceptAI but tries to dock when ready. It just has a badly chosen name, although it is used by the launching police defenders. stationDefenseAI.plist would have been better as name because it has nothing to do with police.
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

...

Post by Lestradae »

Thanks people,

First: the XML and Java mixing. So, if I understand that correctly, there are three things to be taken in account:

1. The scripts.plist has to be renamed into someuniquename.plist, listed in the worldscripts.plist together with eventual js scripts, and does no longer reside in the oxp's Config folder, but goes into the Scripts folder.

2. Java scripts go into the Scripts folder anyways and also have to be listed in the worldscripts.plist except if they are activated from the shipdata.plist, in which case they shall not be listed in the worldscripts.plist.

3. If a Java ship script is called from the shipdata.plist with ...
<key>script</key>
<string>SomeSortOfJavaScript.js</string>
... then "SomeSortOfJavaScript.js" should not be listed in the worldscripts.plist, yes?

Is all of the above correct?
Note that you have used inconsistent keys in your question. defense_ship_role asks for a role, but escort-ship asks for a ship type (the unique name of its shipdata.entry). There is also defense_ship, which works analogous to escort-ship, asking for the unique shipdata-key; and escort-role, which asks for a role.
I knew that one from the wiki. I did use escort-ship for I didn't want to have to create an AI for that specifically. I did use defense_ship_role because that's a ship someone gave me to use and it already has a custom built AI.

My problem is that for some reason the escorts never show up. I have no idea why, perhaps overlooking something glaringly obvious (again :? ) but one suspicion was that having defense ships and escorts together would perhaps constitute a problem. Thanks to Eric, I know now that the problem isn't that.
Of course you can use them as in your question. In that case the carrier would be escorted by one type of ship only, but would be able to launch a variety of defense ships in case of an attack (all those types that have the specified role in their role set).
That is my intention exactly, yes.
Rename script.plist to uniqueprefix-something-else.plist, put it in the Scripts folder, and list it in world-scripts.plist.
Thanks, done.
when you don't want to write a custom AI
Already have one ... perhaps will try with escort-role instead, perhaps there's a problem? Could use the escortAI perhaps?

Thanks for the tips so far,

L
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 »

All points correct. You can bundle all worldScripts in the "worldscripts.plist" (both plist and js). When you have a worldscripts.plist any script.js or script.plist in the config folder is ignored. When you do see them together, that is often to be compatible with older Oolite versions. Oolite 1.65 does not know about all that new js stuff and just uses the script.plist while Oolite 1.72 will use the new JS scripts.

On the escorts. Are they never there, or only sometimes? Oolite uses a random generator to see if it has to add escorts. In anarchie systems it is likely to add them while in confederates it is more likely is will not add escorts.
There are ways to force a ship to have always escorts (see the wiki), but I think this should only be used for special mission ships. In all other cases let oolite make the decision.

And with police ships there could be problems that escorts start wandering off after adding because they need a special role. With the behemoth I had to use tricks to let the escorts follow it. (With oolite 1.65 they will not follow their master)
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

...

Post by Lestradae »

Hi Eric,
Eric Walch wrote:
On the escorts. Are they never there, or only sometimes? Oolite uses a random generator to see if it has to add escorts. In anarchie systems it is likely to add them while in confederates it is more likely is will not add escorts.
They are very special escorts for very special ships that exclusively appear in a handful (eight) of handcrafted systems. The escorts are actually Juggernauts which use the Behemoth model. Perhaps there is a problem with an is_carrier ship as an escort?

The escorts never appear. I still have no idea why. All other things asked in this thread I already understand and implemented successfully but not those escorts. Usually, if I give ships escorts that works as intended.

The special systems are high-tech beyond TL 15. Perhaps the game engine treats that as ultra-secure and deducts all escorts on principle?
Eric Walch wrote:
There are ways to force a ship to have always escorts (see the wiki), but I think this should only be used for special mission ships. In all other cases let oolite make the decision.
I think I will have to force it then. Those ships are very special - there are only 16 of them in the whole Ooniverse, 2 per special system.

You know where I find this how-to force the escorts?
Eric Walch wrote:
And with police ships there could be problems that escorts start wandering off after adding because they need a special role. With the behemoth I had to use tricks to let the escorts follow it. (With oolite 1.65 they will not follow their master)
Hm, I use Scan Class MILITARY and role police for those ships, and a militaryAI I got from LittleBear's Assassin's. They are getting called by a further role (military) by my script.

I could make them system vessels/police, too, but that would not fit so well with their ingame purpose and you said there was also a problem with the police ships escorts.

The special role for police, you mean wingman? Is there such a thing as a wingman_ship command?

This is more complicated than I thought :?

L
Post Reply