• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed Ship Interface String Problems

Mere_Mortal

Free Like a Radical
Storm Modder
Two things I just fixed on the ship interface...

The number displayed for ship turn did not have the decimal place. This was easily fixed by using the same format as the other attribute uses.

The string for the number of guns currently installed decides to not want to be displayed.

I fixed it by duplicating the CreateString, like so... [SNIP] Why that string was not being displayed, even if just “0”, is beyond me since it was correctly entered into the interface attributes. I don’t see why it should be necessary to do what I did here, but it sorts it out so I’m happy. Oh, now I get it. The skills summary is interfering with the cannons - as soon as the summary is displayed the cannons quantity changes to the skill value.

Yep, now I have changed the string name for the cannon quantity to QCannons and it has fixed the problem. :cheeky
Code:
CreateString(true,"QCannons","0",FONT_BOLD_NUMBERS,COLOR_NORMAL,575,154,SCRIPT_ALIGN_CENTER,0.6);

GameInterface.strings.TCannons = GetCannonName(GetCaracterShipCannonsType(otherCh));
GameInterface.strings.QCannons = GetLocalShipAttrib(&tmpar,&refBaseShip,"CurCanQty");
if (sti(GameInterface.strings.QCannons) == 0 && GetCaracterShipCannonsType(refMyCh) == CANNON_TYPE_NONECANNON) {
   SetSelectable("RCANNONS", false);
   GameInterface.strings.QCannons = "";
}
 
Last edited:
This is the F2>Ship Interface, right? And that one never displayed properly before?
Thanks for catching and fixing! :cheers
 
Yeah, that one. Dunno if the turn rate was changed with the fix for unique ships, or what. As for the cannon string, that has been bugging me for some time because on occasion I might not notice a companion has lost a gun or three. :facepalm
 
Last edited:
So replacing "Cannons" with "QCannons" made it work? Wow. o_O

But yes, I can confirm that it makes a difference. Thanks for catching and fixing it! :woot

Edit: Extra suggestion of mine:
Code:
     GameInterface.strings.ShipSpeed  = FloatToString(stf(GetLocalShipAttrib(tempref, refBaseShip, "SpeedRate")),2);
     GameInterface.strings.ShipManeuver  = FloatToString(stf(GetLocalShipAttrib(tempref, refBaseShip, "TurnRate")),2); // MM
That brings it in line with the Shipyard Interface. Advantage is that "16" then displays as "16.0" instead of "16." :doff
 
Yep, it works because the Cannons string was also being used by the skills summary, so one of them had to change.

So basically, the fts function is pretty useless really and we should just use FloatToString instead?
 
Last edited:
Yep, it works because the Cannons string was also being used by the skills summary, so one of them had to change.
Ah, that does explain it. Good catch indeed! :onya

So basically, the fts function is pretty useless really and we should just use FloatToString instead?
I've never used fts myself; the game code usually converts stuff to string if necessary anyway.

Not sure about the differences between both functions.
All I know is that the Shipyard Interface apparently uses that FloatToString function for that purpose.
 
Back
Top