isStation property
Moderators: winston, another_commander
isStation property
Sorry if this is obvious, but where in the Wiki is the doc for player.ship.target.isStation?
Re: isStation property
Is this the documentation you're looking over the horizon for?
http://wiki.alioth.net/index.php/Oolite ... ce:_Entity
http://wiki.alioth.net/index.php/Oolite ... ce:_Entity
Reports of my death have been greatly underestimated.
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: isStation property
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
http://wiki.alioth.net/index.php/Oolite ... #isStation
Re: isStation property
I want to test if a station is a rock hermit. Maybe I am barking up the wrong tree.
Re: isStation property
Ah! You may be better off with the primaryRole or hasRole properties, then.streb2001 wrote:I want to test if a station is a rock hermit. Maybe I am barking up the wrong tree.
Reports of my death have been greatly underestimated.
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: isStation property
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
Thanks chaps. I will try this out.
Re: isStation property
OK I'm back, sorry. Is it possible to control the player ship's speed from a script?
- Norby
- ---- 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
The ship.speed is read-only but there are two indirect ways to manipulate.streb2001 wrote:Is it possible to control the player ship's speed from a script?
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
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...
I am now on ILS 1.4 Great stuff, thanks.
ed 2. removed stupid question...
- Norby
- ---- 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
I am glad but you proof we need a semi-auto oxz update feature.streb2001 wrote:I was using ILS 1.3, not realising you have already fixed this.
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.