• 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 Ships with no HP or speed in Shipyard

Maybe that isn't it then? More investigation required....

Be sure to post a savegame that is affected so that we'll have something to test from when somebody (read: I :facepalm ) manage to find the time.
 
In PROGRAM\Ships\ships_init.c I added a new "default" section with all 0.0 values:
Code:
void InitShips()
{
   int idx, i, n, si, m, MinCapacity;
   float CrewPerGun;
   string sDet, cp, bp;
   ref refShip, rship2, rTypeList, rCannon;
   aref arship, cannonl, cannonr, cannonb, cannonf;
   bool bNoPennants = GetCurrentPeriod() < GetPeriodFromYear(makeint(PENNANTS_MIN_YEAR)); // KK

   // PRS3 -->
   //Default
   shipstatsmult.n.MaxCaliber   =   1.00;
   shipstatsmult.n.Weight     =   1.00;
   shipstatsmult.n.Capacity   =   1.00;
   shipstatsmult.n.MaxCrew     =   1.00;
   shipstatsmult.n.MinCrew     =   1.00;
   shipstatsmult.n.SpeedRate   =   1.00;
   shipstatsmult.n.TurnRate   =   1.00;
   shipstatsmult.n.Price     =   1.00;
   shipstatsmult.n.HP       =   1.00;

   //English

And in PROGRAM\Ships\ships.c in the arSetRandomStatsToShip, find:
Code:
  aref arShip; makearef(arShip, chrship.stats); //this is where we'll put stuff
   if(!CheckAttribute(shipstatsmult,"n"+nat)) return; // 04-09-10 if no mult for nation, return. Whoops!
   aref natstats; atrstr = "n" + nat;makearef(natstats, shipstatsmult.(atrstr)); //these are our multipliers
With this:
Code:
  aref arShip; makearef(arShip, chrship.stats); //this is where we'll put stuff
   aref natstats; atrstr = "n" + nat;
   if(!CheckAttribute(shipstatsmult,"n"+nat)) atrstr = "n"; // PB: Use default values if none defined
   makearef(natstats, shipstatsmult.(atrstr)); //these are our multipliers

Before, because "personal nation" wasn't defined, the arSetRandomStatsToShip was aborted.
I don't see why that should cause this problem, but apparently it did.
With this change, it no longer aborts but continues with the default "1.0" multipliers instead.
That seems to be a safer way of handling it and I haven't seen any zero stats on Personal Design ships since.

Of course this only works after pressing F11, waiting a day and then visiting the shipyard again so that the ship selection has been refreshed.
 
"Fixed" it is then! :dance

I still don't know why this was necessary, but since it works, that's good enough for me now. :wp
 
I found another small bug:
I just sold my captured french ships in my private shipyard of my personal town as I saw TWO great ships for sale.
"Yeah!" :bounce I thought; "I´m the king of the seas now!" I thought... :ship

...But sadly; on second view theses two great ships (a Trinity class 2 ship and a ship of the line class 1 ship)
They both had ZERO (0) Maximum speed and the ship of the line had ZERO (0) Maximum HP. :facepalm

I can only suggest, that it could be connected to the "personel" national design.
I´ve seen other nations sailing these ships correctly with their national design.
I´ve tried to find this broken string by myself; but failed :mad:
If one of you want´s to try, here´s the savegame:
 

Attachments

  • -=Sir Duke=- Hispaniola.rar
    915.1 KB · Views: 96
It is indeed connected to Personal Design and I fixed it a while ago in the Beta 4.1 WIP. See link in my signature.
You'll have to press F11 for the fix to take effect.
 
Oh... o_O
Haven´t noticed this thread, sorry.
Looks like I broke this apart by myself. :rofl
While I was trying to find the cause for some other problems I replaced my Ships_init.c with the one from the data-package NOT with the one from the installer. :modding
You my delete my upper post.
 
Back
Top