Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

isStation property

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

Moderators: winston, another_commander

Post Reply
User avatar
streb2001
Competent
Competent
Posts: 53
Joined: Sat Aug 16, 2014 12:06 pm

isStation property

Post by streb2001 »

Sorry if this is obvious, but where in the Wiki is the doc for player.ship.target.isStation?
Layne
---- E L I T E ----
---- E L I T E ----
Posts: 355
Joined: Sat Mar 28, 2015 11:14 pm

Re: isStation property

Post by Layne »

Is this the documentation you're looking over the horizon for?

http://wiki.alioth.net/index.php/Oolite ... ce:_Entity
Reports of my death have been greatly underestimated.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2306
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: isStation property

Post 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
User avatar
streb2001
Competent
Competent
Posts: 53
Joined: Sat Aug 16, 2014 12:06 pm

Re: isStation property

Post by streb2001 »

I want to test if a station is a rock hermit. Maybe I am barking up the wrong tree.
Layne
---- E L I T E ----
---- E L I T E ----
Posts: 355
Joined: Sat Mar 28, 2015 11:14 pm

Re: isStation property

Post 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.
Reports of my death have been greatly underestimated.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2306
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: isStation property

Post 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...
    }
User avatar
streb2001
Competent
Competent
Posts: 53
Joined: Sat Aug 16, 2014 12:06 pm

Re: isStation property

Post by streb2001 »

Thanks chaps. I will try this out.
User avatar
streb2001
Competent
Competent
Posts: 53
Joined: Sat Aug 16, 2014 12:06 pm

Re: isStation property

Post by streb2001 »

OK I'm back, sorry. Is it possible to control the player ship's speed from a script?
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: isStation property

Post 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.
User avatar
streb2001
Competent
Competent
Posts: 53
Joined: Sat Aug 16, 2014 12:06 pm

Re: isStation property

Post 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...
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: isStation property

Post 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.
Post Reply