
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.
Noted for later. #encabulator"scripted-item-scooped" is used by this line (12965) of ShipEntity.m:What happens here is quite interesting. As you can see, there is an argument called shipName in tbe addMessage selector. At the same time, the expansion of the string "scripted-item-scooped" contains the term [shipName]. In order for the expansion to occur correctly, the argument and the term inside the square brackets in the expansion must both be called "shipName". Changing any of the two to something else will cause the exapnsion to fail.Code: Select all
[UNIVERSE addMessage:OOExpandKey(@"scripted-item-scooped", shipName) forCount:4];
But that is for scripted cargo only and is not the line that generates the "1t Furs" (or whatever) message normally. This happens further down, at line 13035 of ShipEntity.m, which reads:. The describeCommodity method in Universe.m builds the string that is displayed.Code: Select all
[UNIVERSE addMessage:[UNIVERSE describeCommodity:co_type amount:co_amount] forCount:4.5];
I hope this helps. This was by just looking at what happens in the source and without any actual testing on my part, so I hope I got it right.