
I like to standardize on the Lave Metre (Lm) - I wish Oolite did!
Moderators: winston, another_commander
Oolite enables the Cavezzo of La Serenissima before Napoleon laid waste to it.
No way! Metric degeneracy!! Fight it to the bitter end!!!
Code: Select all
this.$ctLastDist = this.$ctDist;
var ps = player.ship;
// present distance to station
var spos = system.mainStation.position;
this.$ctDist = ps.position.distanceTo(spos);
// distance travelled in one second
var travelledSecond = this.$ctLastDist - this.$ctDist;
Are you trying to replicate the Updating TSC oxp?Reval wrote: ↑Thu Apr 24, 2025 10:16 pmooh I just figured it out and it all seems to fall into place... I put this inside a timer:
and the distance travelled in one second on the timer matches the current ship speed as shown in the GETter HUD. Woohoo! So now, getting the time to Station at present speed is trivial.Code: Select all
this.$ctLastDist = this.$ctDist; var ps = player.ship; // present distance to station var spos = system.mainStation.position; this.$ctDist = ps.position.distanceTo(spos); // distance travelled in one second var travelledSecond = this.$ctLastDist - this.$ctDist;
![]()
The
Code: Select all
this.$ctShips = system.addShips("ct_convoy", this.$ctNumCompanion,[0,0,0]);
var ships = this.$ctShips;
// make each Companion a member of a Group
this.$ctGroup = new ShipGroup("COBRA Convoy",player.ship);
for(var x=0; x<ships.length; x++) {
this.$ctGroup.addShip(ships[x]);
}
Montana - did you ever publish your update for this one?montana05 wrote: ↑Thu Mar 25, 2021 11:14 amFinally, found some time to refresh my Gui coding and found a simple solution:
This is replacing the "Ship Outfitting" with a mission screen and therefore blocking any transaction:Code: Select all
this.guiScreenChanged = function(to, from) { if(to == "GUI_SCREEN_EQUIP_SHIP" && player.ship.dockedStation.primaryRole === "baakili_trader") { var options = { "01_DONE": "Sorry for asking" }; mission.runScreen ( { screenID: "baakili_equipment", title: "Ship Outfitting", message: "We do not need or trade in your inferior technology !", overlay: "FA_baakili_image.png", choices: options, exitScreen: "GUI_SCREEN_STATUS" } ) }; };
Thanks again for the tip.![]()