Page 1 of 1

The Bare Minimum

Posted: Sun Aug 14, 2016 4:43 pm
by NEANDERTHAL
Can somebody tell me what the bare minimum is for a game-recognizable ship OXP? Please use Openstep.

Re: The Bare Minimum

Posted: Sun Aug 14, 2016 5:11 pm
by Smivs

Code: Select all

like_ship = <insert template here>;

Not as facetious as it might sound. If you are looking to define all of the ship's attributes, you will need something like one of the core-game ship templates, plus extra stuff if it is a one-off with any sort of extra features.
If you are coding shipdata from scratch, you might be better off borrowing an existing shipdata.plist and just substituting your figures/data over.

If you are talking about a whole OXP then it will depend on what it does and what's included. Take a look at the wiki and here.

Re: The Bare Minimum

Posted: Sun Aug 14, 2016 6:08 pm
by Griff
My OXP'ing is really rusty, but I think for an OXP using a custom ship mesh and texture, you need:
1. In Oolite's AddOns folder, a new folder for your oxp with a filename ending in .oxp
Image

2. Inside that, you need 3 Sub-Folders called Config, Models and Textures - These names are Case Sensitive
Image

3. It's inside each of these subfolders that your put your ships 'stuff',
. The shipdata.plist that describes your ship to Oolite goes in the Config subfolder
. Your ship's mesh (in Oolite's dat format) goes in the Models subfolder
. Your ships texture(s) or 'skin', these go into the Textures folder - These need to be in PNG format
Image

4. shipdata.plist - this is just a text file, if you're on a windows system it's best not to edit this using the default 'Notepad' app as it can add hidden formatting characters to the file which stop Oolite from reading it properly. A fantastic free text editor is Notepad ++ it's great as it can track and highlight 'bracket pairs' for you (forgetting to put in a closing bracket or quote is a popular syntax error I often do which stop my ships working)
For the actual contents of the shipdata.plist, I think at the very least you need to get a custom model and texture ship into the game is

Code: Select all

{       //  <- Very important opening bracket, all openstep plists need to start with one of these

// ++++++           Eample Ship                ++++++

// You can use two slashes followed by text to put comments in your file 

"ExampleShip" =   // Can be anything, but must be unique to avoid clashes when Oolite needs to load up ships for gameplay 
	{
	auto_ai = yes;  				// Set to yes so Oolite picks an appropriate AI for your ship based on its 'Role' - see below
	model = "ExampleShip.dat";   	// The filename for your ship mesh from the Models folder in your OXP (Case Sensitive)
	name = "Super Example Ship"; 	// How you want your ships name to appear, eg on the players HUD when they target it, or it sends out comms messages etc
	roles = "trader";   			// One of Oolite's standard roles, see the default shiplist at Resources\Config\Shipdata.plist for more examples
	};		
}  // <- Very important closing bracket, all plists need to end with one of these, although you can put comments on line after 
I think that's all you need to get the ship in game, to make it fun to play against you need to include more shipdata keys (for roll, pitch, energy etc), or do as Smivs suggests and like_ship it to one of Oolite's built in ships, your oxp ship will then inherit all of the stats from that ship apart for any ones you've specified in your shipdata.plist

Oolite caches OXP data for faster loading, so if you go back and edit any stats in your shipdata.plist etc, you'll need to flush out Oolite's cache and get it to re-read in your OXP, the way to do this is to hold down your keyboards Shift key soon after launching Oolite and keep it held down until the spinning cobra title screen appears