OXP howto

From Elite Wiki
Revision as of 13:12, 17 November 2011 by Eric Walch (talk | contribs) (Shipdata.plist Verifier)
OXP icon

Overview

An Oolite Expansion Pack can cause many big changes or additions to Oolite's gameplay, or it may represent just a small, subtle alteration. By appearances, there is no way to tell what is inside, as it's merely a folder with the added extention .oxp.

Inside, it will at least contain a folder (Config, AIs, Models, Textures, etc...) that holds scripts, plists or other things like textures or models. It is down to the goal of the OXP, which ways to combine elements to the OXP's contents. To get a feeling for it, simply take a look in other oxps.

AIs

The folder named AIs contains any AI.plist additions the OXP might use.

Config

All plist files except for those introducing new AIs, requires.plist or info.plist, belong in Config.

In its simplest form, an OXP could contain only a Config with an altering script.plist or planetinfo.plist. An OXP that adds a new ship needs a shipdata.plist entry, and unless it is based entirely on existing Oolite data, would include a model and texture.


This folder contains Property lists such as:

Deprecated:

  • script.oos was briefly introduced during 1.70 development but is now deprecated in favour of JS.)

Shipdata.plist Verifier

Oolite has what amounts to a spell checker for shipdata.plist, called the OXP verifier. It can currently only be invoked from the command line.

On Windows or Linux: Code: oolite.app/oolite --verify-oxp <path to OXP>

On Mac OS X: Code: Oolite.app/Contents/MacOS/Oolite --verify-oxp <path to OXP>

Most mac users will not be familiar to using the command line. Look inside your application folder for a tools folder. Inside that you will find a program called terminal. Run it.Now drop the oolite application on the window. That will generate the path to oolite in the window. Delete the trailing space and paste the following text - including the trailing space- behind it: "/Contents/MacOS/Oolite --verify-oxp ". Now drop the oxp to test on the folder. That will again create the path to the oxp behind the last entry. When you hit the <return> key, the verification will start. It should now open the console program, showing the results.

Models

Oolite models need to be in the .dat format. There are utilities available that convert models made in Wings 3D (.obj) and Meshwork (.mesh) into this. A .dat file can be opened in a plain text editor to view the object's assigned texture names and see that they correspond with the actual file names in the Textures folder. The .dat file must be named exactly as it is referenced in the shipdata model entry - case sensitive!!!

Textures

Oolite's textures are in the .png format, usually at a standard 512x512 size, and must be named exactly as they are named in the .dat file.

Viewing a specific texture and / or model in Oolite. "I made one. How do I proof it?"

Requires

Every oxp should contain a Property lists with the name requires.plist that is placed at the main level of the oxp folder. It contains just a dictionary with two entries: version and max_version. version is the lowest Oolite version the code can run on. This ensures that older Oolite versions don't behave bad or crash because they load an oxp that does contain unknown stuff. The max_version is only needed when you want an oxp to not run with newer Oolite versions. Very useful for adding in test versions of an oxp to ensure this test version is not used forever.

The structure for OXPs:

AddOns (folder)
-.oxp (folder) - Holds requires.plist and info.plist and the other folders
--> AIs (folder) - Holds AI.plists
--> Config (folder) - Holds all other plists
--> Images (folder) - Holds background images
--> Models (folder) - Holds the .dat files
--> Music (folder) - Surprise - holds music files
--> Scripts (folder) - Holds scripts (worldScripts and shipScripts)
--> Shaders (folder) - Holds Vertex and Fragment shaders (v1.69)
--> Sounds (folder) - Holds sound files
--> Textures (folder) - Holds models textures

Scripting with JavaScript

For current test releases (Oolite 1.75.x and above) JavaScript is the preferred scripting interface for worldScripts and shipScripts. The legacy scripting interface (see script.plist) is still supported. See Scripting Oolite with JavaScript for more information.

See Also

External links