Ship Respray oxp problem

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

Moderators: winston, another_commander

Post Reply
User avatar
tsoj
Deadly
Deadly
Posts: 199
Joined: Wed May 18, 2016 8:19 pm
Location: Berlin
Contact:

Ship Respray oxp problem

Post by tsoj »

Hello,
im currently working on a ship.oxp and this is the first time i want to make various textures for one ship. (at least different colors :P )
Now, if im starting the game and want to respray my ship the ship-respray-menu shows me my four different textures but i only can switch from any texture to only the first texture, at least the ship looks in the end like before or if i chose the first texture it looks like the first texture.

my shipdata.plist looks like this:

Code: Select all

{
	"chrysopelea_mk-i_template" = 
	{
		aft_eject_position = "0.0 -13.25 -23.8";
		ai_type = "oolite-traderAI.js";
		auto_ai = yes;
		auto_weapons = yes;
		cargo_type = "CARGO_NOT_CARGO";
		custom_views =
		(
			{
				view_description = "Rear View";
				view_orientation = "1.0 0.0 0.0 0.0";
				view_position = "0.0 5.0 -200.0";
				weapon_facing = "FOWARD";
			},
			{
				view_description = "Rear Right View";
				view_orientation = "0.9239 0.0 0.3827 0.0";
				view_position = "141.42 5.0 -141.42";
				weapon_facing = "FOWARD";
			},
			{
				view_description = "Right View";
				view_orientation = "0.7071 0.0 0.7071 0.0";
				view_position = "200.0 5.0 0.0";
				weapon_facing = "FOWARD";
			},
			{
				view_description = "Front Right View";
				view_orientation = "0.3827 0.0 0.9239 0.0";
				view_position = "141.42 5.0 141.42";
				weapon_facing = "FOWARD";
			},
			{
				view_description = "Front View";
				view_orientation = "0.0 0.0 1.0 0.0";
				view_position = "0.0 5.0 200.0";
				weapon_facing = "FOWARD";
			},
			{
				view_description = "Front Left View";
				view_orientation = "0.3827 0.0 -0.9239 0.0";
				view_position = "-141.42 5.0 141.42";
				weapon_facing = "FOWARD";
			},
			{
				view_description = "Left View";
				view_orientation = "0.7071 0.0 -0.7071 0.0";
				view_position = "-200.0 5.0 0.0";
				weapon_facing = "FOWARD";
			},
			{
				view_description = "Rear Left View";
				view_orientation = "0.9239 0.0 -0.3827 0.0";
				view_position = "-141.42 5.0 -141.42";
				weapon_facing = "FOWARD";
			},
			{
				view_description = "Top View";
				view_orientation = "-0.7071 0.7071 0.0 0.0";
				view_position = "0.0 250.0 -12.0";
				weapon_facing = "FOWARD";
			},
			{
				view_description = "Bottom View";
				view_orientation = "0.0 0.0 0.7071 0.7071";
				view_position = "0.0 -250.0 -12.0";
				weapon_facing = "FOWARD";
			}
		);
		energy_recharge_rate = 4.5;
		exhaust = 
		(		
			"0.0 4.5 -27.15		7.0 4.7 1.0",
			"10.0 -4.8 -27.15	2.8 2.0 1.0", 
			"-10.0 -4.8 -27.15	2.8 2.0 1.0"
		);
		frangible = no;			
		forward_weapon_type = "WEAPON_BEAM_LASER";
		fuel = 70;
		has_ecm = 0.15;
		has_escape_pod = 0.95;
		has_scoop = 0.95;
		is_template = 1;
		likely_cargo = 15;
		max_cargo = 15;
		max_energy = 300;
		max_flight_pitch = 1.25;
		max_flight_roll = 2.45;
		max_flight_speed = 365;
		max_missiles = 5;
		missile_launch_position = "0.17 -5.0 -20";
		missiles = 3;
		materials =
		{
			"chrysopelea_mk-i_diffuse.png" =
			{
				diffuse_map = "chrysopelea_mk-i_diffuse.png";
				emission_map = "chrysopelea_mk-i_lights.png"; 
				specular_color = (0.3, 0.3, 0.3);
				shininess = 5;
			};
		};
		model = "chrysopelea_mk-i.dat";
		name = "Chrysopelea MK-I";
		scoop_position = "0.0 -5.0 25.0";
		thrust = 35;
		view_position_aft = "0.0 10.0 -30.0";
		view_position_forward = "0.0 9.0 15.0";
		view_position_port = "-5.5 5.0 15.0";
		view_position_starboard = "5.5 5.0 15.0";
		weapon_facings = 3;
		weapon_mount_mode = "split";
		weapon_position_aft = "0.0 4.0 28.0";
		weapon_position_forward = ("10.6 -7.8 5.3", "-10.6 -7.8 5.3");
	};
	"chrysopelea_mk-i-trader" =
	{
		like_ship = "chrysopelea_mk-i_template";
		materials =
		{
			"chrysopelea_mk-i_diffuse.png" =
			{
				diffuse_map = "chrysopelea_mk-i_diffuse_2.png";
				emission_map = "chrysopelea_mk-i_lights.png"; 
				specular_color = (0.3, 0.3, 0.3);
				shininess = 5;
			};
		};
		max_flight_speed = 330;
		thrust = 30;
		roles = "trader(0.3) trader-courier(0.25) trader-smuggler(0.75) hunter-medium(0.5) pirate-heavy-fighter pirate-interceptor(0.25) pirate-aegis-raider(0.2) scavenger sunskim-trader";
	};
	
	"chrysopelea_mk-i-trader2" =
	{
		like_ship = "chrysopelea_mk-i_template";
		max_flight_speed = 330;
		thrust = 30;
		roles = "trader(0.3) trader-courier(0.25) trader-smuggler(0.75) hunter-medium(0.5) pirate-heavy-fighter pirate-interceptor(0.25) pirate-aegis-raider(0.2) scavenger sunskim-trader";
	};
	"chrysopelea_mk-i-alternate" =
	{
		like_ship = "chrysopelea_mk-i_template";
		has_ecm = 0.95;
		max_cargo = 35;
		max_flight_speed = 300;
		roles = "pirate-light-freighter pirate-medium-freighter(0.19) trader(0.3) hunter-heavy escort-heavy(0.25) hermit-ship sunskim-trader cobra3-alternate assassin-medium";
	};	
	"chrysopelea_mk-i-alternate2" =
	{
		like_ship = "chrysopelea_mk-i_template";
		materials =
		{
			"chrysopelea_mk-i_diffuse.png" =
			{
				diffuse_map = "chrysopelea_mk-i_diffuse_2.png";
				emission_map = "chrysopelea_mk-i_lights.png"; 
				specular_color = (0.3, 0.3, 0.3);
				shininess = 5;
			};
		};
		has_ecm = 0.95;
		max_cargo = 35;
		max_flight_speed = 300;
		roles = "pirate-light-freighter pirate-medium-freighter(0.19) trader(0.3) hunter-heavy escort-heavy(0.25) hermit-ship sunskim-trader cobra3-alternate assassin-medium";
	};
	"chrysopelea_mk-i-pirate" =
	{
		like_ship = "chrysopelea_mk-i_template";materials =
		{
			"chrysopelea_mk-i_diffuse.png" =
			{
				diffuse_map = "chrysopelea_mk-i_diffuse_4.png";
				emission_map = "chrysopelea_mk-i_lights.png"; 
				specular_color = (0.3, 0.3, 0.3);
				shininess = 5;
			};
		};
		ai_type = "oolite-pirateAI.js";
		bounty = 60;
		forward_weapon_type = "WEAPON_PULSE_LASER";
		has_ecm = 0.1;
		has_escape_pod = 0.85;
		has_scoop = yes;
		has_shield_booster = 0.25;
		max_cargo = 20;
		max_flight_speed = 325;
		missiles = 1;
		roles = "pirate(0.30) pirate-medium-fighter(0.501)";
	};
	"chrysopelea_mk-i-player" =
	{
		like_ship = "chrysopelea_mk-i_template";
		forward_weapon_type = "WEAPON_PULSE_LASER";
		roles = "player";
	};
	
	"chrysopelea_mk-i-player2" =
	{
		like_ship = "chrysopelea_mk-i_template";
		
		materials =
		{
			"chrysopelea_mk-i_diffuse.png" =
			{
				diffuse_map = "chrysopelea_mk-i_diffuse_2.png";
				emission_map = "chrysopelea_mk-i_lights.png"; 
				specular_color = (0.3, 0.3, 0.3);
				shininess = 5;
			};
		};
		forward_weapon_type = "WEAPON_PULSE_LASER";
		roles = "player";
	};
	
	"chrysopelea_mk-i-player3" =
	{
		like_ship = "chrysopelea_mk-i_template";
		
		materials =
		{
			"chrysopelea_mk-i_diffuse.png" =
			{
				diffuse_map = "chrysopelea_mk-i_diffuse_3.png";
				emission_map = "chrysopelea_mk-i_lights.png"; 
				specular_color = (0.3, 0.3, 0.3);
				shininess = 5;
			};
		};
		forward_weapon_type = "WEAPON_PULSE_LASER";
		roles = "player";
	};
	
	"chrysopelea_mk-i-player4" =
	{
		like_ship = "chrysopelea_mk-i_template";
		
		materials =
		{
			"chrysopelea_mk-i_diffuse.png" =
			{
				diffuse_map = "chrysopelea_mk-i_diffuse_4.png";
				emission_map = "chrysopelea_mk-i_lights.png"; 
				specular_color = (0.3, 0.3, 0.3);
				shininess = 5;
			};
		};
		forward_weapon_type = "WEAPON_PULSE_LASER";
		roles = "player";
	};
}
Im wondering if ship-respray actually works through different template-versions of one ship?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Ship Respray oxp problem

Post by phkb »

I think the problem might be in your shipdata file. For each of the "materials" you've defined for the player versions of the ships, the key value name is the same for each - "chrysopelea_mk-i_diffuse.png", even though the diffuse_map element is different. I think these key value names should be unique and also be the same as the diffuse_map value (although I have to admit my knowledge of this area of Oolite is extremely limited - I work better in Javascript!). So make the player versions look like this:

Code: Select all

"chrysopelea_mk-i-player" =
   {
      like_ship = "chrysopelea_mk-i_template";
      forward_weapon_type = "WEAPON_PULSE_LASER";
      roles = "player";
   };
   
   "chrysopelea_mk-i-player2" =
   {
      like_ship = "chrysopelea_mk-i_template";
      
      materials =
      {
         "chrysopelea_mk-i_diffuse_2.png" =
         {
            diffuse_map = "chrysopelea_mk-i_diffuse_2.png";
            emission_map = "chrysopelea_mk-i_lights.png"; 
            specular_color = (0.3, 0.3, 0.3);
            shininess = 5;
         };
      };
      forward_weapon_type = "WEAPON_PULSE_LASER";
      roles = "player";
   };
   
   "chrysopelea_mk-i-player3" =
   {
      like_ship = "chrysopelea_mk-i_template";
      
      materials =
      {
         "chrysopelea_mk-i_diffuse_3.png" =
         {
            diffuse_map = "chrysopelea_mk-i_diffuse_3.png";
            emission_map = "chrysopelea_mk-i_lights.png"; 
            specular_color = (0.3, 0.3, 0.3);
            shininess = 5;
         };
      };
      forward_weapon_type = "WEAPON_PULSE_LASER";
      roles = "player";
   };
   
   "chrysopelea_mk-i-player4" =
   {
      like_ship = "chrysopelea_mk-i_template";
      
      materials =
      {
         "chrysopelea_mk-i_diffuse_4.png" =
         {
            diffuse_map = "chrysopelea_mk-i_diffuse_4.png";
            emission_map = "chrysopelea_mk-i_lights.png"; 
            specular_color = (0.3, 0.3, 0.3);
            shininess = 5;
         };
      };
      forward_weapon_type = "WEAPON_PULSE_LASER";
      roles = "player";
   };
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Ship Respray oxp problem

Post by Smivs »

The 'materials' key is the texture specified in the model file, then the diffuse_map is the texture you replace this with, so I think tsoj is doing this the right way. I don't know how 'Ship Respray' works as I've never used it, but I don't think this part of the plist is the problem.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Ship Respray oxp problem

Post by phkb »

I bow to your superior knowledge! :)

As for Ship Respray, what it does is collect all the ship keys with a player role for the ship class, and then allows you to update your current ship to use a different ship key.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Ship Respray oxp problem

Post by Smivs »

So, it looks like it should work then, as different player ships (with unique keys) are specified. Could you post the WIP OXP somewhere ? so we can have a look at the whole thing - this might give us some clues as to what is wrong.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
tsoj
Deadly
Deadly
Posts: 199
Joined: Wed May 18, 2016 8:19 pm
Location: Berlin
Contact:

Re: Ship Respray oxp problem

Post by tsoj »

User avatar
tsoj
Deadly
Deadly
Posts: 199
Joined: Wed May 18, 2016 8:19 pm
Location: Berlin
Contact:

Re: Ship Respray oxp problem

Post by tsoj »

Smivs wrote:
The 'materials' key is the texture specified in the model file, then the diffuse_map is the texture you replace this with, so I think tsoj is doing this the right way. I don't know how 'Ship Respray' works as I've never used it, but I don't think this part of the plist is the problem.
You were right, i simply forgot to apply the four different player-roles in the shipyard, i wrote down only the first player.
But anyways, if you want download my not-anymore-WIP oxp and have fun. :D
Post Reply