Wrong texture displayed on a "new" ship

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
Darknirv
Average
Average
Posts: 14
Joined: Sun Jun 16, 2013 1:24 pm

Wrong texture displayed on a "new" ship

Post 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?
User avatar
JazHaz
---- E L I T E ----
---- E L I T E ----
Posts: 2991
Joined: Tue Sep 22, 2009 11:07 am
Location: Enfield, Middlesex
Contact:

Re: Wrong texture displayed on a "new" ship

Post 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.
JazHaz

Gimi wrote:
drew wrote:
£4,500 though! :shock: <Faints>
Cheers,
Drew.
Maybe you could start a Kickstarter Campaign to found your £4500 pledge. 8)
Thanks to Gimi, I got an eBook in my inbox tonight (31st May 2014 - Release of Elite Reclamation)!
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: Wrong texture displayed on a "new" ship

Post 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
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Wrong texture displayed on a "new" ship

Post 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.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Darknirv
Average
Average
Posts: 14
Joined: Sun Jun 16, 2013 1:24 pm

Re: Wrong texture displayed on a "new" ship

Post 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.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Wrong texture displayed on a "new" ship

Post 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.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Darknirv
Average
Average
Posts: 14
Joined: Sun Jun 16, 2013 1:24 pm

Re: Wrong texture displayed on a "new" ship

Post 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.
Post Reply