Page 1 of 1

Ship Respray oxp problem

Posted: Tue Oct 11, 2016 11:27 pm
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?

Re: Ship Respray oxp problem

Posted: Wed Oct 12, 2016 12:58 am
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";
   };

Re: Ship Respray oxp problem

Posted: Wed Oct 12, 2016 6:34 am
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.

Re: Ship Respray oxp problem

Posted: Wed Oct 12, 2016 7:03 am
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.

Re: Ship Respray oxp problem

Posted: Wed Oct 12, 2016 7:56 am
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.

Re: Ship Respray oxp problem

Posted: Wed Oct 12, 2016 5:48 pm
by tsoj

Re: Ship Respray oxp problem

Posted: Wed Oct 12, 2016 6:08 pm
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