Page 1 of 1

isStation property

Posted: Sun Jun 07, 2015 12:06 pm
by streb2001
Sorry if this is obvious, but where in the Wiki is the doc for player.ship.target.isStation?

Re: isStation property

Posted: Sun Jun 07, 2015 12:14 pm
by Layne
Is this the documentation you're looking over the horizon for?

http://wiki.alioth.net/index.php/Oolite ... ce:_Entity

Re: isStation property

Posted: Sun Jun 07, 2015 12:15 pm
by Wildeblood
What more do you need to know? It's true if a ship is a station and false if it's an ordinary ship.

http://wiki.alioth.net/index.php/Oolite ... #isStation

Re: isStation property

Posted: Sun Jun 07, 2015 12:19 pm
by streb2001
I want to test if a station is a rock hermit. Maybe I am barking up the wrong tree.

Re: isStation property

Posted: Sun Jun 07, 2015 12:24 pm
by Layne
streb2001 wrote:
I want to test if a station is a rock hermit. Maybe I am barking up the wrong tree.
Ah! You may be better off with the primaryRole or hasRole properties, then.

Re: isStation property

Posted: Sun Jun 07, 2015 12:27 pm
by Wildeblood
Check the roles of the rock hermit in the shipdata.plist. It will be something like rockhermit, hermit, rock_hermit, I don' know off the top of my head.

Code: Select all

var target = player.ship.target;
    if (target.primaryRole === "rockhermit") {
    ... your code here...
    }

Re: isStation property

Posted: Sun Jun 07, 2015 12:33 pm
by streb2001
Thanks chaps. I will try this out.

Re: isStation property

Posted: Sun Jun 07, 2015 4:29 pm
by streb2001
OK I'm back, sorry. Is it possible to control the player ship's speed from a script?

Re: isStation property

Posted: Sun Jun 07, 2015 6:00 pm
by Norby
streb2001 wrote:
Is it possible to control the player ship's speed from a script?
The ship.speed is read-only but there are two indirect ways to manipulate.

1. ship.velocity is used by [wiki]Q-Charger[/wiki]. If you enlarge or shrink this vector then the core will calculate the movement based on this but the change is temporary due to the thrust of engines will reduce it to the normal value unless you set it in each frame in an FCB.

2. entity.position is writable so you can simulate any speeds if you recalculate the wanted new position in each frame. [wiki]TorusToSun[/wiki] and [wiki]FarPlanets[/wiki] use this way, but if you set high speeds then there are some side effects like shaking sky and left behind exhaust plumes.

Both ways need an update in [wiki]CombatMFD[/wiki] and [wiki]NumericHUD[/wiki] due to the numeric speed displays in these show exact values only when follow all hacks.

If you tell more about your goal then I can help more.

Re: isStation property

Posted: Sun Jun 07, 2015 6:27 pm
by streb2001
Thanks Norby. Actually you have fixed my problem already! I was trying to modify ILS so that the ship stopped before it did the circular waypoint hunting bug in rock hermits. I was using ILS 1.3, not realising you have already fixed this.

I am now on ILS 1.4 Great stuff, thanks.

ed 2. removed stupid question...

Re: isStation property

Posted: Sun Jun 07, 2015 8:43 pm
by Norby
streb2001 wrote:
I was using ILS 1.3, not realising you have already fixed this.
I am glad but you proof we need a semi-auto oxz update feature.

I suggest to develop this in the following steps:

1. A message should be appear above the main menu when the manifest is more than a week old and at least a single oxz is installed to suggest the check for updates. The "Manage expansions packs" menu item should be replaced to "Update expansions list" in this case (save a step).

2. When Continue is pressed after manifest is updated the "u" filter should be auto-activated, except if no updates found.

This is enough for a quick fix, the followings are just ideas to make it more comfortable:

3. An autoupdate process can start when the manifest is more than a week old and at least a single oxz is installed, like the computer itself press Manage Expansion Packs, then Update expansions list, then Continue, then "f" then "u" and stop here if anything is need an update, else unset "u" filter, jump back to the menu and display a message about no update needed.

4. The oxz admin page can generate a short file with oxp identifiers and versions only (~2k I guess). The game download it right in the main menu within a second (silently ignore any errors without net) and display a message about how many updates are available. When we press the manage menu while updates are available then the game assume we want updating so start the download of new manifest and jump into the "u" filtered blue list. In this way we just need to press enter on each updates and never forget to apply a fix.