Or if you know the list of textures you want to chose from to apply to the ship you can change texture on-the-run using JS.
Via the setMaterials command. See also here for details of materials usage in the game.
A simple example is in my Butterlies demo oxp, although that changes the texture colour on the fly rather than the texture itself (although the principle is the same).
Well I have made it all now in 2 hours and 45 minutes the full shipdata.plist is finished using likeships and templates... however, like with most of my oxps there is a problem. before I changed the shipdata file it was fine, and yes I did hold down shift and when that didn't work I moved it out of the folder, started the game then put it back and restarted it. but it still didn't work which makes me think my programing skills are showing again.
is there an easy way of testing for errors in it or do I have to go through all 1148 lines of it?
<edit> oops, I just noticed that I forgot to include the:
}
on the end
<edit2> that didn't help... it still is refusing to work
it looks like in your code you're only listing the first texture (which should be the one referenced in your models .dat), try adding in the { diffuse_map: "texture2.png" } bit, eg
it looks like in your code you're only listing the first texture (which should be the one referenced in your models .dat), try adding in the { diffuse_map: "texture2.png" } bit, eg
Thanks Griff, diffuse_map or emission_map works fine. What I was trying to do was to change texture file completely to a new one. I don't know if it posible, if not I will use either one of the above.
The "texture file" in the sense that I think you mean is the diffuse map. So if you set the diffuse map as Griff suggested, then you are essentially changing the texture. Unless of course you are using it as one of the other maps (emission or normal etc) then substitute the relevant map type in the command.
If by "texture file" you are meaning diffuse, emission and normal map, then you need to change the components individually. But for many ships the "texture file" is the diffuse map (possibly with others, but the diffuse is the main one).
That's right. The .dat specifies the diffuse_map. The materials can replace this and specifies other things like the emission_map and shininess and specular.
This example is from my shipset, which has a special Adder for the 'scavenger' role.
The diffuse_map 'smivs'-adder.png' is specified in the .dat file.
If no materials were specified in the shipdata.plist, tha Adder (both varieties) would appear with just the 'smivs'-adder.png' texture but no emission_map or shininess/specular.
Commander Smivs, the friendliest Gourd this side of Riedquat.
The "xyz.png":{} is only the identifier for Oolite which material should be altered and must match the models material. It's usually (but not always) the same as the diffuse_map.