• 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 Game Crashes due to "Staysails" Upgrade on Cursed Galleon

cpt. Toni

Sailor Apprentice
Playin Build Mode of 19 Nov, Julian Mcallister, having 2 ships. Main ship is Trinity, and 2nd Cursed Galeon. Upgrading first ship & everything is ok, but when upgrading Cursed Galeon game crash when I go on sea, (you can go on main deck, and in the cpt. cabin, but not on sea).
 

Attachments

  • error.log
    529 bytes · Views: 90
which upgrade did you try?
 
Shipyard in Willemstad, but this is not the first time to meet this bug. Happend several times with different characters, often with Hawk when back from Islla de la Muerte to Jamaica with Cursed Galleon (or teleported if there is a storm).
Install all the upgrades at once except the pirate one (corsair refit).
Now I am trying to install one at the time upgrade, so far it is working.
 
Now I am trying to install one at the time upgrade, so far it is working.
That will be very useful information! :onya

I think I've got a pretty good idea of what is going on here already, but I'll be interested to hear if you come to the same conclusion... :cheeky
 
Assuming that I'm right, I've got a fix ready to go.
Once you manage to track down which upgrade it is, I'll post it so you can immediately check if this one resolves the problem. :doff
 
Strange thing, installed upgrades one at the time, and save each time between, go to sea to check.....
Now I am take quest from Governor to find & sunk ship, done, everything is just fine.:yes
Seems only to crush game if it is all at once upgrade. :shock
 
Seems only to crush game if it is all at once upgrade. :shock
Not likely. There is a random element to the upgrades which may make the difference between "working" and "crashing".

My suspicion is that the problem comes from applying the "Staysails" upgrade.
This one can decrease the ship "Closest Point" between 0.0 and 0.1 degrees.
However, the cursed Flying Dutchman already has a a "Closest Point" of 0.1 because she is meant to sail fastest INTO the wind.
So 0.1-0.1=0.0 and then the game code errors out because that number isn't meant to be zero.

Attached file contains an extra check to ensure that this value cannot be decreased further than 0.1:
Code:
        if ( sti(rCharacter.ship.tune.tack) > 0 ) {
           fClosestPoint = fClosestPoint + stf(rCharacter.ship.tune.tackmod);
           //Log_SetStringToLog(TranslateString("","Closest point changed! New = "+fClosestPoint));

           if ( fClosestPoint < 0.01 ) { fClosestPoint = 0.01; } // PB: Don't decrease this too far! Mainly applies to Flying Dutchman
           if ( fClosestPoint > 1  ) { fClosestPoint = 1  ; }
         }
To be extracted to PROGRAM\SEA_AI .

To check if this is indeed the case, remove/install that specific upgrade a few times (ensuring to save every time) until you DO get a ship that properly crashes the game.
Then after you get that, install this fix, then try again. The game should work fine then. :doff
 

Attachments

  • AIShip.zip
    54.9 KB · Views: 97
So installing stay sails on the dutchman doesn't do anything except cost you money now?

btw @Pieter Boelen in your text your talking about 0.1 but in the code you have 0.01
 
So installing stay sails on the dutchman doesn't do anything except cost you money now?
Technically yes, I suppose. This is the code that applies the upgrade:
Code:
void applytuntack(ref _char, string _improvement, float rangemax, float rangemin) {
   float j;
   float pertoadd;
   j = rangemax - rangemin;
   pertoadd = j*frnd()+rangemin;
   if (rand(11) <= GetShipSkill(_char, SKILL_SNEAK)) { pertoadd=pertoadd+0.05; } // KK
   if (rand(11) <= GetShipSkill(_char, SKILL_SAILING)) { pertoadd=pertoadd+(0.05*j); } // KK
   if (pertoadd > rangemax) { pertoadd = rangemax;}
   _char.ship.tune.tack = sti(_char.ship.tune.tack)+1;
   _char.ship.tune.(_improvement).on = 1;
   _char.ship.tune.(_improvement).tuntack = pertoadd;

/*   if(IsMainCharacter(_char))
   {
     LogIt("Ships dead angle decreased by " + (stf(_char.ship.tune.tackmod) + pertoadd));
     LogIt("Max possible improvement = " + (stf(_char.ship.tune.tackmod) + rangemin));
   }*/

   _char.ship.tune.tackmod = stf(_char.ship.tune.tackmod) + pertoadd;
}
It is a bit of a pointless upgrade to have for a ship that can already sail pretty much straight into the wind.

If you truly wish it to do something, the normal Dutchman needs to be made worse.
Because there isn't anything better than "already pretty much perfect".

Or prevent installing that upgrade in the first place. But I'm not sure that is worth the effort.
If players get the Dutchman and try to install all upgrades, I strongly suspect they've got money to spare anyway and/or are using the cheatmode.

EDIT: I stand corrected. It DOES still serve a purpose, because it also improves the ship turning rate:
Code:
    case "stays":
       applytunturning(char,"stays",SSTURNINGRANGEMAX,SSTURNINGRANGEMIN);
       applytuntack(char,"stays",SSTACKRANGEMAX,SSTACKRANGEMIN);   
     break;
And apparently it also increases your repair costs.

Upgrades aren't "more = better". Most have advantages AND disadvantages. Just like they should!
Of course that may be a bit of an alien concept for some of the more arcade-i-ly inclined players.... :wp
Q: What ship is the BEST in the game?
A: There isn't one! :whipa

btw @Pieter Boelen in your text your talking about 0.1 but in the code you have 0.01
Sorry, typo there. This is from the Dutchman ships_init.c entry:
Code:
// Movement unaffected by wind - sails fastest INTO the wind
   refShip.ClosestPoint = 0.01;
   refShip.BestPoint = 0.01;
It is a maximum improvement of 0.1 for the upgrade, but 0.01 for the Dutchman and therefore also for that lower limit.
From InternalSettings.h:
Code:
//Staysails
#define SSTACKRANGEMAX     0.0   // float 0 - 1 Degrees of improve ClosestPoint - remmeber that ClosestPoint goes from 0 to 1
#define SSTACKRANGEMIN     -0.1   // float 0 - 1 Degrees of improve ClosestPoint - remmeber that ClosestPoint goes from 0 to 1
#define SSTURNINGRANGEMAX   5   // int 0-100
#define SSTURNINGRANGEMIN   0   // int 0-100
#define SSTIMEMULT     1   // Time to repair all rigging multiply by SSTIMEMULT
#define SSDISP       3   // int 0-100 Chance of being available   // Rare
#define SSCOSTMULT     10   //Cost of repair all rigging multiply by SSCOSTMULT

I think technically the "unit" isn't degrees, but more of a percentage. So -0.1 = up to 10% better.
Good thing too as a maximum of 0.1 degree isn't exactly a lot! :rofl
 
Last edited:
At the start have the same error as Ansel later, but I am just waiting to see if it is anyone else experienced same problems, now is ok. With Galleon, tried with installing one at the time upgrade, everything looks ok. With your latest upgrade works just fine (in pirate shipyard, and 2 others).
Only thing that I can notice is that there is no "submerge ship", only Kraken, (which is working nice in build 13, it was possible to navigate under water without crashing masts). Also cannot change sails on Cursed Galeon (to other colors), sails always stays gray with holes, but Ship is fantastic with upgrades, and Triton gives more options in battles.
Repaint ships goes with no problems.
Boarding is ok, there is no more crushing during boarding and looting corpses and chests.
But, reading yours other posts, sometimes cannot save game, (lot of times gives me a "Bad save", so after saving game I must check if it is good saved).
And, notice one problem with member of crew which I took to land party, change him costume (BlackBeard), and on second landing it was impossible to talk with him, so he is always with me ashore. His dialog box opens but is empty......Try to kill him, but with every my hit he rises in health. That gets me boaring, so I go to Dungeon, and there he got killed, problem solved.
Only thing that I can say is that something is wrong with lvl of items in shops, and at the street merchants are not good. I have lvl for 1 class ships, and in some shops lvl of items are 2 (Nevis, pirates), in French colony Tortuga, one street merchant have items lvl 10, another one lvl 6 ! Lot of shops have lvl items, but zero amount.
Officer leveling is much better now!
Sorry because I put all this stuff at one place.
 
Only thing that I can notice is that there is no "submerge ship", only Kraken, (which is working nice in build 13, it was possible to navigate under water without crashing masts).
That feature is still in the game and should work as well as it always did. :confused:

But, reading yours other posts, sometimes cannot save game, (lot of times gives me a "Bad save", so after saving game I must check if it is good saved).
We know about that one. It's annoying for sure. :facepalm

And, notice one problem with member of crew which I took to land party, change him costume (BlackBeard), and on second landing it was impossible to talk with him, so he is always with me ashore. His dialog box opens but is empty......Try to kill him, but with every my hit he rises in health. That gets me boaring, so I go to Dungeon, and there he got killed, problem solved.
Shore Crew or was that an Officer? Was it a quest one? Do you have a save with him still with you? Any .log files to go with it?

Only thing that I can say is that something is wrong with lvl of items in shops, and at the street merchants are not good. I have lvl for 1 class ships, and in some shops lvl of items are 2 (Nevis, pirates), in French colony Tortuga, one street merchant have items lvl 10, another one lvl 6 ! Lot of shops have lvl items, but zero amount.
It's on the To-Do list for Beta 5: Confirmed Bug - Item traders having to much or to few goods and money | PiratesAhoy!
 
First you select how many crew members you want ashore. Then when you are ashore, you can talk with them. They dont have names, just "crew member". In dialog box it is possible to select if they need new weapons, to view their skills, and if they are so good you can send them for papers at quartermaster, to be your officer. Then when they become officers (master of arms), you can change weapon with them .
So I take several crew member ashore, dressed them all the same, as BlackBeard. Never done that before, so I want to try this time....I notice that they have very nice sword in inventory (Dragons head), so I took the opportunity to change the weapons with them and take that valuable swords.
Changed all swords except one, it was impossible to talk with that last one crew member "BlackBeard", dialog box was empty....so I solved that otherwise.
That was sailor, not an quest officer, no dont have save game with him.

My mistake for Cursed Galleon, ship have Kraken & submerge ship, but when you Swap ships, than on other ship have only Kraken.
 
You should have neither Kraken nor Submerge after swapping to a non Dutchman ship.

For that shore crewmember, make a new thread with a save included.
 
Cursed Galleon is my secon ship. Still I have Kraken. Fine with me :yes

Screenshot
save game
 

Attachments

  • -=Player=- Open Sea February 10th, 1791 1.zip
    933 KB · Views: 93
Oh wait, come to think of it that is NOT a bug but very much intentional.
I changed it quite a while back to see if the Dutchman is in your fleet.
 
Back
Top