Search found 51 matches

by Phasted
Sun Mar 21, 2021 11:45 am
Forum: Expansion Pack
Topic: Scripters cove
Replies: 1717
Views: 735432

Re: Scripters cove

Say, here's a brain-tickler: My world-script needs to create a timer on a ship (station) script... Do I leave the this parameter as-is, referring to the world-script or should I change it to station.script?
by Phasted
Wed Aug 21, 2019 10:32 am
Forum: Discussion
Topic: 281-and-a-half TRILLION galaxies...
Replies: 4
Views: 5229

281-and-a-half TRILLION galaxies...

:shock: [shamelessly "lifted" from Wikipedia ] The Elite universe contains eight galaxies, each with 256 planets to explore. Due to the limited capabilities of 8-bit computers, these worlds are procedurally generated. A single seed number is run through a fixed algorithm the appropriate nu...
by Phasted
Wed Aug 21, 2019 10:11 am
Forum: Discussion
Topic: Oooops ... how far can I go?
Replies: 15
Views: 15078

Re: Oooops ... how far can I go?

Without having a developer build - is there a way I can interrogate the game state to find out, for example, my DistanceFromSun value? I don't know if your questions were answered by anyone else, but: Distance between any two entities: entityA.position.distanceTo(EntityB) Or (more specific): player...
by Phasted
Fri Aug 16, 2019 1:25 pm
Forum: Expansion Pack
Topic: Scripters cove
Replies: 1717
Views: 735432

Re: Scripters cove

phkb wrote: Fri Aug 16, 2019 4:16 am
I'm not JS expert, but shouldn't this line:

Code: Select all

this._CD_addEquipment(equipment)
be this?:

Code: Select all

this._CD_addEquipment = function(equipment)
I just tested this form and that seems to work OK.
Bingo! Dead on the money!

It's amazing how you look right at something and not see it... :oops:
by Phasted
Fri Aug 16, 2019 2:54 am
Forum: Expansion Pack
Topic: Scripters cove
Replies: 1717
Views: 735432

Re: Scripters cove

I'm experiencing a problem (I think it's a problem) with the equipmentAdded event handler. The argument ("equipmentKey") isn't being passed consistently. Here is the code that doesn't work: this.equipmentAdded = function(equipment) {this._CD_addEquipment(equipment);} this._CD_addEquipment(...
by Phasted
Fri Aug 09, 2019 6:34 pm
Forum: Suggestion Box
Topic: Scripting requests
Replies: 833
Views: 332075

Re: Scripting requests

When it's convenient, I'd like to see an event handler that triggers when the Player scans a wormhole (passing the wormhole object). :D
by Phasted
Thu Aug 08, 2019 1:03 pm
Forum: Expansion Pack
Topic: Scripters cove
Replies: 1717
Views: 735432

Re: Scripters cove

Just out of curiosity... When looking at the code of people who are smarter than I am, every now and then I see little things I don't quite understand. For instance: [from oolite-trumbles-mission.js ] this.startUp = function startUp() Why is it a good idea to name the function? Is it somehow necessa...
by Phasted
Tue Jul 31, 2018 8:35 am
Forum: Expansion Pack
Topic: Scripters cove
Replies: 1717
Views: 735432

Re: Scripters cove

Two observations: 1. You will see that in your log, arbitraryProperty is shown as undefined. This would not be saved in a usable form, even if it did get saved, The change of system.info.arbitraryProperty = !!1; to si.arbitraryProperty = !!1 fixes the undefinedness, but it still will not save the v...
by Phasted
Tue Jul 31, 2018 7:39 am
Forum: Expansion Pack
Topic: Scripters cove
Replies: 1717
Views: 735432

Re: Scripters cove

Is there a Latest.log we can look at? Opening log for Oolite version 1.86 (x86-64) under Windows 6.2.9200 64-bit at 2018-07-31 02:15:03 -0500. 8 processors detected. Build options: OpenAL, new planets. Note that the contents of the log file can be adjusted by editing logcontrol.plist. 02:15:03.747 ...
by Phasted
Thu Jul 26, 2018 10:01 pm
Forum: Expansion Pack
Topic: Scripters cove
Replies: 1717
Views: 735432

Re: Scripters cove

It used to be possible to define arbitrary properties on the SystemInfo object and have them saved in the planetinfo_overrides section of the saved game file... is this no longer the case? I can still define properties on SystemInfo, but they aren't being saved... :? I cannot figure out what's wron...
by Phasted
Wed Jul 18, 2018 9:28 pm
Forum: Expansion Pack
Topic: Scripters cove
Replies: 1717
Views: 735432

Re: Scripters cove

It used to be possible to define arbitrary properties on the SystemInfo object and have them saved in the planetinfo_overrides section of the saved game file... is this no longer the case?

I can still define properties on SystemInfo, but they aren't being saved... :?
by Phasted
Tue Jul 25, 2017 2:20 pm
Forum: Expansion Pack
Topic: Scripters cove
Replies: 1717
Views: 735432

Re: Scripters cove

Okay, re: galactic jumps... What's the earliest point in the galactic jump sequence that Oolite knows FOR SURE which system the player will arrive in? Can I, for example, read player.ship.targetSystem in playerEnteredNewGalaxy ? The idea here is to get the system ID before Oolite calculates prices a...
by Phasted
Fri Jun 19, 2015 2:09 am
Forum: Suggestion Box
Topic: Scripting requests
Replies: 833
Views: 332075

Re: Scripting requests

Here's one out of left field (and maybe I'm not the first to suggest it)...

What are the odds of getting system.ID and player.ship.galaxyCoordinatesInLY made read/write?
by Phasted
Sun May 31, 2015 12:12 am
Forum: Expansion Pack
Topic: Scripters cove
Replies: 1717
Views: 735432

Re: Scripters cove

Downloaded 1.82 and I've just started playing around with it. Wrote a test commodity script, just to see what would happen... this.updateGeneralCommodityDefinition = function(mD, sn, sysID) { var p_a = "price_average", p_e = "price_economic", p_r = "price_random"; var d...
by Phasted
Tue May 26, 2015 6:06 pm
Forum: Expansion Pack
Topic: Scripters cove
Replies: 1717
Views: 735432

Re: Scripters cove

Anyway, to repeat my question, so it won't get lost: Is there a way to detect what the player will be jettisoning next? I think you're out of luck... you'll have to ask for an event handler: this.playerDumpedCargo(commodity, quantity) that fires when the player actually ejects a container or this.p...