The Seraphim - A custom Ship OXP from start to finish.

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

Moderators: winston, another_commander

User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Post by Diziet Sma »

Scarecrow wrote:
As an aside, I'm checking the ships in the front end, where it cycles through all the ship types in the game. I'm assuming that the shaders would be working in this part of the game?
To answer your question, yes, shaders do work in the demo cycle. This does raise a point in my mind, though.

This may be a dumb question, but, given the bolded sentence above, are you sure the entry in the demoships.plist is referencing the ship you are customising? If there's a discrepancy, you'd only see the version in the demoships.plist, rather than the actual version you're editing..
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
Scarecrow
Dangerous
Dangerous
Posts: 99
Joined: Fri Jan 09, 2009 9:21 am
Contact:

Post by Scarecrow »

Okay, further to my last post on the previous page, I retried the code. I decided not to try and be too clever and instead of interpreting it, I used the lines from the Dredgers OXP exactly, swapping out my own texture names and is still doesn't like it.

Code: Select all

materials = 
			{
			"seraphim.png" = {shininess = 20; specular = (0.75, 0.75, 0.8, 1.0);
					normal_map = "seraphim_n.png";};
			};
The log gives me this:

Code: Select all

[plist.parse.foundation.failed]: Failed to parse ../AddOns/seraphim.oxp/Config/shipdata.plist as a property list using Foundation. Retrying using homebrew parser. WARNING: the homebrew parser is deprecated and will be removed in a future version of Oolite.
Parse failed at line 51 (char 1658) - extra data after parsed string
    [plist.homebrew.parseError]: Property list isn't in XML format, homebrew parser can't help you.
Crow
Senior Artist - Blitz Games
My other work
The Crow's Nest
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

Which line is line 51?
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 »

The syntax is correct. Possibly you have stray junk like hard spaces, or maybe GNUstep’s parser has problems with the lack of spacing around some of the braces.

If you posted the file, we could fix it.
User avatar
Scarecrow
Dangerous
Dangerous
Posts: 99
Joined: Fri Jan 09, 2009 9:21 am
Contact:

Post by Scarecrow »

That makes the most sense :)

Here you go. This is the Shipdata.Plist:

Code: Select all

{
viper =
	{
		aft_eject_position = "0.0 6.5 -28.0";
		ai_type = "route1patrolAI.plist";
		cargo_type = "CARGO_NOT_CARGO";
		energy_recharge_rate = 4;
		exhaust = ("0.0 0.0 -12.5 3.0 3.0 12.0");
		forward_weapon_type = "WEAPON_BEAM_LASER";
		has_ecm = yes;
		laser_color = "magentaColor";
		max_energy = 180;
		max_flight_pitch = 1.8;
		max_flight_roll = 2.8;
		max_flight_speed = 320;
		missile_launch_position = "-1.5 -5.6 2.0";
		missiles = 1;
		model = "seraphim_main.dat";
		name = "GalCop Viper";
		roles = "police oolite-viper";
		scanClass = "CLASS_POLICE";
		subentities = (
			"canopy 0 0 0 1 0 0 0",
			"gun 0 0 0 1 0 0 0",
			"pilots 0 0 0 1 0 0 0",
			"wings 0 0 0 1 0 0 0",
			"*FLASHER* 13.5 -9.0 -25.0 260.0 0.5 0.0 8",
			"*FLASHER* 25.0 0.0 -20.0 260.0 0.5 0.0 8",
			"*FLASHER* 13.5 9.0 -25.0 260.0 0.5 0.0 8",
			"*FLASHER* -13.5 9.0 -25.0 260.0 0.5 0.0 8",
			"*FLASHER* -25.0 0.0 -20.00 260.0 0.5 0.0 8",
			"*FLASHER* -13.5 -9.00 -25.0 260.0 0.5 0.0 8",
			"*FLASHER* 13.5 -9.0 -25.0 310.0 0.5 0.5 8",	
			"*FLASHER* 25.0 0.0 -20.0 310.0 0.5 0.5 8",
			"*FLASHER* 13.5 9.0 -25.0 310.0 0.5 0.5 8",
			"*FLASHER* -13.5 9.0 -25.0 310.0 0.5 0.5 8",
			"*FLASHER* -25.0 0.0 -20.00 310.0 0.5 0.5 8",
			"*FLASHER* -13.5 -9.00 -25.0 310.0 0.5 0.5 8",
		);
		materials = 
			{
			"seraphim.png" = {shininess = 20; specular = (0.75, 0.75, 0.8, 1.0);
					normal_map = "seraphim_n.png";};
			};
		};
		thrust = 32;
		weapon_position_aft = "0.0 0.0 -27.5";
		weapon_position_forward = "2.1 -5.5 23.5.33";
		weapon_position_port = "-12.5 0.0 0.0";
		weapon_position_starboard = "12.5 0.0 0.0";
	};

"canopy" =
	{
		ai_type = "nullAI.plist";
		model = "seraphim_canopy.dat";
		name = "seraphim canopy";
		smooth = yes;
	};
	
"gun" =
	{
		ai_type = "nullAI.plist";
		model = "seraphim_gun.dat";
		name = "seraphim gun";		
	};
	
"pilots" =
	{
		ai_type = "nullAI.plist";
		model = "seraphim_pilots.dat";
		name = "seraphim pilots";
		smooth = yes;
	};
	
"wings" =
	{
		ai_type = "nullAI.plist";
		model = "seraphim_wings.dat";
		name = "seraphim wings";		
	};
}

//
Senior Artist - Blitz Games
My other work
The Crow's Nest
User avatar
Scarecrow
Dangerous
Dangerous
Posts: 99
Joined: Fri Jan 09, 2009 9:21 am
Contact:

Post by Scarecrow »

AARGH! I think I've just realised what's wrong. I think I've put it inside the sub-entities section, haven't I?

sigh.

I'll test it. brb.

Crow
Senior Artist - Blitz Games
My other work
The Crow's Nest
User avatar
Scarecrow
Dangerous
Dangerous
Posts: 99
Joined: Fri Jan 09, 2009 9:21 am
Contact:

Post by Scarecrow »

Okay, that didn't work.

However, I noticed that the close bracket above the line thrust = 32 appeared to be unnecessary - which would explain my previous errors. I deleted that, and it's now compiling without any complaints.

YAY! \0/

However, the Seraphim is once again showing up with apparently no shaders on it :(

Boo! :(

This is what the code looks like now:

Code: Select all

{
viper =
	{
		aft_eject_position = "0.0 6.5 -28.0";
		ai_type = "route1patrolAI.plist";
		cargo_type = "CARGO_NOT_CARGO";
		energy_recharge_rate = 4;
		exhaust = ("0.0 0.0 -12.5 3.0 3.0 12.0");
		forward_weapon_type = "WEAPON_BEAM_LASER";
		has_ecm = yes;
		laser_color = "magentaColor";
		max_energy = 180;
		max_flight_pitch = 1.8;
		max_flight_roll = 2.8;
		max_flight_speed = 320;
		missile_launch_position = "-1.5 -5.6 2.0";
		missiles = 1;
		model = "seraphim_main.dat";
		name = "GalCop Viper";
		roles = "police oolite-viper";
		scanClass = "CLASS_POLICE";
		subentities = (
			"canopy 0 0 0 1 0 0 0",
			"gun 0 0 0 1 0 0 0",
			"pilots 0 0 0 1 0 0 0",
			"wings 0 0 0 1 0 0 0",
			"*FLASHER* 13.5 -9.0 -25.0 260.0 0.5 0.0 8",
			"*FLASHER* 25.0 0.0 -20.0 260.0 0.5 0.0 8",
			"*FLASHER* 13.5 9.0 -25.0 260.0 0.5 0.0 8",
			"*FLASHER* -13.5 9.0 -25.0 260.0 0.5 0.0 8",
			"*FLASHER* -25.0 0.0 -20.00 260.0 0.5 0.0 8",
			"*FLASHER* -13.5 -9.00 -25.0 260.0 0.5 0.0 8",
			"*FLASHER* 13.5 -9.0 -25.0 310.0 0.5 0.5 8",	
			"*FLASHER* 25.0 0.0 -20.0 310.0 0.5 0.5 8",
			"*FLASHER* 13.5 9.0 -25.0 310.0 0.5 0.5 8",
			"*FLASHER* -13.5 9.0 -25.0 310.0 0.5 0.5 8",
			"*FLASHER* -25.0 0.0 -20.00 310.0 0.5 0.5 8",
			"*FLASHER* -13.5 -9.00 -25.0 310.0 0.5 0.5 8",
		);
		materials = 
			{
			"seraphim.png" = {shininess = 20; specular = (0.75, 0.75, 0.8, 1.0);
					normal_map = "seraphim_n.png";};
			};
		thrust = 32;
		weapon_position_aft = "0.0 0.0 -27.5";
		weapon_position_forward = "2.1 -5.5 23.5.33";
		weapon_position_port = "-12.5 0.0 0.0";
		weapon_position_starboard = "12.5 0.0 0.0";
		};

"canopy" =
	{
		ai_type = "nullAI.plist";
		model = "seraphim_canopy.dat";
		name = "seraphim canopy";
		smooth = yes;
	};
	
"gun" =
	{
		ai_type = "nullAI.plist";
		model = "seraphim_gun.dat";
		name = "seraphim gun";		
	};
	
"pilots" =
	{
		ai_type = "nullAI.plist";
		model = "seraphim_pilots.dat";
		name = "seraphim pilots";
		smooth = yes;
	};
	
"wings" =
	{
		ai_type = "nullAI.plist";
		model = "seraphim_wings.dat";
		name = "seraphim wings";		
	};
}

//
Crow
Senior Artist - Blitz Games
My other work
The Crow's Nest
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 »

Put the following in a file named logcontrol.plist, directly in your AddOns folder:

Code: Select all

{
    textureLoader.asyncLoad = yes;
}
Then see if you get the message “[textureLoader.asyncLoad] Loading texture seraphim_n.png” in the log.

Making the corresponding check for some other shader-using OXP is probably a good idea. :-)

Another thing you might do is add an emission_map with, say, a red and black checkerboard pattern on it. That’s a lot less subtle than a normal map, so it’s easier to be certain whether it’s working or not.
Last edited by JensAyton on Wed Mar 03, 2010 2:52 pm, edited 1 time in total.
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 »

Your first example seemed okay but the whole file has a wrong material directory, 2x { but 3x }
I see you already corrected that
User avatar
Scarecrow
Dangerous
Dangerous
Posts: 99
Joined: Fri Jan 09, 2009 9:21 am
Contact:

Post by Scarecrow »

@Ahruman

No, amongst all the other textureloader lines, all I get related to the Seraphim is this:

Code: Select all

[textureLoader.asyncLoad]: Loading texture seraphim.png

[textureLoader.asyncLoad.notStall]: Texture seraphim.png loaded asynchronously.
It doesn't mention the normal map

Crow
Senior Artist - Blitz Games
My other work
The Crow's Nest
User avatar
Scarecrow
Dangerous
Dangerous
Posts: 99
Joined: Fri Jan 09, 2009 9:21 am
Contact:

Post by Scarecrow »

ooookaaaaay....

I added the emission map and that showed up. Equally, it's now loading the normal map and specular map too.

hm....

Crow
Senior Artist - Blitz Games
My other work
The Crow's Nest
User avatar
Scarecrow
Dangerous
Dangerous
Posts: 99
Joined: Fri Jan 09, 2009 9:21 am
Contact:

Post by Scarecrow »

Okay,

I removed the emission map and it now appears to only load the diffuse and normal. It doesn't load the specular.

The body of the Seraphim (That the material applies to appears darker than the other objects).

The code looks like this:

Code: Select all

materials = 
			{
			"seraphim.png" = {shininess = 20;
					normal_map = "seraphim_n.png";
					specular_map = "seraphim_s.png";};
			};
Crow
Senior Artist - Blitz Games
My other work
The Crow's Nest
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 »

You didn’t have a specular map before. :-)

Are you by any chance using simple shader mode?
User avatar
Scarecrow
Dangerous
Dangerous
Posts: 99
Joined: Fri Jan 09, 2009 9:21 am
Contact:

Post by Scarecrow »

No, I put that code in that you see above but it refuses to load the specular map. It also only loads the normal map if I also put in the emission map.

I am almost certainly running simple shader mode. How do I find out and how do I change it?

Crow
Senior Artist - Blitz Games
My other work
The Crow's Nest
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 »

Scarecrow wrote:
I am almost certainly running simple shader mode. How do I find out and how do I change it?
Menu (F2), Game Options…, Shader Effects.
Post Reply