This is probably a bit off topic, but anyway...
I'm not a modeller, so I can't tell you how to create the .dat files, or how to create textures or normal maps or anything like that. What I can tell you is how to pull all the components together.
In your "AddOns" folder, create a new folder with an ".oxp" extension. For this example I'll use "MyShip.oxp"
Inside "MyShip.oxp", create a subfolder called "Config", another one called "Models", and another called "Textures"
The structure should now look like this:
- Addons
-- MyShip.oxp
--- Config
--- Models
--- Textures
Put your .dat files into the "Models" folder, and any texture png files should go in the "Textures" folder.
Next, in the "Config" folder, create a "shipdata.plist" file, and a "shipyard.plist" file. These should be standard text files (if you're on Windows, avoid using Notepad as it has been known to mess up files).
The entry you add into shipdata.plist essentially pulls together all the components from Models and Textures to create an entity that can be used in-game. In it you define all the properties the ship will have (like maximum energy, maximum number of missiles, etc). See the
shipdata.plist wiki page for details on all the options for this entry.
There are a couple of key components you will need, though. In this example, I'm assuming you aren't using custom shaders - this example will just use the default shaders. I'm also just creating a player ship here, not an NPC one yet:
Code: Select all
{
"myship_definition" = {
...snip...
materials = {
"Hull" = { // if your .dat file has a text key for textures, you should use it here instead of "Hull"
diffuse_map = "myship_diffuse.png";
normal_map = "myship_normal.png"; // if you have a separate normal map
emission_map = "myship_emission.png"; // if you have a separate emission map
specular_map = "myship_specular.png"; // if you have a separate specular map
specular_color = (0.4, 0.4, 0.4);
shininess = 25; // for backward compatibility with Oolite 1.86 and previous
gloss = 0.5; // for Oolite 1.87ff
};
};
model = "myship_model.dat";
roles = "player";
...snip...
};
}
Finally, you'll need to create a matching entry in the shipyard.plist file. See the
shipyard.plist wiki for details on all the options. Something like this:
Code: Select all
{
"myship_definition" = {
"chance" = 0.5;
"optional_equipment" =
(
"EQ_ADVANCED_COMPASS",
"EQ_CARGO_BAY",
"EQ_DOCK_COMP",
"EQ_ECM",
"EQ_ENERGY_BOMB",
"EQ_ENERGY_UNIT",
"EQ_ESCAPE_POD",
"EQ_FUEL_INJECTION",
"EQ_FUEL_SCOOPS",
"EQ_GAL_DRIVE",
"EQ_HEAT_SHIELD",
"EQ_MULTI_TARGET",
"EQ_NAVAL_ENERGY_UNIT",
"EQ_NAVAL_SHIELD_BOOSTER",
"EQ_PASSENGER_BERTH",
"EQ_SCANNER_SHOW_MISSILE_TARGET",
"EQ_SHIELD_BOOSTER",
"EQ_WEAPON_BEAM_LASER",
"EQ_WEAPON_PULSE_LASER",
"EQ_WEAPON_MILITARY_LASER",
"EQ_WEAPON_MINING_LASER"
);
price = 500000;
standard_equipment = {
forward_weapon_type = "EQ_PULSE_PULSE_LASER";
missiles = 2;
};
techlevel = 8;
weapon_facings = 15;
};
}
For testing, you might like to change the "chance" value to "1", and the "techlevel" value to 0, so that you'll be able to buy the ship anywhere.
That should get your ship in the game. You can also use the Oolite debug console to view your ship, using the command
:test [myship_definition]
.
To keep this simple I've left off adding NPC versions of your ship. Maybe once you're up and running with a player ship I can add the extra details for the NPC's. Or you can look in one of the other ship OXP's to see how it's done.
Hope that helps a little, anyway.