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

Cargo Capacity Problem on Small Ships

Pieter Boelen

Navigation Officer
Administrator
Storm Modder
Hearts of Oak Donator
I have been experiencing a pretty bad bug recently. I don't know in which game version it was introduced, but it is in my current game version. The bug occurs when a ship has more cargo than it can hold, so this most applies to smaller ships. The problem originally manifested itself with the two Cutters and could be circumvented by increasing their cargo capacity. It turned out that this problem got caused by my GiveShip2Character function. If you have a big ship and give yourself a different one, the cargo of the previous ship is kept. So if you go from a big ship to a small ship, you still have the cargo of the big ship, which the small ship cannot hold. The result is a crash to desktop on the changing of the day on the worldmap.

To fix this, I added some auto supply code (=simplified auto buy code from the store) into the GiveShip2Character function:<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->void GiveShip2Character(ref char, string shiptype, string shipname, int nat, bool hirecrew, bool getsupplies)
{
    int i;
    char.ship.type = shiptype;
    char.ship.name = shipname;
    aref arship; makearef(arship, char.ship); DeleteAttribute(arship,"stats");
    SetRandomStatsToShip(arship, GetCharacterShipType(char), nat);
    ResetCannons(char);
    DeleteAttribute(&char,"ship.masts");
    ProcessSailRepair(&char,100.0);
    ProcessHullRepair(&char, 100.0);
    if(hirecrew || sti(GetCrewQuantity(&char)) > sti(GetMaxCrewQuantity(&char))) SetCrewQuantity(&char, GetMaxCrewQuantity(&char));
    if(getsupplies || sti(GetCargoLoad(&char)) > sti(GetCargoMaxSpace(&char)))
    {
        for(i=0;i<GOODS_QUANTITY;i++)
        {
            int getQty = 0;
            if(i == GOOD_WHEAT && FOOD_ON)
            {
                getQty = 1+makeint(makefloat(GetCrewQuantity(&char)) * FOOD_PER_CREW * WHEAT_DAYS);
            }
            if(i == GOOD_RUM && FOOD_ON)
            {
                getQty = 1+makeint(makefloat(GetCrewQuantity(&char)) * FOOD_PER_CREW * RUM_DAYS);
            }
            if(i == GOOD_GUNPOWDER && CANNONPOWDER_MOD && GetMaxCannonQuantity(&char) > 0)
            {
                ref rCannon; makeref(rCannon,Cannon[GetCaracterShipCannonsType(&char)]);
                int needPwdr = 0;
                float averageQty = 0.0;
                if (USE_REAL_CANNONS)     { averageQty = makefloat(GetCargoGoods(&char,GOOD_BALLS) + GetCargoGoods(&char,GOOD_GRAPES) + GetCargoGoods(&char,GOOD_KNIPPELS))/3; }
                else                     { averageQty = makefloat(GetCargoGoods(&char,GOOD_BALLS) + GetCargoGoods(&char,GOOD_GRAPES) + GetCargoGoods(&char,GOOD_KNIPPELS) + GetCargoGoods(&char,GOOD_BOMBS))/4; }
                float canCharge = makefloat(averageQty/makefloat(GetMaxCannonQuantity(&char)));
                if(CheckAttribute(rCannon,"gunpowder")) needPwdr = sti(rCannon.gunpowder);
                getQty = makeint((makefloat(GetMaxCannonQuantity(&char)) * needPwdr * canCharge) + (makefloat(GetCrewQuantity(&char)) * 3));
            }
            if(i == GOOD_BALLS)
            {
                getQty = makeint(makefloat(GetMaxCannonQuantity(&char)) * BALLS_PER);
            }
            if(i == GOOD_GRAPES)
            {
                getQty = makeint(makefloat(GetMaxCannonQuantity(&char)) * GRAPE_PER);
            }
            if(i == GOOD_KNIPPELS)
            {
                getQty = makeint(makefloat(GetMaxCannonQuantity(&char)) * CHAIN_PER);
            }
            if(i == GOOD_BOMBS && USE_REAL_CANNONS)
            {
            getQty = makeint(makefloat(GetMaxCannonQuantity(&char)) * BOMBS_PER);
            }
            if(i == GOOD_SAILCLOTH)
            {
                getQty = makeint(makefloat(GetCharacterShipHP(&char)) * SAIL_PER);
            }
            if(i == GOOD_PLANKS)
            {
                getQty = makeint(makefloat(GetCharacterShipHP(&char)) * PLANKS_PER);
            }
            string goodsName = Goods.name;
            char.Ship.Cargo.Goods.(goodsName) = getQty;
        }
    }
}<!--c2--></div><!--ec2-->
This seems to have partly fixed it, but now I find out that the problem is even more complicated. I can even cause this same problem without using the GiveShip2Character function at all. If I get myself a Gunboat and perform an auto buy at the store, I get the exact same problem. If I dump all cargo, I don't have that problem. Apparently some of the small ships simply cannot hold as much cargo as they need for ammunition, gunpowder, food and rum. Can anybody replicate this bug in his/her game version? Just buy a Gunboat, perform an Auto Buy at the Store, then go to the worldmap and wait until the changing of the day. Please report here which game version you have and whether you experience this problem or not.
 
Did anybody try this yet? I really want to have some reports on this one; it's beginning to piss me off big time. <img src="style_emoticons/<#EMO_DIR#>/boom.gif" style="vertical-align:middle" emoid=":boom" border="0" alt="boom.gif" />
 
Well I tried in Build 13 and in Build 14 alpha 7 plus, with the gunboat, and I didn't find that problem, no crash at all. With the autotrade system I never bought too much of goods (just the maximum) even if I had a bigger ship before. Or maybe I didn't get what you've written here and missed up something?...
By the way, I don't recall I ever run into this perticular weird crash before.


EDIT : for build 13, it supposed to be
'Build Version: Wednesday 7 February 2007
Build 13 Full - Update 3', for what is written in Build info.txt, on top of
'Build Version: Sunday 19 November 2006
Build 13 Full - Final Release 1'
 
i'm not going to say what i think it is, cos you know what it think it is. <img src="style_emoticons/<#EMO_DIR#>/whistling.gif" style="vertical-align:middle" emoid=":wp" border="0" alt="whistling.gif" />
 
It is NOT an installation fluke. I also had a report from Short Jack Gold stating that he had the same. It is really quite a weird bug though that to you can Auto Buy more than your ship can actually hold. I thought it was related solely to my GiveShip2Character function, but the issue runs deeper than that.
 
okay, okay. <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> well, i've never encountered it, because i never use the auto buy option, and i nearly always have quite a lot of space left.
 
I'll check for the bug straight away!
but which buildversion should I check? you see, I have ALL existing builds installed: I just renamed the folder to "Bethesda Softworks (<i>buildnumber</i>)"
I just have to rename the folder to play another build <img src="style_emoticons/<#EMO_DIR#>/william.gif" style="vertical-align:middle" emoid=":will" border="0" alt="william.gif" />
 
That's awesome! If possible, can you check them ALL? Starting with the most recent one and working back? I want to know which versions do and don't have the problem.
BTW: If you have all game versions installed at once, you can just run the ENGINE.exe in the game version you want to run and there should be no need to rename any folders.
 
Check them all? Well, that's the least I can do in return. I just checked 14 alpha 6 + PBmodifications: when I buy a gunboat, the following message pops up: "Too little room! Your purser makes an emergency sale of (<i>amount</i>) of (<i>goods</i>) from the Victory for a total of (<i>money</i>)."
I guess 14 alpha 6 + PB mods can't 'overload' the cargo hold. I hope this is the bug you mean?
I'll try out the other builds now: buy a Gunboat, go to the store, choose 'Autotrade' and wait one day at sea.
I really hope I can contribute to PA <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

edit: some stupid typos
 
That message does not mean there is no problem. It just means that you had too little food aboard the ship to support your crew during the time it took to swap the ships and your "purser" bought some food to prevent your crew from dying. Please do go to the store and do the Auto Buy and wait one day on the worldmap.
 
yes, that's what usually happens in my case. <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" /> at least, i've sometimes gotten that message without an obvious cause.
 
I'll summarise what I've done by now

- Build 14 alpha 6 + PB mods : Got myself a gunboat, autotraded at the store, but nothing at all happened after one day at the worldmap
- Build 13 update 3 : Did the same thing as above, and once again nothing happened at the world map (except for the French Invasion movie) <img src="style_emoticons/<#EMO_DIR#>/urgh.gif" style="vertical-align:middle" emoid=":urgh" border="0" alt="urgh.gif" />
- Build 12 : Exactly the same as what I described above, just noticed that build 12 still sais 'autobuy', the newer builds said 'autotrade' <img src="style_emoticons/<#EMO_DIR#>/razz.gif" style="vertical-align:middle" emoid=":razz" border="0" alt="razz.gif" />

I'm gonna check build 14 alpha 6 without PB mods now, and then download alpha 7 too

PS: thanks for the tip Pieter, my folder-renaming days are finally over <img src="style_emoticons/<#EMO_DIR#>/danse1.gif" style="vertical-align:middle" emoid=":dance" border="0" alt="danse1.gif" />
 
Thanks a lot. That suggests that it is actually a recent bug introduced in Alpha 7, Alpha 7 Plus or the Alpha 8 WIP 1 version. That does narrow it down quite a bit. Thanks a lot! <img src="style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" />
 
I tried to play at Build 14 alpha 6 w/o PBmodifications, but it didn't load at all, must be an installing mistake <img src="style_emoticons/<#EMO_DIR#>/wacko.gif" style="vertical-align:middle" emoid=":wacko:" border="0" alt="wacko.gif" />
And I'm downloading build 14 alpha 7 at the moment, but I thought that was slightly unstable <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
Oh yea, I'm not gonna download alpha 8, seeing as that's officially unstable ( <img src="style_emoticons/<#EMO_DIR#>/razz.gif" style="vertical-align:middle" emoid=":razz" border="0" alt="razz.gif" /> ) and I have no knowledge at all about modding and codes and all of that <img src="style_emoticons/<#EMO_DIR#>/doff.gif" style="vertical-align:middle" emoid=":doff" border="0" alt="doff.gif" />
I'm really happy I could help you out a little <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
Offtopic edit: woot I'm sailor apprentice now <img src="style_emoticons/<#EMO_DIR#>/danse1.gif" style="vertical-align:middle" emoid=":dance" border="0" alt="danse1.gif" />
 
It is actually said that the Alpha 8 WIP 1 version is actually better than Alpha 7 Plus and Alpha 7, which seems odd to me. Instalation order is pretty complicated though. For playing the game, I do not recommend it. I'm still hoping for a real playable Alpha 8 release at some point.
 
i'd think that if b14 a6 doesn't work, anything you'd install on top of that wouldn't work either. well, it's always worth a try.
 
Alpha 7 doesn't work when you install it without the fix. And WITH the fix, you still get that options screen problem. Now if you install Alpha 7 Plus on top, that <i>does</i> work. Though Alpha 6 should work straight away, so if that doesn't work, probably something went wrong before, so reinstalling would indeed be required.
 
Yes, it's indeed best to re-install 14 alpha 6.
So now the builds come with an intelligence test? You gotta find the right following order of installing them <img src="style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />
Just kidding, your work is really fantastic <img src="style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />
 
The FINDING of the installation order shouldn't really be the problem. The actually PERFORMING of that order is the difficult part. But in theory, when you do what it says, it SHOULD work. <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />
 
yes, it works. problem is, in what manner it works. <img src="style_emoticons/<#EMO_DIR#>/tongue.gif" style="vertical-align:middle" emoid=":blah:" border="0" alt="tongue.gif" /> just poking around here. <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> anyway, i think it's a good idea not to do anything that would seem like a better idea to you (i speak from experience). stick to the instructions no matter what.
 
Back
Top