Page 1 of 1

problems with oxp-ship

Posted: Wed May 18, 2016 8:33 pm
by tsoj
Hello guys,

i modeled my first ship (with blender), i have textures for this model but i have issues with the configs. I tried to copy all config texts from the cobra mark three (copy worked) and to replace all words like "oolite_template_cobra3-..." with the name of my ship-model. However oolite didnt recognized this ship with these configs. Then i tried to replace the model of the cobra mark three with my model (in the gamefolder [oolite/oolite.app/resources/models/...]). this worked. i really dont know what im doing wrong, so i thought to myself, 'hey, there is this nice forum,why not asking them?
So im asking you now, what could i do in this case?
btw im using windows.
and sorry for some mistakes i might have done im not an native speaker ;)

Re: problems with oxp-ship

Posted: Wed May 18, 2016 10:01 pm
by Cody
Welcome aboard, Commander! I've asked the Mods to move this thread to a more suitable place, where it'll get more attention.
Hopefully, someone will then be able to help you. I'm just a dumb pilot, you see - flying a Cobra Mk III is about all I can do!

Re: problems with oxp-ship

Posted: Wed May 18, 2016 10:28 pm
by another_commander
Moved to Expansion Pack.

Re: problems with oxp-ship

Posted: Wed May 18, 2016 10:50 pm
by Norby
Welcome tsoj in the forum!

Please insert the content of your shipdata.plist here, we can take a look on it. Another help is your Logs/Latest.log file, maybe an error printed within about your shipdata like a missing bracket.

Re: problems with oxp-ship

Posted: Thu May 19, 2016 11:11 am
by ClymAngus
Indeed "eyes on" would be useful. :)

Re: problems with oxp-ship

Posted: Thu May 19, 2016 3:43 pm
by tsoj
The error is:
Failed to restore saved game. Could not find ship type. "tsoj_Boomslang-mkII-player" -please reinstall the appropriate OXP.

In this save-file i wrote tsoj_Boomslang-mkII-player instead of cobra3-player.

My .oxp-folder is tsoj_Boomslang-mkII.oxp
In there are the three folders Config Models Textures.
Model and texture are in their folders and the shipdata.plist and shipyard.plist and the demoship.plist files are in the Config folder.

Content of my shipdata.plist file is this:

Code: Select all

{
	"tsoj_Boomslang-mkII" = 
	{
		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 30.0 -200.0";
				weapon_facing = "FORWARD";
			},
			{
				view_description = "Rear Right View";
				view_orientation = "0.9239 0.0 0.3827 0.0";
				view_position = "141.42 30.0 -141.42";
				weapon_facing = "FORWARD";
			},
			{
				view_description = "Right View";
				view_orientation = "0.7071 0.0 0.7071 0.0";
				view_position = "200.0 30.0 0.0";
				weapon_facing = "FORWARD";
			},
			{
				view_description = "Front Right View";
				view_orientation = "0.3827 0.0 0.9239 0.0";
				view_position = "141.42 30.0 141.42";
				weapon_facing = "FORWARD";
			},
			{
				view_description = "Front View";
				view_orientation = "0.0 0.0 1.0 0.0";
				view_position = "0.0 30.0 200.0";
				weapon_facing = "FORWARD";
			},
			{
				view_description = "Front Left View";
				view_orientation = "0.3827 0.0 -0.9239 0.0";
				view_position = "-141.42 30.0 141.42";
				weapon_facing = "FORWARD";
			},
			{
				view_description = "Left View";
				view_orientation = "0.7071 0.0 -0.7071 0.0";
				view_position = "-200.0 30.0 0.0";
				weapon_facing = "FORWARD";
			},
			{
				view_description = "Rear Left View";
				view_orientation = "0.9239 0.0 -0.3827 0.0";
				view_position = "-141.42 30.0 -141.42";
				weapon_facing = "FORWARD";
			},
			{
				view_description = "Top View";
				view_orientation = "-0.7071 0.7071 0.0 0.0";
				view_position = "0.0 200.0 -15.0";
				weapon_facing = "FORWARD";
			},
			{
				view_description = "Bottom View";
				view_orientation = "0.0 0.0 0.7071 0.7071";
				view_position = "0.0 -200.0 -15.0";
				weapon_facing = "FORWARD";
			}
		);
		energy_recharge_rate = 4;
		exhaust = 
		(		
			"10.7601 6.3008 -33.8587  6.3 5.6 1.0",
			"-10.7601 6.3008 -33.8587 6.3 5.6 1.0"
		);
		forward_weapon_type = "WEAPON_BEAM_LASER";
		frangible = 0;
		fuel = 70;
		has_ecm = 0.15;
		has_escape_pod = 0.95;
		has_scoop = 0.95;
		is_template = 1;
		likely_cargo = 15;
		materials = 
		{ 
			"Hull" = 
			{ 
				diffuse_map = "oolite_cobra3_diffuse.png"; 
				specular_color = ( 0.2, 0.2, 0.2 );
				shininess = 5; 
				emission_map = { name = "oolite_cobra3_diffuse.png"; extract_channel = "a"; }; 
				emission_modulate_color = (0.9926, 0.9686, 0.7325, 1.0);
			};
			"Gun" = 
				{ 
					diffuse_map = "oolite_cobra3_subents.png"; 
					specular_color = ( 0.2, 0.2, 0.2 ); 
					shininess = 5; 
				};			
		};
		max_cargo = 20;
		max_energy = 256;
		max_flight_pitch = 1;
		max_flight_roll = 2;
		max_flight_speed = 350;
		max_missiles = 4;
		missile_launch_position = "0.0 -15.5 -24.5";
		missiles = 3;
		model = "tsoj_Boomslang-mkII.dat";
		name = "Boomslang MK-II";
		scoop_position = "0.0 -5.5 25.0";
		thrust = 32;
		view_position_aft = "0.0 6.0 -35.5";
		view_position_forward = "0.0 7.25 31.0";
		view_position_port = "-35.5 7.5 0.0";
		view_position_starboard = "35.5 7.5 0.0";
		weapon_facings = 15;
		weapon_position_aft = "0.0 0.0 -33.5";
		weapon_position_forward = "-0.0961 0.9367 43.4655";
		weapon_position_port = "-47.4 -2.3 0.0";
		weapon_position_starboard = "47.4 -2.3 0.0";
	};
	"tsoj_Boomslang-mkII-trader" =
	{
		like_ship = "tsoj_Boomslang-mkII";
		is_template = 1;
		max_flight_speed = 300;
		thrust = 30;
		roles = "trader(0.375) trader-courier(0.2) trader-smuggler(0.75) hunter-medium(0.5) pirate-heavy-fighter pirate-interceptor(0.25) pirate-aegis-raider(0.2) scavenger sunskim-trader";
	};
	"tsoj_Boomslang-mkII-alternate" =
	{
		like_ship = "tsoj_Boomslang-mkII";
		has_ecm = 0.95;
		is_template = 1;
		max_cargo = 35;
		max_flight_speed = 300;
		materials =
		{
			"Hull" =
			{
				diffuse_map = "oolite_cobra3_diffuse_alt.png";
				specular_color = (0.2, 0.2, 0.2);
				shininess = 5;
				emission_map = 
				{
					name = "oolite_cobra3_diffuse_alt.png"; extract_channel = "a";
				};
				emission_modulate_color = (0.9926, 0.9686, 0.7325, 1.0);
			};
			"Gun" = 
				{ 
					diffuse_map = "oolite_cobra3_subents.png"; 
					specular_color = ( 0.2, 0.2, 0.2 ); 
					shininess = 5; 
				};			
		};
		roles = "pirate-light-freighter pirate-medium-freighter(0.2) trader(0.375) hunter-heavy escort-heavy(0.25) hermit-ship sunskim-trader cobra3-alternate assassin-medium";
	};
	"tsoj_Boomslang-mkII-pirate" =
	{
		like_ship = "tsoj_Boomslang-mkII";
		is_template = 1;
		ai_type = "oolite-pirateAI.js";
		bounty = 50;
		forward_weapon_type = "WEAPON_PULSE_LASER";
		has_ecm = 0.1;
		has_escape_pod = 0.85;
		has_scoop = yes;
		has_shield_booster = 0.25;
		materials =
		{
			"Hull" =
			{
				diffuse_map = "oolite_cobra3_diffuse_pirate.png";
				specular_color = (0.2, 0.2, 0.2);
				shininess = 5;
				emission_map = 
				{
					name = "oolite_cobra3_diffuse_pirate.png"; extract_channel = "a";
				};
				emission_modulate_color = (0.9926, 0.9686, 0.7325, 1.0);
			};
			"Gun" = 
				{ 
					diffuse_map = "oolite_cobra3_subents.png"; 
					specular_color = ( 0.2, 0.2, 0.2 ); 
					shininess = 5; 
				};			
		};
		max_cargo = 20;
		max_flight_speed = 300;
		missiles = 1;
		roles = "pirate(0.25) pirate-medium-fighter(0.5)";
	};
	"tsoj_Boomslang-mkII-player" =
	{
		like_ship = "tsoj_Boomslang-mkII";
		is_template = 1;
		forward_weapon_type = "WEAPON_PULSE_LASER";
		roles = "player";
	};
}

Content of my shipyard.plist is:

Code: Select all

{
	"tsoj_mkII-Boomslang-player" =
	{
		chance = 0.5;
		"optional_equipment" =
		(
            "EQ_CARGO_BAY",
			"EQ_ECM",
			"EQ_FUEL_SCOOPS",
			"EQ_PASSENGER_BERTH",
			"EQ_ESCAPE_POD",
			"EQ_ENERGY_BOMB",
			"EQ_ENERGY_UNIT",
			"EQ_NAVAL_ENERGY_UNIT",
			"EQ_DOCK_COMP",
			"EQ_WEAPON_PULSE_LASER",
			"EQ_WEAPON_BEAM_LASER",
			"EQ_WEAPON_MINING_LASER",
			"EQ_WEAPON_MILITARY_LASER",
			"EQ_FUEL_INJECTION",
			"EQ_SCANNER_SHOW_MISSILE_TARGET",
			"EQ_MULTI_TARGET",
			"EQ_GAL_DRIVE",
			"EQ_ADVANCED_COMPASS",
			"EQ_SHIELD_BOOSTER",
			"EQ_NAVAL_SHIELD_BOOSTER",
			"EQ_HEAT_SHIELD"
		);
		price = 150000;
		"standard_equipment" =
		{
			extras = "";
			"forward_weapon_type" = "EQ_WEAPON_PULSE_LASER";
			missiles = 3;
		};
		techlevel = 6;
		"weapon_facings" = 15;
	};
}

It could be something obvious that im doing wrong, im a total noob with things like this :P

Re: problems with oxp-ship

Posted: Thu May 19, 2016 4:19 pm
by Cody
A tip: if you highlight any code, then click the 'Code' button, it makes it easier to read.

Re: problems with oxp-ship

Posted: Thu May 19, 2016 6:22 pm
by another_commander
Had a very quick look and this struck me as inconsistent:
shipdata.plist has

Code: Select all

"tsoj_Boomslang-mkII-player" = [...]
while shipyard.plist has

Code: Select all

"tsoj_mkII-Boomslang-player" = [...]

Re: problems with oxp-ship

Posted: Fri May 20, 2016 8:21 am
by Smivs
By the way, demoship.plist is no longer used - you will need a shiplibrary.plist to add your ship to the display.

Re: problems with oxp-ship

Posted: Fri May 20, 2016 10:24 am
by tsoj
another_commander wrote:Had a very quick look and this struck me as inconsistent:
shipdata.plist has

Code: Select all

"tsoj_Boomslang-mkII-player" = [...]
while shipyard.plist has

Code: Select all

"tsoj_mkII-Boomslang-player" = [...]
oh, yes, i found also some other inconsistencies in this plist, like i hadnt rewrote the string after "model" (it was still oolite_cobra3.dat).
but this wasnt the problem. :P
Now im trying to adjust all the xyz-positiones from the shipdata.plist in the gamefolder of the cobra mark three to look nice with my model,
but i have this problem, that if i restart the game it hasnt changed, but when i restarted it today (after a windows hibernation relaunch) the changes have applied.
Why is that? Have i to logout and in? Or maybe its just one of the defects of my computer.

and thanks for your replies
Smivs wrote:By the way, demoship.plist is no longer used - you will need a shiplibrary.plist to add your ship to the display.
I'm sure that I had long wondered why that does not work ;)

Re: problems with oxp-ship

Posted: Fri May 20, 2016 10:25 am
by Cody
If you make changes, you need to restart Oolite with the shift key held down until the spinning Cobra appears - that flushes the cache.

Which code editor are you using? If you're not already aware of it, Notepad++ is good (and free).

Re: problems with oxp-ship

Posted: Fri May 20, 2016 8:25 pm
by Griff
I'm not 100% sure, but i don't think you need this line

Code: Select all

is_template = 1;
in any of the ship definitions other than the first "tsoj_Boomslang-mkII" one,
setting a ship as a template = 1 treats that ship as a 'reference only' ship which other 'like_ship =' ship versions refer too (saves you having to duplicate all the settings in each version of the ship you 'like_ship' too -
sorry about the mad circular logic, hope that makes a bit of sense :)

Re: problems with oxp-ship

Posted: Fri May 20, 2016 10:05 pm
by Smivs
That's right. A good convention is to call the template, 'template', so your

Code: Select all

"tsoj_Boomslang-mkII"
might be called

Code: Select all

"tsoj_Boomslang-mkII_template"
and all the others like_ship to "tsoj_Boomslang-mkII_template", without the 'is_template' line.

Re: problems with oxp-ship

Posted: Fri May 20, 2016 10:51 pm
by tsoj
Ok, i followed your tips for template-ships and this and it worked. Thank you all for that help! :D