Haylp

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

Moderators: winston, another_commander

Post Reply
User avatar
Gareth3377
Deadly
Deadly
Posts: 136
Joined: Sat Feb 17, 2007 11:46 pm
Location: Worcester

Haylp

Post by Gareth3377 »

Have generated yet another error - this:

2007-03-28 19:47:59.000 oolite.exe[2644] ***** PlayerEntity DOES NOT RESPOND TO scriptAction: "AddShips: piratestash 1"

can anyone shed any light on this please. Does it refer to a specific OXP?

Thanks in advance

Gareth
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 »

Yep, some OXP has a bad script (it should be addShips:, not AddShips:). Currently there is no useful way of tracking this down. I hope to have a semi-useful way of doing this in the release after next.
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 »

Further elucidation: the semi-useful way will be to print the name of the script in connection with parse errors (but not bad parameter errors). For a plist script in script.plist, the name is the key used in the top-level dictionary of the file; for instance, the first two scripts in Oolite’s standard script.plist are named thargoid_plans and constrictor_hunt. For script segments in shipdata.plist, the name will probably be based on the ship name, and for AIs on the file name.

JavaScript scripts will be able to set their names when they’re loaded; if they don’t, the file name will be used.

Note to OXP developers: only one world script (script.plist script) of a given name may exist. If multiple scripts of a given name are found, the last one found will be used. In other words script names, like file names, must be unique. Given the debug mechanism outlined above, I strongly reccomend using names prefixed with the name of your OXP.
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2278
Joined: Tue Jan 02, 2007 12:38 pm

Post by Killer Wolf »

If multiple scripts of a given name are found, the last one found will be used. In other words script names, like file names, must be unique. Given the debug mechanism outlined above, I strongly reccomend using names prefixed with the name of your OXP.
that explains it then. i thought "script" was a standard name to execute a script. i had two models in production each w/ a standard script to gen a model when i come out of Witchspace - but only one model showed up. so if i called one "station-script.plist" it'll still execute fine?
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 »

No.

The file name should be script.plist. This should contain a dictionary with at least one entry. The keys of these entries are unique script names (and their values are scripts).
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2278
Joined: Tue Jan 02, 2007 12:38 pm

Post by Killer Wolf »

Thanks Ahruman, i'll have a bit play w/ that next time i need to test something.

wish Oolite was written in COBOL, i'd have more of a clue about it :-)
User avatar
Gareth3377
Deadly
Deadly
Posts: 136
Joined: Sat Feb 17, 2007 11:46 pm
Location: Worcester

Post by Gareth3377 »

I have located the offending OXP - it appears to be the Cargo Wrecks Teaser OXP.

Thanks for all your help...

Cheers
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 »

Ahruman wrote:
Yep, some OXP has a bad script (it should be addShips:, not AddShips:). Currently there is no useful way of tracking this down. I hope to have a semi-useful way of doing this in the release after next.
…and the next version will have a hemisemi-useful way: if you enable a log message class (script.trace.plist.run), Oolite will print the name of each script before it is run, so you’ll get debug messages like:

Code: Select all

[script.trace.plist.run]: Running script "buggy script" 0.1 test
[script.debug.badscript]:   ***** A script did something naughty!
As for setting the message class, my super high-tech cross-platform solution for this is: look for logcontrol.plist files in all the places OXPs can live, and merge them with the default one.
User avatar
Gareth3377
Deadly
Deadly
Posts: 136
Joined: Sat Feb 17, 2007 11:46 pm
Location: Worcester

Post by Gareth3377 »

That would be really usefull - and I suppose then we could (users) change the buggy script ourselves. I made the correction to the script myself (okay, it's changing a letter) and it seems to work now as it should.

Another question - why is it that when I turn off virtual memory (I heard this was recommended) Oolite crashes once you've hyperspaced to a destination. However, with virtual memory enabled Oolite is fairly stable (with the expection of some OXPs that doesn't seem to like my 'puter).

Am confused by this.

Gareth
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 »

Quite probably it’s running out of memory. Oolite is essentially written with the assumption that there will be effective virtual memory. Failing that, ineffective virtual memory will do.
Ideally, it would handle this sort of situation by, at worst, exiting cleanly, but at this point finding all the potential low-memory crashes seems intractable. If anyone can provide precise circumstances which cause a nasty crash, we would of course like to know about it.
User avatar
docwild
Dangerous
Dangerous
Posts: 64
Joined: Thu Mar 29, 2007 1:36 pm

Post by docwild »

Ahruman wrote:
Yep, some OXP has a bad script (it should be addShips:, not AddShips:). Currently there is no useful way of tracking this down. I hope to have a semi-useful way of doing this in the release after next.
On linux:

Code: Select all

grep -Hr "AddShips" *.*
run from the Addons directory returns:

Code: Select all

Cargo_wrecks_teaser.oxp/Config/script.plist:                            <string>AddShips: piratestash 1</string>
Can't get much easier than that.
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 »

Yes, but the OP is running Windows. :-) (Actually, I got too caught up in this fancy-schmancy Spotlight thing in OS X to consider grep. Spotlight doesn’t want to seach inside “packages”, including OXPs. :-/ )
User avatar
gabbakeisen
Competent
Competent
Posts: 32
Joined: Sun Mar 04, 2007 2:36 am
Location: Front Left-Hand Corner

Post by gabbakeisen »

Edited the OXP and now I get a treasureoid every time I hyperspace into a system. Anyone else finding this? It would make more sense if it was found near the pirates rather than at a beacon and perhaps needs to be more random rather than every time. Not that I don't enjoy the extra cargo, its just unrealistic.
WooHoo! My fav game now redone for childhood nostalgia of 20 years ago. Now if only I didn't have to go to work so I could live as a virtual space trader.
User avatar
davcefai
---- E L I T E ----
---- E L I T E ----
Posts: 400
Joined: Sun Dec 03, 2006 9:07 pm

Post by davcefai »

The treasureoid IS created at every witchpoint and only yields alloy fragments.

I ended up removing it.
Post Reply