• 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!

Solved Peter Blood initial ship random stats

Desmond

Landlubber
Hello,

The large vessel Peter Blood gets during the escape has random stats...is it possible change it stats through modding ? (so that i wouldn't have to save and load a million times to get the best result)

Thanks!
 
It's a good question, I'm sure the random stats are defined somewhere. Try checking the RPGutiliity file.
 
I don't think so. ALL ships are generated with random stats. The only thing I think you could do is find the Arabella in the ships init file and max everything out on it. Edit speed, maneuverability, hull HP, cargo space, max cannon size, etc to be higher than they are now. .......the only thing about applying such a cheat is that now it will always be possible to get another Arabella with even better stats than your edits, because of random stat generation.

I am sure Officerpuppy is right. There is probably a place where that can be turned off, but then every ship in the game would always have the same stats as they appear in Ships_init c

I don't know how you would turn it off for just one ship.

MK
 
Ah, you're right, I forgot that all ships are randomised, not just Blood's ship.

Disregard my suggestion then and try out MK's, although it's a double edged sword because even if you do boost the stats, you'll still be searching for the "best" configuration.
 
I figured it out (it was quite simple really). In "Bishop.c" (Peter Blood quest logic), find lines:

Code:
Pchar.Ship.Type = GenerateShip(SHIP_ARABELLA, true);
Pchar.Ship.name=DLG_TEXT_BL1[286];

The GenerateShip function is what randomizes the ARABELLA class stats, so all I needed to do was to create my own version of that function. So I added the following function (after GenerateShip function) in ShipsUtilities.c:

Code:
int GenerateBloodShip(int iBaseType, bool isLock)
{
    int iShip = CreateBaseShip(iBaseType);
   
    ref rRealShip = GetRealShip(iShip);
    ref rBaseShip = GetShipByType(sti(rRealShip.BaseType));
 
    rRealShip.MaxCaliber = 36;
   
    rRealShip.SpeedRate          = 16;
    rRealShip.TurnRate        = 46;
    rRealShip.HP              = 9400;
    rRealShip.WindAgainstSpeed = 5;
   
    rRealShip.Capacity        = 6200;
    rRealShip.OptCrew        = makeint(sti(rRealShip.OptCrew) + rand(makeint(sti(rRealShip.OptCrew)/3)) - makeint(sti(rRealShip.OptCrew)/6));
    rRealShip.MaxCrew        = 340;  // 25% ļåšåćšóēą
    rRealShip.MinCrew        = 22;
 
    rRealShip.Weight          = sti(rRealShip.Weight) + rand(sti(rRealShip.Weight)/20) - rand(sti(rRealShip.Weight)/20);
   
    // to_do del -->
    rRealShip.BoardingCrew    = 0;
    rRealShip.GunnerCrew      = 0;
    rRealShip.CannonerCrew    = 0;
    rRealShip.SailorCrew      = sti(rRealShip.OptCrew);
    // to_do del <--
   
    int iDiffWeight            = sti(rRealShip.Weight) - sti(rBaseShip.Weight);
    int iDiffCapacity        = sti(rRealShip.Capacity) - sti(rBaseShip.Capacity);
    int iDiffMaxCrew        = sti(rRealShip.MaxCrew) - sti(rBaseShip.MaxCrew);
    int iDiffMinCrew        = sti(rRealShip.MinCrew) - sti(rBaseShip.MinCrew);
    float fDiffSpeedRate    = stf(rRealShip.SpeedRate) - stf(rBaseShip.SpeedRate);
    int iDiffTurnRate        = sti(rRealShip.TurnRate) - sti(rBaseShip.TurnRate);
    int iDiffHP                = sti(rRealShip.HP) - sti(rBaseShip.HP);
 
    rRealShip.Price    = (iDiffWeight + iDiffCapacity + iDiffMaxCrew*2 + iDiffMinCrew + fDiffSpeedRate*2 + iDiffTurnRate*2 + iDiffHP)*5 + sti(rRealShip.Price);
   
    rRealShip.Stolen = isLock; 
 
    return iShip;
}

And then changed the quest to use that function instead of the original GenerateShip function in Bishop.c:

Code:
Pchar.Ship.Type = GenerateBloodShip(SHIP_ARABELLA, true);
Pchar.Ship.name=DLG_TEXT_BL1[286];

A few lines down, I also added a bit more initial crew like this: SetCrewQuantity(Pchar, GetMinCrewQuantity(Pchar) * 2);



And that did the trick (ofcourse a new game is needed for that to work)!
 
I've already done Peter Blood quest, for only later realising the frigate stats are random and unique ship.
I tried doing the shipyard stealing Frigate blueprints several times to unlock it, but they seem to be useless infinite quests.
Is there a way to put the ship in the shipyard for sale, can be only once, but with max stats?
How do I do it?
 
Last edited:
I’ve already figured out, how to put it on the shipyard with max stats, so you don't have to start a new game:

At the ShipUtilities at Scrips folder add ship arabela to the code at the bottom, for example:

{
iTest_ship = rand(1);
if (iTest_ship == 1) FillShipParamShipyard(NPChar, GenerateStoreShip(SHIP_ARABELLA), "ship18");
}

the more you add, greater the chances to appear at the shipyard.

Now, to get max random stats, at the top, instead of:

rRealShip.SpeedRate = stf(rRealShip.SpeedRate) + frandSmall(stf(rRealShip.SpeedRate) / 5.0) - stf(rRealShip.SpeedRate) / 10.0;

change to:

rRealShip.SpeedRate = stf(rRealShip.SpeedRate) + (stf(rRealShip.SpeedRate) / 5.0) - stf(rRealShip.SpeedRate) / 10.0;

this would change to max speed stats for all ships instead of random. It's possible to do the same for other stats as well.
 
Arabela Max Stats.png

These are the max Frigate Arabela random stats, in case anyone is wondering.
 
Back
Top