The Seraphim - A custom Ship OXP from start to finish.
Moderators: winston, another_commander
You don't need to specify a model in the like_ship if there is one in the original template (the ship that the like_ship refers to) for the new one to inherit. All you need is a role, but then if it didn't have that it would be rather pointless to do the exercise.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Basically all like_ship does is takes the keys from the template ship (the one the like_ship key points to) and applies them to the ship in question (the one with the like_ship key in its shipdata). Then any other keys in that shipdata are applied, which can either add to or overwrite the ones from the like_ship.
It's a quick way of making very similar ships without having to write a lot of identical shipdata multiple times.
It's a quick way of making very similar ships without having to write a lot of identical shipdata multiple times.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Okay, it sounds as if Like_Ship will be handy. thanks.
Right then. Let's start off with something simple.
Before I get mired in shaders, I'll try and set up a simple material from the Shipdata.Plist first.
I had a read through the wiki which lists the commands and tells you what they're for, but doesn't really explain how to use them.
I've taken a stab in the dark and written this out as part of the viper data in the Plist:
Once I'd remembered to put a colon after the last bracket, the Seraphim showed up again, but doesn't seem to be using anything resembling a shader.
I tried removing the shader lines. I tried adding a specular map. Neither made any difference.
I am starting Oolite with the shift key to make sure it clears.
What am I doing wrong?
Crow
Right then. Let's start off with something simple.
Before I get mired in shaders, I'll try and set up a simple material from the Shipdata.Plist first.
I had a read through the wiki which lists the commands and tells you what they're for, but doesn't really explain how to use them.
I've taken a stab in the dark and written this out as part of the viper data in the Plist:
Code: Select all
materials =
{
vertex_shader="oolite-default-shader.fragment";
fragment_shader="oolite-tangent-space-vertex.vertex";
diffuse_map="seraphim.png";
normal_map="seraphim_n.bmp";
};
I tried removing the shader lines. I tried adding a specular map. Neither made any difference.
I am starting Oolite with the shift key to make sure it clears.
What am I doing wrong?
Crow
Okay, following the example in Asteroid Storm I've set the materials up like this: I've had to convert from XML to Open Step but as far as I can see, I think this is right.
Still no difference.
Crow
Code: Select all
materials =
{
diffuse_map="seraphim.png";
normal_map="seraphim_n.bmp";
specular_map="seraphim_s.bmp";
shininess=30;
};
Crow
Last edited by Scarecrow on Wed Mar 03, 2010 9:53 am, edited 1 time in total.
-
- Quite Grand Sub-Admiral
- Posts: 6682
- Joined: Wed Feb 28, 2007 7:54 am
When you have situations where changes involving shaders don't seem to work or produce a completely shaderless result, always have a look at the Latest.log. You will very likely have shader compilation errors which could contain hints and/or the actual line number in the shader where the errors occured.
From just a quick look, it seems that you have cross-set the vertex and fragment shaders. Also, I don't think you should be really invoking the default Oolite shaders there. I believe they are used internally whenever shaders are enabled.
From just a quick look, it seems that you have cross-set the vertex and fragment shaders. Also, I don't think you should be really invoking the default Oolite shaders there. I believe they are used internally whenever shaders are enabled.
Okay, thanks. As I say, following the Asteroid Storm example, I've removed the references to the shaders. However this still makes no difference.
I've checked the latest.log and can't see anything obvious. I can't see the words 'error' or 'fail' anywhere. What should I be looking for?
As an aside, I'm checking the ships in the front end, where it cycles through all the ship types in the game. I'm assuming that the shaders would be working in this part of the game?
Crow
I've checked the latest.log and can't see anything obvious. I can't see the words 'error' or 'fail' anywhere. What should I be looking for?
As an aside, I'm checking the ships in the front end, where it cycles through all the ship types in the game. I'm assuming that the shaders would be working in this part of the game?
Crow
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Just to point out the painfully obvious:
Are you restarting Oolite while holding down the SHIFT-key?
All shipdata-information are stored in Oolite's cache and not reloaded when you simply quit and restart the game. Oolite recognizes that something has changed only if you install or de-install a complete OXP, in which case it will trash its cache and build another one on game start, incorporating the changes.
However, if you only edit something within a OXP (and save your changes, of course), Oolite will continue to use the old version from its cache on game start, unless you flush the cache manually, which is achieved by pressing SHIFT as soon as you have clicked the icon, and hold it until you see "Loading shipdata..." on your screen.
Are you restarting Oolite while holding down the SHIFT-key?
All shipdata-information are stored in Oolite's cache and not reloaded when you simply quit and restart the game. Oolite recognizes that something has changed only if you install or de-install a complete OXP, in which case it will trash its cache and build another one on game start, incorporating the changes.
However, if you only edit something within a OXP (and save your changes, of course), Oolite will continue to use the old version from its cache on game start, unless you flush the cache manually, which is achieved by pressing SHIFT as soon as you have clicked the icon, and hold it until you see "Loading shipdata..." on your screen.
-
- Quite Grand Sub-Admiral
- Posts: 6682
- Joined: Wed Feb 28, 2007 7:54 am
Your earlier definition of material seems wrong to me. Taken straight out of Oolite's internal shipdata, here is how materials are defined (example for barrel):
"materials" is a dictionary containing dictionaries.
Code: Select all
materials =
{
"barrel_metal.png" =
{
shininess = 10;
specular = ( 0.3, 0.3, 0.33, 1.0 );
};
"left_metal.png" =
{
shininess = 10;
specular = ( 0.3, 0.3, 0.33, 1.0 );
};
};
That doesn't seem to be the case on the Asteroids which are set out like this:
Crow
Code: Select all
<dict>
<key>astorm01.png</key>
<dict>
<key>normal_map</key>
<string>astorm01_normal.png</string>
<key>specular_map</key>
<string>astorm_specular.png</string>
<key>shininess</key>
<string>30</string>
</dict>
</dict>
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
specular_map = {name = "seraphim_s.bmp"; shininess = 30.0;}
edit: this is massive wrongness!
Also, is oolite happy using bmp's for textures, don't they have to be png's? i'm not sure about this either though, just guessing really.
If you'd much prefer to just concentrate on the art i can whip up a shader for you that would just use a diffuse, normal & specular map with the specular intensity tweakable using an uniform in the shipdata.plist, although it is fun sometimes getting these things working on your own
Last edited by Griff on Wed Mar 03, 2010 11:44 am, edited 2 times in total.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
It is the same as in asteroid storm. The first key is the name of the texture file used in your mod file. Within that key the effect maps are defined. So stick to the example of another_commander. Or look in the dredgers2.4.oxp. There I wrote the materials directory with speculars and normal maps all in open step.Scarecrow wrote:That doesn't seem to be the case on the Asteroids which are set out like this:
(Asteroid storm has xml definitions to keep it compatible with old 1.65 Oolite)
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Once again, thanks everyone. Griff, that is awfullytempting, but I think I would like to figure this out. If something works, I prefer to understand why
Okay, so now I've written it out like this:
And the Seraphim has stopped showing up, which usually means it's found something it doesn't like.
The log gave me this:
The line it's talking about is in a section directly after the materials which works normally usually, so I'm assuming that the problem is with the materials code. I can't see any missing colons though, and it's got the right number of brackets etc.
Crow
Okay, so now I've written it out like this:
Code: Select all
materials =
{
"seraphim.png" = {shininess=30;
normal_map="seraphim_n.png";
specular_map="seraphim_s.png";
};
};
The log gave me this:
Code: Select all
[plist.parse.foundation.failed]: Failed to parse ../AddOns/seraphim.oxp/Config/shipdata.plist as a property list using Foundation. Retrying using homebrew parser. WARNING: the homebrew parser is deprecated and will be removed in a future version of Oolite.
Parse failed at line 52 (char 1657) - extra data after parsed string
[plist.homebrew.parseError]: Property list isn't in XML format, homebrew parser can't help you.
Crow