Not sure if i'm missing something obvious but this is something i've come across w/ my Venom, that i meant to bring up during testing my Dominatrix, and forgot
anyways, i've noticed Oolite seems to take the skin texture listed in the DAT over the shipdata entry - what's the reason for that? it's increased the size of my OXP (perhaps negligably, but still) as i now need multiple copies of the dat. i've got, eg, a red skin, blue skin and green skin. if i set up the shipdata as all using simply "venom.dat", as they're all the same ship obviously, they all get the standard skin in the DAT : to get around this i had to copy the DAT and search/replace the texture name in each, and set the shipdata to point at "redvenom.dat", "bluevenom.dat" etc.
just seems a roundabout way of doing things? how come the shipdata doesn't override this?
Multiple Ship Variants
Moderators: winston, another_commander
- Killer Wolf
- ---- E L I T E ----
- Posts: 2279
- Joined: Tue Jan 02, 2007 12:38 pm
You can use the materials shipdata key to "dye" a given ship texture a different colour, or to chose which texture file gets used. Not ideal either, but can be quite useful if you set things up correctly.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
An example makes it probably more clear:
In ups I only have one .DAT file for the ups-barrel, defining a "upsRedBarrel.png" texture. Than, for the other barrels I use a definition in materials to replace upsRedBarrel.png by upsGreenBarrel.png for that barrel.
Code: Select all
"ups-barrel1" = {
"like_ship" = "ups-barrel";
materials = {
"upsRedBarrel.png" = {
"diffuse_map" = "upsGreenBarrel.png";
shininess = 10;
specular = ("0.3", "0.3", "0.33", "1.0");
};
};
roles = "cargopod(0.11)";
};
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Killer Wolf
- ---- E L I T E ----
- Posts: 2279
- Joined: Tue Jan 02, 2007 12:38 pm
What eric listed is one way of overwriting the texture,Killer Wolf wrote:well y'bugger. another whole aspect of the game i didn't know about!
cheers for that info, i'll play around w/ the next OXP i do.
if you're using shaders it's pretty much the same thing, only lengthier cause of more options. eg:
(shaders can be tricky to work with, i suggest reading up on the wiki about shaders in oolite... if you can't use shaders on your comp, ignore this post)
Code: Select all
shaders =
{
"original_texture.png" =
{
"vertex_shader" = "insert-vertex-filename-here";
"fragment_shader" = "insert-fragment-filename-";
textures =
(
"new_texture.png",
"new_textures_effectsmap.png",
"new_textures_normalmap.png"
);
uniforms =
{
uColourMap = { type = texture; value = 0; };
uFXMap = { type = texture; value = 1; };
uNormalMap = { type = texture; value = 2; };
SpecularRGB = { type = vector; value = "1.0 0.7 0.5 1.0";};
uTime = "universalTime";
uEngineLevel = "speedFactor";
uHullHeatLevel= "hullHeatLevel";
};
};
};
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Interestingly enough, I did the same thing in Oolite’s own shipdata.plist just a few weeks ago, e.g.:
This is possible thanks to the materials model introduced in 1.69, which also allows you to add a variety of effects without writing your own shaders.
Code: Select all
"cobramk1-alt" =
{
like_ship = "cobramk1";
ai_type = "pirateAI.plist";
energy_recharge_rate = 3.75;
forward_weapon_type = "WEAPON_BEAM_LASER";
has_fuel_injection = 0.25;
has_shield_booster = 0.25;
max_energy = 200;
materials =
{
"cobra1_redux.png" = { diffuse_map = "cobra1_redux1.png"; };
};
roles = "pirate";
thrust = 30;
};
E-mail: [email protected]