Page 1 of 1

Wrong texture displayed on a "new" ship

Posted: Tue Jun 25, 2013 9:06 am
by Darknirv
Hey all!

I'm trying to make a new ship. I say new ship, but it's really a heavily modified Yelloo Taxi by Smivs (basically making a none taxi version, nice work by the way Smivs). It's taken me a while but I've finally got it working ingame and have bought one and am wizzing around in my own ship, very satisfying.

I am having an odd problem though. The ship is displaying the Constrictor texture, despite me modifying the texture so it looked different (placeholder for now really until I get it working properly). I've pointed the .dat to the new texture, and the only mention on the constrictor texture is the line that says who the texture was made by and where first used. This line is also in the Taxi's model file. Every single .plist also points to the new texture, but nothing seems to work. So I'm a bit lost right now. I'll admit, I've never coded before, so I thought this would be a fairly simple way to start off.

Any help?

Re: Wrong texture displayed on a "new" ship

Posted: Tue Jun 25, 2013 10:32 am
by JazHaz
Are you sure that you've got all the filenames spelled correctly and pointing to the new texture in the shipdata.plist?

It's worth checking that the capitalisation is the same throughout, especially if you are using Linux or a Mac.

Finally did you reload Oolite with the Shift key held down to flush the OXP cache? If you are making regular changes to an OXP its worth setting the option to always flush the cache on loading, by editing the .GNUStepDefaults file. See the [wiki]Hidden Settings in Oolite[/wiki] page on the wiki for more info.

Re: Wrong texture displayed on a "new" ship

Posted: Tue Jun 25, 2013 10:41 am
by Griff
Have a look at the Materials documentation on the wiki, [wiki]Materials_in_Oolite[/wiki] they're great for doing texture swaps on ships.
eg, if you just want to change a texture on an already existing oxp ship, what you could to is make an new oxp folder, and in it just have the
'Config' and 'Textures' folders. Put your new texture skins in the Textures folder and create a new shipdata.plist in the Config folder with something like this in it:

Code: Select all

{
"Darknirv_yellOo-cab_reskin" =   // <- make sure you give your ship a unique name so it doesn't clash with the original
	{
		like_ship = "yellOo-cab-taxi-1"; // copy over to your ship all of the yellOo-cab-taxi-1 ship settings,
                                     // but any keys you add below will overwrite any copied ove, useful if you want
                                     // your ship to have a different max_speed or max_energy etc to the original.

		"is_external_dependency" = yes;
		materials = 
			{ 
				"contract-a-cab.png" = // <- if you edit the texture referenced in the dat file then edit this line to match.
										{  
					diffuse_map = "my_new_texture.png";  // <- change the filename to your texture file
					emission_map = "contract-a-cab_em-map.png";
					normal_map = "contract-a-cab_normal.png";
					specular_map = "contract-a-cab_specular.png";
					shininess = 75;
					specular_color = ( 0.1, 0.1, 0.1, 0.1 ); 
										};  
			};
		model = "contract-a-cab_redux.dat";
		name = "YellOo Cab";
		roles = "trader";
	};
}
The above will load up a copy of a Smivs YellOo Cab but swap the diffuse texture (the texture 'skin') for a different image called my_new_texture.png (i've written comments on the relevant lines in the above code) - Doing texture swaps with this method means you don't need to modify the textures referenced in the dat file or anything like that, but if you do then you also need to edit the above code so that the first instance of "contract-a-cab.png" is the same as what is written in the dat
Plus you can also substitue different 'emission_map' or 'normal_map' files too just by editing the filenames in the above code

Re: Wrong texture displayed on a "new" ship

Posted: Tue Jun 25, 2013 12:02 pm
by Smivs
Hi Darknirv,
Firstly, welcome to the Dark Side (tinkering with OXPs) :D
Follow the advice above and you should be OK, although as yours is a player ship you might be best to 'like_ship' to the player version ("yellOo-cab-player") rather than the NPC "yellOo-cab-taxi-1". This will give you the external views etc which are unique to the player version.
Let us know how you get on, and post a pic when it's done.

Re: Wrong texture displayed on a "new" ship

Posted: Wed Jun 26, 2013 12:38 am
by Darknirv
Thanks for all the replies!

JazHaz: Yes I have checked and double checked all spellings and capitals, as I am using Linux I was aware of this, infact I wish I never put a capital letter at the beginning :P . I have also been holding shift at startup, so I know it's loading up with all the OXPs installed.

Griff: Thanks for the extra OXP idea, I'll give this a go if all else fails.

Smivs: I'll try and fit that 'like_ship' line in, though I'm a bit tired right now so will check it when I get a more awake chance. I don't think I have a 'like_ship' in there at the moment :? All my external views are working fine on the player ship, just shows the wrong texture.

I am planning on posting this OXP up at some time, just want to get all the kinks worked out and get a texture drawn up that I'm happy with and fits look and feel of the other ships. Really doing this in my ultra-rare spare time so it's slow going, gotta start somewhere I suppose.

Re: Wrong texture displayed on a "new" ship

Posted: Wed Jun 26, 2013 7:55 am
by Smivs
Darknirv wrote:
Smivs: I'll try and fit that 'like_ship' line in, though I'm a bit tired right now so will check it when I get a more awake chance. I don't think I have a 'like_ship' in there at the moment :? All my external views are working fine on the player ship, just shows the wrong texture.
You currently have the external views as you have adapted the original OXP. What I meant was that if you follow Griff's advice and 'like_ship' to the original YellOo Cab with a new shipdata.plist, refer to the player version, not the NPC version.
If you want to post the OXP somewhere so I can download it, I'll take a look and point you in the right direction.

Re: Wrong texture displayed on a "new" ship

Posted: Mon Jul 01, 2013 3:47 pm
by Darknirv
I'd love to post it up somewhere, but life has gone crazy right now, so I'm going to focus on that for a while. I really picked the wrong time to start learning to program as I'm learning technical short-hand right now (dyslexic draw back of learning one new way of reading at a time).

When I do get some time, I'll post it up somewhere and people can point and laugh/correct.