
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.![]()
Cholmondely wrote: ↑Tue Jul 01, 2025 12:12 pmMontana - 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.![]()
Please!montana05 wrote: ↑Tue Jul 15, 2025 12:54 pmCholmondely wrote: ↑Tue Jul 01, 2025 12:12 pmMontana - did you ever publish your update for this one?montana05 wrote: ↑Thu Mar 25, 2021 11:14 am
Finally, 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.![]()
No, I never did, like usually I included a lot of new features but never actually finished to remove the remaining bugs. I still have the code somewhere so I could upload it.
Cholmondely wrote: ↑Tue Jul 15, 2025 12:56 pmPlease!montana05 wrote: ↑Tue Jul 15, 2025 12:54 pmCholmondely wrote: ↑Tue Jul 01, 2025 12:12 pm
Montana - did you ever publish your update for this one?
No, I never did, like usually I included a lot of new features but never actually finished to remove the remaining bugs. I still have the code somewhere so I could upload it.