Page 6 of 13
Re: [Release] RandomHits 1.5.3
Posted: Wed Nov 06, 2013 7:17 pm
by pagroove
Is this the error?
I'm on Mac.
Code: Select all
20:05:39.706 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (Random_Hits 1.5.4): TypeError: system.addShips(barRole, 1, barPosition, 10) is null
20:05:39.706 [script.javaScript.exception.unexpectedType]: /Users/pagroove/Games/Oolite 1.77.1/AddOns/RandomHits1.5.4.oxp/Scripts/oolite-randomHits.js, line 797.
Re: [Release] RandomHits 1.5.3
Posted: Wed Nov 06, 2013 8:45 pm
by Commander McLane
Yes. It seems that either the local variable "barRole" or the local variable "barPosition" is not defined, more probably the former. It should contain a string corresponding to the roles
key of one of the space bar entries in shipdata.
Re: [Release] RandomHits 1.5.3
Posted: Wed Nov 06, 2013 10:07 pm
by spara
Thanks guys, much appreciated. I'm fairly sure I know where the problem is. Give me a couple of days and I'll fix it. I'm a bit occupied at the moment.
Re: [Release] RandomHits 1.5.3
Posted: Wed Nov 06, 2013 11:05 pm
by Eric Walch
Unrelated, but I see also the following error in the log:
Code: Select all
20:01:03.170 [script.javaScript.exception.notDefined]: ***** JavaScript exception (buoyRepair): ReferenceError: Vector is not defined
20:01:03.170 [script.javaScript.exception.notDefined]: /Users/pagroove/Games/Oolite 1.77.1/AddOns/buoyRepair1.02.oxp/Scripts/buoyRepair.js, line 191.
But version 1.02 must be one of the first releases and is not compatible with current OOlite. The current version is 1.3.2
Same with:
Code: Select all
20:05:39.710 [script.javaScript.exception.notFunction]: ***** JavaScript exception (rockHermit_Locator 1.3): TypeError: player.ship.hasEquipment is not a function
20:05:39.710 [script.javaScript.exception.notFunction]: /Users/pagroove/Games/Oolite 1.77.1/AddOns/Rock_Hermit_Locator1.3.oxp/Config/script.js, line 27.
Version 1.3 was written for Oolite 1.72. There hare several functions deprecated since that release.
Re: [Release] RandomHits 1.5.3
Posted: Wed Nov 06, 2013 11:20 pm
by Eric Walch
Commander McLane wrote:... It should contain a string corresponding to the roles
key of one of the space bar entries in shipdata.
That is why I wrote that shipdata.plist contains a syntax error. An error in the script would affect all OS and would have been reported by everyone. And as Mac got company from Windows 8, that now also does the same strict syntax check, I am more convinced that this is the error.
I am use to see these errors at the start of the log, but that is because I glued a stone brick on my shift-key during startup. In this case the error was only written to the log during cache rebuild. Now, because of the syntax error, all shipdata entries are missing in the cache and the syntax error is not visible anymore in the log.
Re: [Release] RandomHits 1.5.3
Posted: Thu Nov 07, 2013 7:33 am
by spara
It seems I had already corrected the error I was thinking about. I just flew around the eight, jumped to an anarchy system in every galaxy and did not encounter any errors from RH. I've compared the 1.4.18 js to 1.5.4 js and I'm fairly sure the error is not there. So it must be in shipdata. That's 7000 lines long and since I'm not getting any errors, it's like looking for a needle in a haystack
.
I'm on Linux, if that matters anything.
Just to make sure... Did you shift-start after updating RH, PAGroove?
Re: [Release] RandomHits 1.5.4
Posted: Thu Nov 07, 2013 9:17 am
by Eric Walch
So it must be in shipdata. That's 7000 lines long and since I'm not getting any errors, it's like looking for a needle in a haystack .
I just downloaded this version of RH and can confirm that the shipdata.plist is corrupt. On the mac, you already see it by its icon that it contains a syntax error. (the word 'plist' is missing in the icon).
On opening with a plist editor I get the usual error in line 0, so that means manually looking for the error. That is the reason, I often edit files with a plist editor. And when doing it with a text editor, I open it in between with the plist editor for a syntax check of my just edited part.
Re: [Release] RandomHits 1.5.3
Posted: Thu Nov 07, 2013 11:15 am
by pagroove
spara wrote:It seems I had already corrected the error I was thinking about. I just flew around the eight, jumped to an anarchy system in every galaxy and did not encounter any errors from RH. I've compared the 1.4.18 js to 1.5.4 js and I'm fairly sure the error is not there. So it must be in shipdata. That's 7000 lines long and since I'm not getting any errors, it's like looking for a needle in a haystack
.
I'm on Linux, if that matters anything.
Just to make sure... Did you shift-start after updating RH, PAGroove?
Yes I did. Sorry to come with this error so late. But it only came to light after visiting multiple Anarchies.
Re: [Release] RandomHits 1.5.4
Posted: Thu Nov 07, 2013 2:11 pm
by spara
So be it then. Better get to work. Can someone recommend a plist validator for linux?
Re: [Release] RandomHits 1.5.4
Posted: Thu Nov 07, 2013 2:22 pm
by another_commander
spara wrote:Can someone recommend a plist validator for linux?
You can always give a go at the built-in OXP verifier, which normally catches things like syntax errors or other inconsistencies in plists. Example usage:
oolite --verify-oxp ../AddOns/Griff_Shipset_Resources_v1.2.24.oxp
The result of the verification will be saved in the Logs folder, with the OXP name as filename, like this:
Code: Select all
07-Nov-13 15:19 <DIR> .
07-Nov-13 15:19 <DIR> ..
07-Nov-13 15:19 416 Griff_Shipset_Resources_v1.2.24.oxp.log
07-Nov-13 15:19 1,143 Latest.log
07-Nov-13 15:15 1,143 Previous.log
and looks like this:
Code: Select all
15:19:17.185 Running OXP verifier for ../AddOns/Griff_Shipset_Resources_v1.2.24.oxp
15:19:17.185 Scanning files
15:19:17.307 Checking requires.plist
15:19:17.308 Checking for unused files
15:19:17.308 TODO: implement unused files check.
15:19:17.308 OXP verification complete.
15:19:17.488 Exiting: OXP verifier run.
15:19:17.504 .GNUstepDefaults synchronized.
Closing log at 2013-11-07 15:19:17 +0100.
It still has a few TODOs, but the main checks are performed.
Re: [Release] RandomHits 1.5.4
Posted: Thu Nov 07, 2013 3:10 pm
by Commander McLane
Got it! But the shipdata has more than one issue.
1) PlistEdit Pro opens it as a JSON-file, but it should be ASCII. Due to this the file isn't fixable even if all fixes are applied. Because it doesn't have JSON-format, PlistEdit Pro refuses to save or even convert it.
Thus I had to create a new, empty plist in the correct ASCII format, and then copy the code wholesale into it. From there we have a working basis.
2) There's three syntax errors (it's three times the same, so it's likely a c&p-issue). It's in the entries
rh_adck_iteng
random_hits_patrol_impcourier
random_hits_mark_imptrader
To be more precise, in their
materials
dictionary. Each of them looks like this:
Code: Select all
materials =
{
"itrader.png" =
{
diffuse_map = "rh_itrader.png";
illumination_map = "rh_itrader_i.png";
shininess = 64;
specular = (1.0, 0.7, 0.5, 1.0);
}
};
and in each case there's the semicolon after the second-to-last bracket missing. It must be
Code: Select all
materials =
{
"itrader.png" =
{
diffuse_map = "rh_itrader.png";
illumination_map = "rh_itrader_i.png";
shininess = 64;
specular = (1.0, 0.7, 0.5, 1.0);
}; <== insert ';' here
};
Inserting the three missing semicolons into the pasted new file makes it savable as a valid plist in ASCII format.
Re: [Release] RandomHits 1.5.4
Posted: Thu Nov 07, 2013 4:06 pm
by Eric Walch
Commander McLane wrote:1) PlistEdit Pro opens it as a JSON-file, but it should be ASCII. Due to this the file isn't fixable even if all fixes are applied. Because it doesn't have JSON-format, PlistEdit Pro refuses to save or even convert it.
I can confirm that adding a semicolon on the 3 locations fixes the problem. The JSON problem, I don't see. I edited it with Text-edit and after that, the default plist editor could open it. I never use 'PlistEdit Pro' but version 1.3 was still hanging around on my old computer. That also opened the original file after the error report.
I did notice that the newest version of PlistEdit is no longer working on Mavericks OS. It crashes. The older PlistEdit from Tiger does still works on Mavericks and also does my version of PlistEdit Pro. Already starting with Lion OS, Apple forces us to use the plist functionality in XCode. But XCode never gives an error on bad plists, it just does not open them.
Re: [Release] RandomHits 1.5.4
Posted: Thu Nov 07, 2013 6:39 pm
by spara
Thanks Commander McLane, I owe you one.
And thank you all for commenting and reporting.
I'm in the middle of updating Keeper's retouched Staer9 ships into RH. Griff's new Ophidian is also going in. When that's done, I'll post a new version including the plist fix above. This weekend, hopefully. Be expecting a bigger download, Ophidian is ~12MB alone
.
Re: [Release] RandomHits 1.5.4
Posted: Fri Nov 08, 2013 2:25 am
by Diziet Sma
spara wrote:Can someone recommend a plist validator for linux?
Ahh.. the perennial problem.. outside of the Apple world, plists get no love at all..
See
this thread for where things stand in the Linux/Windows world..
Re: [Release] RandomHits 1.6
Posted: Fri Nov 08, 2013 9:27 pm
by spara
Random Hits has been updated to 1.6.
* Applied plist fix by Commander McLane.
* Applied AI fix by Eric Walch.
* Updated ships from Staer9's shipset. Updates by Keeper.
* Ophidian updated to Griff's model
* Added four new ships: Gnat and Bug by Griff, Arachnid Mark 1 by Shipbuilder and Monitor Mark II by Staer9/Keeper.
Download size is now ~100 MB.
Enjoy.