Page 1 of 1

Failed to parse shipdata.plist, "reached end of string"

Posted: Wed Nov 09, 2011 3:21 am
by RyanHoots

Code: Select all

22:14:52.440 [shipData.load.begin]: Loading ship data.
  22:14:52.464 [plist.parse.failed]: Failed to parse AddOns/ryan-bonus-textures.oxp/Config/shipdata.plist as a property list.
Parse failed at line 168 (char 2590) - reached end of string
The .plist file is only 167 lines long, and I can't check it manually. The worst part is, I don't even know what that error message means. :oops:
Anyone able to help? Thanks.

Re: Failed to parse shipdata.plist, "reached end of string"

Posted: Wed Nov 09, 2011 4:40 am
by Wildeblood
You've got a stray " in the file somewhere, which it's interpreting as the start of a string that never ends.

Put another " somewhere near the end and see if it throws a more useful error with the line number the bogus string begins on? (Would that work?)

Re: Failed to parse shipdata.plist, "reached end of string"

Posted: Wed Nov 09, 2011 7:39 am
by Thargoid
Better might be using a programmer-oriented file editor like Notepad++. Those tend to highlight pairs of operators (quotes, brackets etc) in different colours. Makes things much more simple for such tracking down.

Adding the quote at the end may work, but it also may just throw up an error for that last line. If it's a multi-part shipdata.plist file (ie multiple ships) the other option is to chop it up into just one ship entry, get that working then add the next and so on until you find the glitch. Do it in more bite-sized chunks makes it easier.

Re: Failed to parse shipdata.plist, "reached end of string"

Posted: Wed Nov 09, 2011 4:37 pm
by RyanHoots
Adding a " at line 76 between two ship entries got me this:

Code: Select all

11:30:47.850 [shipData.load.begin]: Loading ship data.
  11:30:47.879 [plist.parse.failed]: Failed to parse AddOns/ryan-bonus-textures.oxp/Config/shipdata.plist as a property list.
Parse failed at line 77 (char 1137) - unexpected character (wanted '=')

I guess this means the error is on a line above the 77th.

The only editor I've ever used for OXPing is gedit, and I can't find a way to get Notepad++ without Wine or Virtual Box, which would make OXPing a hassle. Anyone know of a good .plist editor for Linux?

Re: Failed to parse shipdata.plist, "reached end of string"

Posted: Wed Nov 09, 2011 6:34 pm
by Micha
gedit is as good as, or better than, Notepad++ - the suggestion was meant to not use Notepad (the assumption being that everybody uses Windows and Notepad by default).

In gedit, use View->Highlight Mode->(various, eg, Sources->C) and it will start highlighting things, specifically, strings. Makes it much easier to track unterminated strings down.

So far I haven't found a plist editor for Linux (not that I've spent much time looking either..)

Cheers,
- Micha.

Re: Failed to parse shipdata.plist, "reached end of string"

Posted: Wed Nov 09, 2011 7:08 pm
by RyanHoots
I've been looking for the problem, it's a long file, and it's going slowly. The highlight didn't work, no matter what I chose it didn't give me any insight. Anyone know how hard it would be to make an openstep highlight? Or should I rewrite the property list in XML? This is the first really big OXP I've tried, it should add many new textures to the game. The file is pretty much just a bunch of "like_ship"s with new textures.

Re: Failed to parse shipdata.plist, "reached end of string"

Posted: Wed Nov 09, 2011 7:12 pm
by Thargoid
Post it here in code tags, or put it on box.net or something. Then we can sort it properly for you.

Re: Failed to parse shipdata.plist, "reached end of string"

Posted: Wed Nov 09, 2011 7:16 pm
by RyanHoots
Thargoid wrote:
Post it here in code tags, or put it on box.net or something. Then we can sort it properly for you.
Good idea. I've been able to verify where the error is by commenting out a large area, and I'm closing in on the error. The error is in here, somewhere:

Code: Select all

/*"ryan_ferdelance" =
	{
	like_ship = "ferdelance";
	materials =
		{
			"ferdelance_redux.png" = { diffuse_map = "ryan_ferdelance.png"; };
		};
	};

"ryan_gecko" =
	{
	like_ship = "gecko";
	materials =
		{
			"gecko_redux.png" = { diffuse_map = "ryan_gecko.png"; };
		};
	};

"ryan_gecko_2" =
	{
	like_ship = "gecko";
	materials =
		{
			"gecko_redux.png" = { diffuse_map = "ryan_gecko_2.png"; };
		};
	};

"ryan_krait" =
	{
	like_ship = "krait";
	materials =
		{
			"krait_redux.png" = { diffuse_map = "ryan_krait.png"; };
		};
	};

"ryan_mamba" =
	{
	like_ship = "mamba";
	materials =
		{
			"mamba_redux.png" = { diffuse_map = "ryan_mamba.png"; };
		};
	};

"ryan_navy_cobra1" =
	{
	like_ship = "cobramk1";
	materials =
		{
			"cobra1_redux.png" = { diffuse_map = "ryan_navy_cobra1.png"; };
		};

"ryan_navy_cobra1-2" =
	{
	like_ship = "cobramk1";
	materials =
		{
			"cobra1_redux.png" = { diffuse_map = "ryan_navy_cobra1-2.png"; };
		};
	};

//Ship texture based on the Cobra Mk3 texture from Deepspace Ships OXP
"ryan_new_oneric" =
	{
	like_ship = "cobra3-trader";
	materials =
		{
			"cobra3_redux.png" = { diffuse_map = "ryan_new-oneric.png"; };
		};
	};

"ryan_oneric" =
	{
	like_ship = "cobra3-trader";
	materials =
		{
			"cobra3_redux.png" = { diffuse_map = "ryan_oneric_redux.png"; };
		};
	};

"ryan_python" =
	{
	like_ship = "python";
	materials =
		{
			"python_redux.png" = { diffuse_map = "ryan_python.png"; };
		};
	};

"ryan_python_ultracool" =
	{
	like_ship = "python";
	materials =
		{
			"python_redux.png" = { diffuse_map = "ryan_python_ultracool.png"; };
		};
	};

"ryan_viper" =
	{
	like_ship = "viper";
	materials =
		{
			"viper_redux.png" = { diffuse_map = "ryan_viper_redux.png"; };
		};
	};

"ryan_viperi" =
	{
	like_ship = "viperi";
	materials =
		{
			"viperi_redux.png" = { diffuse_map = "ryan_viperi_redux.png"; };
		};
	};
*/
Edit: I have fixed the error with the Viper Interceptor. Now to find the stray quotation mark...

Re: Failed to parse shipdata.plist, "reached end of string"

Posted: Wed Nov 09, 2011 7:29 pm
by RyanHoots
:oops:
I forgot to put a " }; " somewhere that needed it.
Thanks for all your help, I may even release this OXP someday... but I'm warning you, the textures are horrible. THe only reason I want them in game is because I worked so hard on them and have never seen most of them as they appear in Oolite.

Re: Failed to parse shipdata.plist, "reached end of string"

Posted: Wed Nov 09, 2011 7:37 pm
by Eric Walch
RyanHoots wrote:
:oops:
I forgot to put a " }; " somewhere that needed it.
Yep, in "ryan_navy_cobra1". When you find a real code editor, it will also show your matching {}. And you can collapse whole blocks of matching {} to get a better overview of the whole code. It is worth it, it save lots of looking for typos. :wink:
In your case just collapse ship by ship until things go wrong for a ship.
Very helpful:
Image
This one sits on the installation disk of Mac osx. But for sure similar things exist for windows and linux.

Re: Failed to parse shipdata.plist, "reached end of string"

Posted: Thu Nov 10, 2011 7:40 am
by Capt. Murphy
All you need to find your ideal text editor.

http://en.wikipedia.org/wiki/Comparison_of_text_editors

Re: Failed to parse shipdata.plist, "reached end of string"

Posted: Thu Nov 10, 2011 8:52 am
by Eric Walch
Capt. Murphy wrote:
All you need to find your ideal text editor.

http://en.wikipedia.org/wiki/Comparison_of_text_editors
Interesting link. Should probably go to the wiki page with useful tools.

In the list I see a lot of Mac-only and Windows only editors. None is Lunux-only. That probably leaves only the two java based editors for Linux. And as it should run on all platform,I just installed it on my mac. Looks useful and at least it supports the nice features as showing matching quotes and finding matching brackets. Good for RyanHoods as I think he is on linux and according to the comparison list it supports even more than gedit.
I also see that much preferred notepad++ also has all these nice features.

Re: Failed to parse shipdata.plist, "reached end of string"

Posted: Thu Nov 10, 2011 9:04 am
by Capt. Murphy
There are about 30 cross platform editors all listed as Linux compatible.

Re: Failed to parse shipdata.plist, "reached end of string"

Posted: Thu Nov 10, 2011 9:11 am
by Eric Walch
Capt. Murphy wrote:
There are about 30 cross platform editors all listed as Linux compatible.
I see it now better. That there was no list with 'linux-only' does not mean no-linux :D . For all linux editors exits also a windows or mac version. I should read better. :wink:

Added your link to the wiki page with list of software