Various plist things

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

Moderators: winston, another_commander

Post Reply
User avatar
Staer9
---- E L I T E ----
---- E L I T E ----
Posts: 570
Joined: Fri Feb 18, 2011 4:53 pm
Location: Hatfield, Hertfordshire (poor industrial)

Various plist things

Post by Staer9 »

Moderator: belatedly split off this stuff that has nothing to do with scripting from the Scripter’s Cove thead.

Ok, so what is wrong with this?

Code: Select all

		weapon_position_port = "-37.5 -4.0 -40.0";
		weapon_position_starboard = "37.5 -4.0 -40.0";
		materials = 
		{ 
			"stardestroyerdiffuse.png" = 
				{ 
				diffuse_map = "stardestroyerdiffuse.png"; 
				illumination_map = "starglow12.png";
 				}; 
			};
		};
	};
}
apparently there is an error around here somewhere, but I cannot find it. (this is just a part of the shipdata)
Image
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Scripters cove

Post by Commander McLane »

For one, the number of opening and closing brackets doesn't match.

Code: Select all

		weapon_position_port = "-37.5 -4.0 -40.0";
		weapon_position_starboard = "37.5 -4.0 -40.0";
		materials = 
		{ 
			"stardestroyerdiffuse.png" = 
				{ 
				diffuse_map = "stardestroyerdiffuse.png"; 
				illumination_map = "starglow12.png";
 				}; 
			};  <-- this one looks highly suspicious; there is no opening bracket on the same level
		};
	};
}
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Scripters cove

Post by Smivs »

Staer9 wrote:
Ok, so what is wrong with this?

Code: Select all

		weapon_position_port = "-37.5 -4.0 -40.0";
		weapon_position_starboard = "37.5 -4.0 -40.0";
		materials = 
		{ 
		                         "stardestroyerdiffuse.png" = 
				{ 
				diffuse_map = "stardestroyerdiffuse.png"; 
				illumination_map = "starglow12.png";
 				}; 
			};
		};
	};
}
apparently there is an error around here somewhere, but I cannot find it. (this is just a part of the shipdata)
assuming "stardestroyerdiffuse.png" is specified as the diffuse_map in the .dat file, you don't need it twice. Also there seem to be lots of closing brackets there.

Code: Select all

 weapon_position_port = "-37.5 -4.0 -40.0";
		weapon_position_starboard = "37.5 -4.0 -40.0";
		materials = 
		{ 
		"stardestroyerdiffuse.png" = 
				{ 
				illumination_map = "starglow12.png";
 				}; 
      };
      model = "whatever-model.dat";               
should do, just make sure you have the correct closing brackets at the end of the plist
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Staer9
---- E L I T E ----
---- E L I T E ----
Posts: 570
Joined: Fri Feb 18, 2011 4:53 pm
Location: Hatfield, Hertfordshire (poor industrial)

Re: Scripters cove

Post by Staer9 »

Thanks, but the error remains... just on a different line, the log says:

Code: Select all

[plist.parse.failed]: Failed to parse ../AddOns/stardestroyerV1.1.oxp/Config/shipdata.plist as a property list.
Parse failed at line 41 (char 1138) - extra data after parsed string
the entire shipdata is here:

Code: Select all

{
	"stardestroyer" =
	{
		aft_eject_position = "0.0 -20.0 -67.0";
		aft_weapon_type = "WEAPON_MILITARY_LASER";
		ai_type = "pirateAI.plist";
		auto_ai = yes;
		cargo_type = "CARGO_NOT_CARGO";
		energy_recharge_rate = 6.0;
		exhaust = ("101.868 59.362 184.229 15.0 15.0 8.0", "-101.868 59.362 184.229 15.0 15.0 8.0");
		forward_weapon_type = "WEAPON_MILITARY_LASER";
		fuel = 70;
		has_ecm = yes;
		has_escape_pod = yes;
		has_scoop = yes;
		likely_cargo = 0;
		max_cargo = 1000;
		max_energy = 960;
		max_flight_pitch = 0.05;
		max_flight_roll = 0.05;
		max_flight_speed = 100;
		missile_launch_position = "0.0 -9.0 60.0";
		missiles = 8;
		name = "Imperial Star Destroyer";
		roles = "pirate stardestroyer";
		scoop_position = "0.0 -30.0 -60";
		thrust = 4;
		weapon_position_aft = "0.030 58.090 -151.356";
		weapon_position_forward = "0.030 60.663 200.223";
		weapon_position_port = "-37.5 -4.0 -40.0";
		weapon_position_starboard = "37.5 -4.0 -40.0";
		materials =
		{
		"stardestroyerdiffuse.png" =
			{
			illumination_map = "starglow12.png";
			};
		};
		model = "stardestroyer.dat";
		};
	};
}
Image
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6626
Joined: Wed Feb 28, 2007 7:54 am

Re: Scripters cove

Post by another_commander »

Too many closing curly braces. Oolite is already telling you exactly where the problem is: Line 41, extra characters encountered. The extra character is the semicolon after the curly brace.

So, in short: Lose the bottom curly brace and the semicolon in the one above it and the plist should be readable.
User avatar
Staer9
---- E L I T E ----
---- E L I T E ----
Posts: 570
Joined: Fri Feb 18, 2011 4:53 pm
Location: Hatfield, Hertfordshire (poor industrial)

Re: Scripters cove

Post by Staer9 »

another_commander wrote:
Too many closing curly braces. Oolite is already telling you exactly where the problem is: Line 41, extra characters encountered. The extra character is the semicolon after the curly brace.

So, in short: Lose the bottom curly brace and the semicolon in the one above it and the plist should be readable.
Ahhhhh.... thanks, it finaly worked.
Image
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Scripters cove

Post by Commander McLane »

Staer9 wrote:
another_commander wrote:
Too many closing curly braces. Oolite is already telling you exactly where the problem is: Line 41, extra characters encountered. The extra character is the semicolon after the curly brace.
So, in short: Lose the bottom curly brace and the semicolon in the one above it and the plist should be readable.
Ahhhhh.... thanks, it finaly worked.
You know, brace-counting should be a basic capability of anybody writing computer-legible code. A total of 4 braces opening and a total of 5 or 6 braces closing doesn't add up, regardless whether it's 5 or 6. My hint about the not-matching opening and closing braces (or brackets, or whatever) wasn't meant to make you delete one of them blindly, but was meant to make you go and actually count them, and also to understand exactly which part of the code is enclosed by which pair of braces.


EDIT: typo
Last edited by Commander McLane on Fri Jun 03, 2011 2:14 pm, edited 1 time in total.
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Re: Scripters cove

Post by DaddyHoggy »

Commander McLane wrote:
Staer9 wrote:
another_commander wrote:
Too many closing curly braces. Oolite is already telling you exactly where the problem is: Line 41, extra characters encountered. The extra character is the semicolon after the curly brace.

So, in short: Lose the bottom curly brace and the semicolon in the one above it and the plist should be readable.
Ahhhhh.... thanks, it finaly worked.
You know, brace-counting should be a basic capability of anybody writing computer-legible code. A total of 4 braces opening and a total of 5 or 6 braces closing doesn't end up, regardless whether it's 5 or 6. My hint about the not-matching opening and closing braces (or brackets, or whatever) wasn't meant to make you delete one of them blindly, but was meant to make you go and actually count them, and also to understand exactly which part of the code is enclosed by which pair of braces.
Something like Notepad++ will actually highlight each closing bracket/brace with each corresponding open one - if you have too many of one and not enough of the other - it should be fairly obvious...
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6626
Joined: Wed Feb 28, 2007 7:54 am

Re: Scripters cove

Post by another_commander »

Proper identation of brackets and code is always helpful, too. In the example above, correct identation would have made the mismatch immediately visible.
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Re: Scripters cove

Post by DaddyHoggy »

another_commander wrote:
Proper identation of brackets and code is always helpful, too. In the example above, correct identation would have made the mismatch immediately visible.
Depending on what mode you put Notepad++ in, it will auto-indent for each new open brace/bracket and de-indent ( :!: :?: ) when it closes.
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Staer9
---- E L I T E ----
---- E L I T E ----
Posts: 570
Joined: Fri Feb 18, 2011 4:53 pm
Location: Hatfield, Hertfordshire (poor industrial)

Re: Scripters cove

Post by Staer9 »

Yet another query...

for placing subentities what I have seen in several shipdata.plist files is something like this:

Code: Select all

"ballturret 0 0 0 0 0 0"
what does each of the numbers mean? because from just looking at them it made no sense to me whatsoever
Image
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Scripters cove

Post by Commander McLane »

Staer9 wrote:
Yet another query...

for placing subentities what I have seen in several shipdata.plist files is something like this:

Code: Select all

"ballturret 0 0 0 0 0 0"
what does each of the numbers mean? because from just looking at them it made no sense to me whatsoever
Please read the documentation: Shipdata.plist, especially subentities, and there especially the old-style definition. Note that your example above is also wrong. There always have to be seven numbers after the subentity-identifier.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Scripters cove

Post by JensAyton »

Commander McLane wrote:
Please read the documentation: Shipdata.plist, especially subentities, and there especially the old-style definition.
Even better, read the bit under new-style definition and use that instead.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Scripters cove

Post by Smivs »

This is on the Wkik here. The first three numbers are the posution on the x,y,z axes, and the others are the orientation. Play around a bit and you'll soon get the hang of it.
Commander Smivs, the friendliest Gourd this side of Riedquat.
Post Reply