• 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 Shipyard interface showing "Cannot Buy" in error

Talisman

Smuggler
Storm Modder
In Beta 4 Public release

In the Shipyard when I check to see if there are any ships I can buy - the label below the ship picture that says "Cannot Buy - Too expensive" is attaching itself to ships that I can buy - it seems to depend on whether the first ship in the list is too expensive ( then the label attaches itself to all the ships in the list ) :shrug

I am playing with the option to buy any ship ( in the options settings ) - don't know if this is affecting things.

Save is just before talking to shipyard owner.


:read
 

Attachments

  • PotC_Shipyard_Expensive1.jpg
    PotC_Shipyard_Expensive1.jpg
    455.3 KB · Views: 94
  • PotC_Shipyard_Expensive2.jpg
    PotC_Shipyard_Expensive2.jpg
    247 KB · Views: 94
  • -=Player=- Barbados.7z
    474.5 KB · Views: 80
  • compile.log
    2.3 KB · Views: 92
  • error.log
    2.3 KB · Views: 110
  • system.log
    1.4 KB · Views: 103
Loaded your save and it doesn't do it on default settings , so it is unless the first ship is more expensive and the shipyard ship availability option is set to POTC (the other ship availability option underneath it doesn't affect it). Can you just turn that top one to default for an encounter in the shipyard when your next nearby one with a spare officer handy and confirm your game resets OK (you could use that save I guess) so that I am 100% sure where to look for a fix. You can, of course, then immediately restore your setting and carry on.
 
Reordering this code seems to help:
Code:
  // TIH --> rpg_style Jul27'06
   DisableString("NoBuyString");
   //SetNodeUsing("NOBUYBOX1",false);
   SetNodeUsing("NOBUYBOX2",false);
   GameInterface.strings.NoBuyString = "";
   if ( SY_RPG_STYLE ) {
     string attributeName = "pic" + (nCurSScrollNum+1);
     if ( CheckAttribute(GameInterface,"scrollitems."+(attributeName)+".skipsell") && GameInterface.scrollitems.(attributeName).skipsell==true ) {
       hideNoBuy = false;
       EnableString("NoBuyString");
       //SetNodeUsing("NOBUYBOX1",true);
       SetNodeUsing("NOBUYBOX2",true);
       // PB: Realistic Ship Purchase -->
       if( CheckAttribute(GameInterface,"scrollitems."+(attributeName)+".pirateship") && GameInterface.scrollitems.(attributeName).pirateship==true )
       {GameInterface.strings.NoBuyString = XI_ConvertString("Cannot Buy - Pirate Ship");}
       else
       {
         if( CheckAttribute(GameInterface,"scrollitems."+(attributeName)+".navyship") && GameInterface.scrollitems.(attributeName).navyship==true )
         {GameInterface.strings.NoBuyString = XI_ConvertString("Cannot Buy - Navy Ship");}
         else
         {GameInterface.strings.NoBuyString = XI_ConvertString("Cannot Buy - Tier Too High");}
       }
       // PB: Realistic Ship Purchase <--
     }
   }

Some extra notes:
- Something weird is going on with the "Contraband on Ship" text
- WHY the holy crappaloni is the "Bermuda Sloop" SO much more expensive than similar ships???
English Bark/European Barque: 7090
Bermuda Sloop: 91131
Lugger: -5439
- Unconfirmed Bug - "Advanced Warship" Interface Screenshot too Dark | PiratesAhoy!
 
Try attached; extract to PROGRAM\INTERFACE .

Contains the above fix to make the "No Buy String" appear/disappear also when the option to buy any ship is enabled.

Additionally, I added a line for contraband checking, so that now when NO ship is selected, it will check the PLAYER ship.
This happens while you're scrolling. But does it make sense to have it like that?
 

Attachments

  • shipyard.zip
    31.5 KB · Views: 89
Thanks for the help

@pedrwyth

When I change the Options in Shipyard Availability & Realistic Ship Purchase back to the default settings - everything works OK. :thumbs1 ( this is before installing @Pieter Boelen 's file above. :yes

@Pieter Boelen

Installed the file above - now on both the default & non-default settings in OPTIONS > Shipyard Availability & Realistic Ship Purchase. The label below the ship picture that says "Cannot Buy - Too expensive" or Navy Ship ( as appropriate ) is working OK :thumbs1

But now it will not let me buy a ship for my Officer because I have contraband aboard my ship. :unsure

I can understand it not letting me swap/buy a new ship because of my contraband cargo - but why can't I buy a ship for an officer who is currently one of my passengers:shrug

All tests done with the Save in the 1st post above.
 

Attachments

  • PotC_Shipyard_3.jpg
    PotC_Shipyard_3.jpg
    462.8 KB · Views: 96
But now it will not let me buy a ship for my Officer because I have contraband aboard my ship. :unsure
In PROGRAM\INTERFACE\shipyards.c find:
Code:
  //Levis: contraband checking
   if(nCurFourNum > -1)
   {
     if(cn < 0) cn = GetMainCharacterIndex(); // PB: If NO ship selected, then check player ship
     if(CheckForContraband(GetCharacter(cn)))
     {
       EnableString("NoBuyString");
       SetNodeUsing("NOBUYBOX2", true);
       GameInterface.strings.NoBuyString = "Cannot Buy - Contraband on board";
     }
   }
Get rid of that line marked "PB".

That was an attempted fix of mine, because it didn't seem to work right.
But clearly my attempt failed, because now it works wrong in a different (and more annoying!) way. :facepalm
 
:dance


That works - can now buy my officer a ship - with both the default & the other settings in OPTIONS - Shipyard Ship Availability and in Realistic Ship Purchase.

:bow
 
Can you buy yourself a new ship while you have contraband on board?
I think that should not be possible, but I'm not sure if it truly is....
 
Can you buy yourself a new ship while you have contraband on board?
I think that should not be possible, but I'm not sure if it truly is....

:no

No - that is not possible - the notification appears below the ship portrait & there is also a big black box at the bottom the the screen saying that you can't sell your ship because of contraband.

:drunk
 
Then I suppose that line was never needed. OK then; thanks for checking. :doff
 
Back
Top