Page 1 of 2

UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 4:36 am
by mandoman
I'm stumped. Latest.log keeps giving this warning,

Code: Select all

22:29:12.408 [plist.parse.failed]: Failed to parse /home/mandoman/.Oolite/AddOns/U.F.P.WorldShip.oxp/Config/shipdata.plist as a property list.
Parse failed at line 61 (char 1910) - unexpected character (wanted '=')
I can't see what it wants. I discovered this when I tried to spawn this ship using the Java Debug Console. I had it spawn this same ship no more than six hours ago, and now it gives that warning. I'll tag the shipdata.plist. Any help is appreciated.

Code: Select all

{
        U.F.P.WorldShip = {
                "aft_weapon_type" = "WEAPON_MILITARY_LASER";
                "ai_type" = "nullAI.plist";
		"bounty" = 0;
		"cargo_type" = "CARGO_NOT_CARGO";
		"energy_recharge_rate" = 9.9;
		"equipment_price_factor" = 2.0;
		"equivalent_tech_level" = 14;
		"exhaust" = (
			"-5744 -1468 -6824 100 50 80.5",
			"-3306 -3485 -6824 100 50 80.5",
			"0 -4277 -6824 100 50 80.5",
			"3306 -3957 -6824 100 50 80.5",
			"5744 -1468 -6824 100 50 80.5"
		);
		"forward_weapon_type" = "WEAPON_MILITARY_LASER";
		"fuel" = 500;
		"has_ecm" = yes;
		"has_heat_shield" = yes;
		"has_hyperspace_motor" = yes;
		"has_shield_booster" = yes;
		"has_shield_enhancer" = 7.0;
		"has_npc_traffic" = no;
		"is_carrier" = no;
		"is_template" = no;
                "laser_color" = "whiteColor";
		"market" = "U.F.P.WorldShip";
		"max_cargo" = 200000;
		"max_energy" = 999;
		"max_flight_pitch" = 0.2;
		"max_flight_roll" = 0.2;
		"max_flight_speed" = 80;
		"model" = "ufpworldship.dat";
		"name" = "U.F.P.WorldShip";
                "port_weapon_type" = "WEAPON_MILITARY_LASER";
		"roles" = "U.F.P.WorldShip";
		"scan_class" = "CLASS_POLICE";
                "starboard_weapon_type" = "WEAPON_MILITARY_LASER";
		"subentities" = (
            {
			type = "flasher";
                        position = "-3827 932 -2203";
                        color = "whiteColor";
                        frequency = "0";
                        phase = "50";
                        size = "600";
			},
            {
			type = "flasher";
                        position = "3827 932 -2203";
                        color = "whiteColor";
                        frequency = "0";
                        phase = "50";
                        size = "600";
	    {
			type = "ball_turret";
			subentity_key = "ufpturret2";
			position = (-4782, 1334, -1687);
			orientation = (0.819, 0, 0.574, 0);
                        },
            {
			type = "ball_turret";
			subentity_key = "ufpturret2";
			position = (-1100, 1334, 5996);
			orientation = (0.819, 0, 0.574, 0);
			},
            {
			type = "ball_turret";
			subentity_key = "ufpturret2";
			position = (1100, 1334, 5996);
			orientation = (0.819, 0, 0.574, 0);
			},
            {
			type = "ball_turret";
			subentity_key = "ufpturret2";
			position = (4782, 1334, -1687);
			orientation = (0.819, 0, 0.574, 0);
			}
                   );
                 "thrust" = 400;  
                 "weapon_position_aft" = "0.0 -2733.0 -6279";
                 "weapon_position_forward" = "0.0 820 7010";
                 "weapon_position_port" = "-6287 843 -599";
                 "weapon_position_starboard" = "6287 843 -599";
        };
        ufp_turret2 = {
                "ai_type" = "nullAI.plist";
		"laser_color" = "whiteColor";
		"model" = "ufpturret2.dat";
		"smooth" = "yes";
		"materials" = "ufpturret2.png";		
		"name" = "ufp_turret2";
		"roles" = "ufp turret2";
		"thrust" = 1;
		"weapon_energy" = 50;
       };
}

Re: UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 6:03 am
by Fatleaf
Make lines 97 - 99.

Code: Select all

	  };
	};
}
You were missing a };
If that doesn't work send the rest to me and I will take a look at it for you.

Re: UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 6:52 am
by Fatleaf
Got it now. And it seems to work for me!

Re: UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 8:56 am
by Smivs
Well there is a missing closing brace ( } ) at line 55 I suspect.
Also a few things which have puzzled me.
You have

Code: Select all

      "equipment_price_factor" = 2.0;
      "equivalent_tech_level" = 14;
which are station keys, yet it doesn't seem to have a dock and is not a carrier, so I'm not sure what is going on there.
Also you specify side weapons

Code: Select all

                "port_weapon_type" = "WEAPON_MILITARY_LASER";
      "roles" = "U.F.P.WorldShip";
      "scan_class" = "CLASS_POLICE";
                "starboard_weapon_type" = "WEAPON_MILITARY_LASER";
which won't do anything on an NPC ship as they can't have these.
I presume that the Police scan_class is intentional...this scan_class needs to be used with care.

Re: UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 2:37 pm
by mandoman
Thanks Fatleaf, and Smivs. I forgot about the npc ships not allowed military lasers, though I never get an error report on listing them. The price factor thing was just an experiment, but I have obviously misinterpreted the data at hand once more. :mrgreen:

Re: UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 2:45 pm
by another_commander
mandoman wrote:
I forgot about the npc ships not allowed military lasers, though I never get an error report on listing them.
Actually, what is not supported is port and starboard lasers on NPCs.

Edit: Hey, I ninja'd Thargoid, I'm proud of myself ;-)

Re: UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 2:45 pm
by Thargoid
NPCs are allowed military lasers. It's port and starboard laser mounts that they lack.

Edit - Ninka'd by A_C in a role reversal from normal ;)

Re: UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 3:11 pm
by mandoman
Okay, I dumped those, but am still getting the error report. It refers to a line that is basically the beginning of the ball turrets listing, but I've compared it with several other oxps, and they don't seem to be faulty. It worked once, so I'm wondering if running it on a Linux/Ubuntu 64-bit system is part of the problem.

Re: UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 3:15 pm
by Thargoid
There's a closing brace ( } ) and comma missing at the end of the second flasher in the sub-entities definition.

Re: UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 3:24 pm
by mandoman
Thargoid wrote:
There's a closing brace ( } ) and comma missing at the end of the second flasher in the sub-entities definition.
I should have known that you would be the one to find it. I should just whine to you when I get a problem in shipdata, LOL!! What confuses me is that it kept telling me that it was line 61 that had the problem, and the line that was missing the bracket was line 54. I might have seen it if it had pointed me to that line, though I admit I'm kind of blind. :D

Thanks, Thargoid.

Re: UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 3:28 pm
by Smivs
Smivs wrote:
Well there is a missing closing brace ( } ) at line 55 I suspect.
OK, so I forgot to mention the comma :P :D :lol:

Re: UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 3:29 pm
by Thargoid
This is where a code-optimised file editor (like Notepad++ for Windows or Kate for Linux) come in handy, as they will highlight bracket pairs which makes it easier to spot where one(s) are missing. Either that or just write a lot of OXP code, it makes your eye quite quick to spot such things.

As to the line reported in the error log, that is only as good as the best guess of the compiler. In this case as it's within an array it will blur things slightly - had the missing brace been something like a missing quote mark on a single line then the error would be more accurate (usually).

Re: UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 3:35 pm
by mandoman
Okay, good to know. I'll check around more widely from now on. However, even after fixing the problem, the Debug Console still won't spawn the ship. It doesn't say why it won't, of course, just that it won't. :roll:

Re: UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 3:41 pm
by Fatleaf
I find that strange as the oxp you sent me worked fine, first time. I can take pictures if you wish!

Re: UNEXPECTED CHARACTER WANTED '=' HELP!!!!

Posted: Sat Mar 03, 2012 3:47 pm
by mandoman
Oh yeah, if you don't mind. I was just trying to get a feel for how it appeared in game. Thanks. :D