Page 1 of 2

Personalizing Ships

Posted: Sun Jul 03, 2011 9:32 pm
by mandoman
I'm back with another, probably already discussed, question, that I can't seem to find a thread that deals with. Is it possible to take your favorite ship, repaint it to your own specs (as I have already done), and then make it accessible to only yourself, not to the rest of the game? In other words, I want my personally painted ship to be the only one of it's type. Is that possible? Sorry, I really did look around, but I can't seem to find an answer.

Re: Personalizing Ships

Posted: Sun Jul 03, 2011 10:05 pm
by Commander McLane
Once you've bought it, set the chance key in its shipyard.plist to 0, and you'll never encounter it again in any shipyard.

Re: Personalizing Ships

Posted: Sun Jul 03, 2011 10:42 pm
by Eldon
You'll also need to change the name of your ship's version of the texture (the one you've already painted) to something like MyShip.png (keep the original so the game knows what the NPC versions of your ship are meant to look like), then add something like the following to the player ship version of your ship in shipdata.plist:

Code: Select all

	materials =
		{
			"MyShip.png" = { diffuse_map = "MyShip.png"; };
		};
This is mostly guesswork on my part, hopefully someone who has actually done something like this can give you more of a clue (or what I've got wrong), or tell you what that should look like if the shipdata.plist uses the <key>annoying</key><data>xml</data> format.

Re: Personalizing Ships

Posted: Mon Jul 04, 2011 12:23 am
by mandoman
Eldon wrote:
You'll also need to change the name of your ship's version of the texture (the one you've already painted) to something like MyShip.png (keep the original so the game knows what the NPC versions of your ship are meant to look like), then add something like the following to the player ship version of your ship in shipdata.plist:

Code: Select all

	materials =
		{
			"MyShip.png" = { diffuse_map = "MyShip.png"; };
		};
This is mostly guesswork on my part, hopefully someone who has actually done something like this can give you more of a clue (or what I've got wrong), or tell you what that should look like if the shipdata.plist uses the <key>annoying</key><data>xml</data> format.
Well, it was a good try. When I reintroduced the Texture merlin.png, and changed the name of the one I painted, the game used the original instead of mine, even though I put the above specifications into the shipdata.plist. McLane, I also changed the chance key in the shipyard.plist to 0. I haven't checked to see if there are any other merlins being offered, so it may have succeeded. Thanks for the suggestions. Anybody else know the trick to making my painted version the only one of it's kind in the game? It HAS to be something akin to what Eldon suggested, but I haven't figured it out. I wonder if, since I changed the chance key to 0, that if I left my painted merlin.png as the only one, mine would BE the ONLY one. Have to try it. Any other suggestions would be more than welcome.

Re: Personalizing Ships

Posted: Mon Jul 04, 2011 2:41 am
by mandoman
I tried designing my oxp of the Merlin, and failed. :lol:

It was worth a shot. That oxp writing is tricky. I can't even find who designed this ship, except the name Charlie, at the bottom of the ReadMe.txt. Charlie, if you're out there, would you help me figure this out? :oops:

Re: Personalizing Ships

Posted: Mon Jul 04, 2011 7:35 am
by Commander McLane
Charlie has left the boards long ago. Also, taking one of his OXPs as a starting point can be tricky, because many of them are sprinkled with a considerable number of assorted bugs.

What did you fail at? Some of the basics to keep in mind are:
  • Whenever you have changed something inside an OXP (usually in a plist or script) and want to see the result, you have to hold down SHIFT while you restart Oolite, until you see the spinning Cobra III.
  • After (or during) each test run, keep an eye on Oolite's log file, which is conveniently named latest.log. This will show you all error messages related to the scripts you have fiddled with, and then some. If something went wrong, this is where you'll get the first hint what it was.

Re: Personalizing Ships

Posted: Mon Jul 04, 2011 8:28 am
by kgs
I created a small OXP to help with adding a custom ship texture. This will modify the default Player Cobra, and it will not appear on NPC ships.

The relevant code, which will be in a file named shipdata-overrides.plist, is as follows:

Code: Select all

{
        "cobra3-player" =
        {
                materials =
                {
                        "cobra3_redux.png" = { diffuse_map = "cobra3_custskin.png"; };
                };
        }
}
cobra3_redux.png is the default texture, cobra3_custskin.png is the custom texture which will replace it.

Here it is: http://kgsuarez.tk/oolite/oxp/cobra3_custskin.zip

EDIT: I would like to clarify a thing or two.

First of all, using this method only changes the default texture for the default Player Cobra. You will not need to worry about purchasing the ship, the texture will just be there the next time you start the game. Also, make sure that you reset the game's cache by holding down the shift key while starting the game. This little OXP is, in my opinion, the best way to add a custom paint job to your ship.

If your favorite ship is not the Cobra you will need to change the appropriate parts of the config file. This should be fairly straightforward, but please do ask me for help if you need it. I would be glad to explain it in more detail if need be.

Re: Personalizing Ships

Posted: Mon Jul 04, 2011 8:50 am
by Smivs
Mandoman,
Last year I issued a beta (proof of concept) OXP which allowed you to re-skin the standard Cobra using a selection of 'mix and match' components. I never got round to a full release but the beta is still available.
See here.

Re: Personalizing Ships

Posted: Mon Jul 04, 2011 9:17 pm
by Commander Wilmot
I did this with my Vampire MK.IV Diamondback. The way I did was that I went to the shipdata.plist. I found the entry where the player version of the diamondback was and then I modified the model to a copy of the original model. I then set the new model to refer to a playerdbacktexture image, which would be any image I choose; I tried re-skinning the model for myself, but I decided the best skin was a copy of the military diamondback texture. Shift-f while loading didn't help, I had to un-installed the oxp, load oolite, then exit, re-install the oxp, and load it again before it worked. Note: this method will only work if the ship has a separate entry in the shipdata.plist for the player version of the ship.
So, I went from this:
Image
to this:
Image

Re: Personalizing Ships

Posted: Mon Jul 04, 2011 10:16 pm
by Commander McLane
Commander Wilmot wrote:
Note: this method will only work if the ship has a separate entry in the shipdata.plist for the player version of the ship.
Every player ship is a separate entry in shipdata. If there is no shipdata-entry, there is no ship.

Re: Personalizing Ships

Posted: Mon Jul 04, 2011 10:57 pm
by mandoman
OK, first, this is some good stuff. That Diamondback is awesome, by the way. Anyway, what I did was took everything from the merlin.oxp, copied each item (txt, png, etc.), and then systematically replaced everything in all of those documents/pngs/plists referring to the merlin with mandomerlin. Corny, but to the point. So, in the shipdata.plist, every time a reference to the merlin was made, I simply add "mando" behind the word "merlin". I did likewise with all the other plists, dats, and put my painting png image into the Texture folder, leaving the original merlin.png in the merlin.oxp Texture file. To make a long story short, my oxp shows up in the Latest.log as an oxp. At least it says that it was loaded, but I have hit several systems in a normal Merlin, and still haven't found "MY" Merlin. I'm not sure what that's all about. If it is loading as oxp, shouldn't I be able to find it relatively quickly in a Space Station shipyard sale? If it would help, I could zip my oxp, and send it to someone willing to take a look at it. Maybe you can tell what is going on, where I can't see anything happening. If there is a different way, I'm open to suggestions, but until then, I continue to experiment. Curiosity didn't just kill the cat? :D

Oh, Smivs, I will give that beta a shot. Thanks. :)

Re: Personalizing Ships

Posted: Mon Jul 04, 2011 10:59 pm
by Smivs
If you've made it the player ship, have you looked at yours? The external views.

Re: Personalizing Ships

Posted: Mon Jul 04, 2011 11:08 pm
by mandoman
Smivs wrote:
If you've made it the player ship, have you looked at yours? The external views.
Yeah, in fact, I didn't even make a general version of the madomerlin, just a player version. I left the descriptions.plist out, as I didn't see the point of associating it with the mandomerlin. Maybe that was a mistake. The external views merely show the normal merlin. Maybe the problem is in the fact that I have a "Merlin" in the game, NOT a "MandoMerlin". I don't know. Is there some way to finagle the loading process, so that it associates the mandomerlin with me, the player, instead of the regular merlin?

Re: Personalizing Ships

Posted: Mon Jul 04, 2011 11:16 pm
by Eldon
Hopefully I can do slightly better with this one..
Somewhere in your save file should be something that looks a bit like this:

Code: Select all

    <key>ship_desc</key>
    <string>merlin-player</string>
I think if you replace it with:

Code: Select all

    <key>ship_desc</key>
    <string>mandomerlin-player</string>
I believe you should see the results of your hard work.

Re: Personalizing Ships

Posted: Mon Jul 04, 2011 11:38 pm
by mandoman
Thanks Eldon, but I already nailed it. Smivs gave me the brain rush that sent me to the correct solution. He asked if I had looked at my external views, to see if the ship had changed to the mandomerlin, and it dawned on me (after some thinking on the matter) that maybe I should tag something on the end of the "external_view" secttion in the shipdata.plist, and BINGO!!! I reloaded Oolite, holding down the Shift Key, and when I pulled up the merlin, it came up as the mandomerlin, LOL!!!! Here's what I added:

</dict>
<key>view_texture</key>
<key>mandomerlin.png</key>
</dict>

It's basically the same as all the rest of the "external views" stings, like this one,

<dict>
<key>view_description</key>
<string>External View 8</string>
<key>view_position</key>
<string>-75 10.0 -75</string>
<key>view_orientation</key>
<string>0.9239 0.0 -0.3827 0.0</string>
<key>weapon_facing</key>
<string>FORWARD</string>
</dict>

That is radically cool!! I have GOT to try writing one of these oxps, sometime. I realize it may be a while, as I don't even have a ship design, or anything like that, yet. I also need to pay close attention to the oxp tutorials. Whatever, I got my own version of the Merlin. It should be the only one out there. :D