Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Easier Player Ship Customization

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

User avatar
Captain Berf
Competent
Competent
Posts: 55
Joined: Mon Nov 09, 2009 1:19 am
Location: USA, 1.5 Miles Up

Easier Player Ship Customization

Post by Captain Berf »

Just an idea.

For any

shipFoo_Texture.png

there could exist

shipFoo_Texture_PLAYER.png

that would be loaded for just the player ship.

It shouldn't break anything currently existing.

This would end the need to modify save files (unless I'm missing some easier way).
__________
______
Captain Berf
User avatar
Sendraks
---- E L I T E ----
---- E L I T E ----
Posts: 404
Joined: Tue Jun 02, 2009 1:43 pm
Location: Leeds UK

Post by Sendraks »

I think I see what you're suggesting here, at present the process I have for creating a unique player ship texture.

1- Create new oxp folder with the player ship name e.g. blackdove.oxp
2 - Create relevant sub folders config, textures, models and insert ship files.
1 - Modify existing ship texture/create new texture.
2 - Save that, give it player ship specific name e.g. blackdove.png to the textures folder.
3 - Open the model dat file in your new oxp folder. with a text editor and change the name of the texture file associated with the model to whatever your new texture is called. Save that.
4 -Open the shipdata config file and change the ship names from whatever the stock is i.e. cobramkiii and Cobra MK III to whatever you want your personal vessel to be called, ensuring naming conventions are consistent with all other file names. Save those changes.
5 - Do the same for the shipyard file and change the settings in the shipyard file so that the ship can never be "for sale" anywhere, i.e. set TL to 99.
6 - And any other config files with name data.
7 - Change the current ship in the save game you want to have the new player ship.
8 - Everything should work.

This isn't a short process, although it is probably a bit more specific as it is for creating a player specific ship with a player specific texture and a specific name, rather than just having a Cobra MK III with a texture unique to the player.
User avatar
Captain Berf
Competent
Competent
Posts: 55
Joined: Mon Nov 09, 2009 1:19 am
Location: USA, 1.5 Miles Up

Post by Captain Berf »

Wow. Excellent instructions.

But, yeah, that's what I was hoping to be simplified. Also, in cases where a ship is branded: i.e. military or corporate; the player's ship would not have to carry logos or whatnot.

Again, just a suggestion.

And thanks for detailing the process.
__________
______
Captain Berf
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Err, if you just want to change textures:

Make a copy of the original .dat file as a backup.

Open the original as a text file (never with notepad, but you could use notepad++) & replace 'oldtexture.png' with 'newtexture.png'.

save, restart Oolite pressing shift.

This way, the actual texture conversion is really just one step...

I'll see if there's a relatively easy way to override the texture from inside Oolite.
Unfortunately, the .dat file can use any number of textures, not just one, and you can't replace 2 or 3 textures with just one new one.

In short, the more I think about it, the more complex that 'simple' thing looks... :(
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Kaks wrote:
In short, the more I think about it, the more complex that 'simple' thing looks... :(
Not more complex, but just many more ways to achieve the goal. Yet another method:

Create a file with name: shipdata-overrides.plist

{

Code: Select all

	"shipFoo-player" =
	{
		materials =
		{
			"shipFoo_Texture.png" = { diffuse_map = "shipFoo_Texture_PLAYER.png"; };
		};
	};
}
And put this file in the Config folder of an oxp. Than put the file "shipFoo_Texture_PLAYER.png" in the Texture folder of that oxp. Now the specific texture file for that specific ship is replaced. When the original already has an materials directory, the originel content must be added to the above file.

edit: it is shipdata-overrides, not shipdata-override
Last edited by Eric Walch on Fri Dec 11, 2009 10:06 pm, edited 1 time in total.
User avatar
Captain Berf
Competent
Competent
Posts: 55
Joined: Mon Nov 09, 2009 1:19 am
Location: USA, 1.5 Miles Up

Post by Captain Berf »

If you change the .dat it changes the NPC's too, right? I was suggesting a simple (at least for the end user :) ) way to have player textures be distinct from the NPC's.

NPC=Non-Player Character/Ship
__________
______
Captain Berf
User avatar
Sendraks
---- E L I T E ----
---- E L I T E ----
Posts: 404
Joined: Tue Jun 02, 2009 1:43 pm
Location: Leeds UK

Post by Sendraks »

Captain Berf wrote:
If you change the .dat it changes the NPC's too, right? I was suggesting a simple (at least for the end user :) ) way to have player textures be distinct from the NPC's.

NPC=Non-Player Character/Ship
In this case you'd change the shipdata config file for this unique texture ship, so that there was player ship data only and no npc data. That way npcs could never spawn with this skin.

In so far as I can see, having a seperate oxp with it's own name and config files is the only way to have textures specific to a player only ship and not having an NPC version. However, the ship name could still be whatever the default ship name is, just the texture png, dat png and names in the config files would have unique identifiers.
User avatar
Captain Berf
Competent
Competent
Posts: 55
Joined: Mon Nov 09, 2009 1:19 am
Location: USA, 1.5 Miles Up

Post by Captain Berf »

Eric,

That's much easier.

Thanks.
__________
______
Captain Berf
User avatar
Captain Berf
Competent
Competent
Posts: 55
Joined: Mon Nov 09, 2009 1:19 am
Location: USA, 1.5 Miles Up

Post by Captain Berf »

STUPID QUESTION ALERT:

Is -player role already defined for every ship a player can fly/buy?
__________
______
Captain Berf
User avatar
Sendraks
---- E L I T E ----
---- E L I T E ----
Posts: 404
Joined: Tue Jun 02, 2009 1:43 pm
Location: Leeds UK

Post by Sendraks »

Captain Berf wrote:
STUPID QUESTION ALERT:

Is -player role already defined for every ship a player can fly/buy?
My understanding (and happy to be corrected on this) is that is has to be defined in the shipdata config, otherwise the ship cannot be purchased. There are various ways of doing this, depending on how different you want the player ship to be from the NPC versions.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Player ships have the role "player" (only) in shipdata.plist. See the trunk shipdata.plist for examples. It's a special role, in the same definition that trader, pirate, police etc are roles.

They must also have an entry in shipyard.plist in order to make them playable (or at least to appear in the ship list, rather than by save-file hacking etc)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Eric Walch wrote:
Create a file with name: shipdata-override.plist

{

Code: Select all

	"shipFoo-player" =
	{
		materials =
		{
			"shipFoo_Texture.png" = { diffuse_map = "shipFoo_Texture_PLAYER.png"; };
		};
	};
}
And put this file in the Config folder of an oxp. Than put the file "shipFoo_Texture_PLAYER.png" in the Texture folder of that oxp.
This works, but note that you don’t actually need to put the files in an OXP if you aren’t planning to distribute it. You can just put them loose in the AddOns folder.
Eric Walch wrote:
Now the specific texture file for that specific ship is replaced. When the original already has an materials directory, the originel content must be added to the above file.
Er, why?
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

I'm probably complicating things a bit here, just as they were starting to look simple, but what if the original ship had 2 different texture files?
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

What about it?
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Doh, I was being particularly dense. Please ignore! I just realised that all we need to do is

Code: Select all

      materials =
      {
         "shipFoo_Texture.png" = { diffuse_map = "shipFoo_Texture_PLAYER.png"; };
         "shipFoo_Turret1_Texture.png" = { diffuse_map = "shipFoo_Turret1_Texture_PLAYER.png"; };
         "shipFoo_engines_Texture.png" = { diffuse_map = "shipFoo_engines_Texture_PLAYER.png"; };

                ...

      }; 
A no-brainer, really! :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Post Reply