• 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 ship replacement- cargo price given as deduction but cargo retained

Tingyun

Corsair
Storm Modder
When you sell a ship, the cargo price is included in sale price, which is of course correct.

Things go wrong though if you are replacing the ship (ie, buying a new ship at the same time). You get paid for the cargo, but you still keep the cargo.

Bug is easy enough to see in action, if you have a ship with lots of cargo, simply replace it back and forth with repeated purchases of another ship, and your gold with grow more and more with each purchase (from the cargo you get money for each sale but keep).

Searching the archives shows that this bug was reported before, and deemed fixed, but it seems to be a miscommunication, where what was fixed was actually a related but different bug: Medium Priority - Shipyard Sale Price: Cargo Included, but Kept Anyway | PiratesAhoy!
 
When you sell a ship, the cargo price is included in sale price, which is of course correct.



Stupid Question - Why are you selling a cargo ( sandal, leather, cinnamon etc.) to the shipyard :confused: - and are the prices you are getting the same as in the store ?

The player should be selling those things to the store - a shipyard is not interested in buying such things.

Perhaps interested in wood, sails, Ammo, gunpowder ( i.e. ship supplies) :yes

Or is it just to enable players to be lazy and not have to go to the store and sell things.

:read
 
Yes, it checks store price from what the code looks like.

I think it is indeed the convenince factor, combined with not wanting to punish a player who forgets to first sell the cargo. Can perhaps understand it as ordering the quatermaster to run to the local store to sell all goods prior to the ship sale.
 
I think it is indeed the convenince factor, combined with not wanting to punish a player who forgets to first sell the cargo. Can perhaps understand it as ordering the quatermaster to run to the local store to sell all goods prior to the ship sale.
^ Exactly that.

It also makes sense for any Prize Ships, since ideally those should be sold with their cargo still on board.
 
It also makes sense for any Prize Ships, since ideally those should be sold with their cargo still on board.

I think the cargo sale addition code is after the prize ship reduction (perhaps it was moved), so the player will still get 100% of the cargo profit even if they voluntarilly enforce that rule, rather than the proper prize ship percentage. Makes sense given the player can just bypass it anyway, but also a little sad there is no roleplaying option to follow the historical prize law rules.

One thing I don't like is that damage to sails/hull is deducted after the prize multiplier. So basically the entire repair cost for any damage comes out of the player's cut, rather than being shared by everyone, as would seem more fair.
 
I think the cargo sale addition code is after the prize ship reduction (perhaps it was moved), so the player will still get 100% of the cargo profit even if they voluntarilly enforce that rule, rather than the proper prize ship percentage. Makes sense given the player can just bypass it anyway, but also a little sad there is no roleplaying option to follow the historical prize law rules.
I tried to make it more fancy for that, which was met with MAJOR resistance. In the end, I went with "I don't bloody care anymore" and reverted it back to how it used to be.

Shame really, because I liked the idea that the cargo IS part of the prize.
Problem with that was that you cannot trace where cargo originated, so basically I had to lock cargo on prize ships altogether.
 
This is what happens during DoSellShip
Code:
if ( cargoHandler == "includecargo" ) { // TIH added handler Jul27'06
        // Viper - Add Cargo Value to Ship Price -->
        int p, tQuantity;    ref refStore;
        ref refCharacter = GetCharacter(cn);
        int curStoreIdx = GetCharacterCurrentStore(GetMainCharacter());
        makeref (refStore, Stores[curStoreIdx]);
        //p = 0; // NK
        for(int i=0;i<GOODS_QUANTITY;i++)
        {
            if( !GetStoreGoodsUsed(refStore,i) ) { continue; }
            tQuantity = GetCargoGoods(refCharacter,i);
            if( tQuantity==0 ) { continue; }
            RemoveCharacterGoods(refCharacter,i,tQuantity);
            // NK -->
            //p += GetGoodPriceByType(&refStore, GetMainCharacter(), i, tQuantity, PRICE_TYPE_SELL);
            SetStoreGoods(refStore,i,GetStoreGoodsQuantity(refStore,i)+tQuantity);
        }
    }
So it should remove the goods from you and add them to the store....
So could you check if this is actually executed?
 
@Levis it does seem to work fine and is executed for selling a ship normally, but if you buy a replacement ship and sell your own in one action, you get the cargo value as a discount plus you keep the goods as they appear automatically in the new ship's cargo hold. You can axtually keep replacing ships, and watch your money go up and up with each replacement sale.
 
it should keep the cargo as you see here:
Code:
// TIH --> fixed price bug Jul27'06
    int bPrice = GetBuyPrice(nCurSScrollNum);
    int sPrice = GetSellPrice(nCurFourNum,"skipcargo");
    int buyPrice = bPrice - sPrice;
    if ( IsMoneyForBuyEnable(bPrice, sPrice) > 0 ) return;
    // TIH <--

    ref chref = GetCharacter(cn);
    DoSellShip("keepcrew","keepcargo");// TIH keep any stuff around as we only swap ships (or add ship to companion) Jul27'06

    AddMoneyToCharacter(GetMainCharacter(),-bPrice); // PW was buyPrice ie the exchanged cost but you got the sell money as well

So this should sell the ship without using the money from the goods...
 
Maybe something is wrong with the skip cargo functionality.

Either way, when replacing your ship with a new one, you certainly do get the cargo discount and keep the cargo.

By repeatedly swapping ships at the shipyard by clicking buy buy buy between two cheap ships over and over again, you can watch your money grow with each click. It is an infinite money cheat actually, so the bug is very clear as long as you have a ship wih full cargo.
 
Yes, it checks store price from what the code looks like.

So it should remove the goods from you and add them to the store....

As this is my first post on this board, i have to apologize for starting in the bug section... You provide a really great mod here which brought me back to playing this fantastic game after years, so it´s not polite to start with a post adressing something that might not be working perfect so far.

But anyway, i observed the same behaviour when selling the old ship combined with buying a new ship exacly as Tingyun described it.

Regarding the two quotes above i would like to add that this is not only working with goods sellable at the store, but that you can also "sell" smuggling goods via the shipyard. I think this misfits the idea mentioned above that selling the goods with the ship is more or less to be seen as a command given to the quartermaster to sell all remaining goods left in the cargo. And as the normal goods, also the smuggling goods remain in the cargo when switching ships.
 
As this is my first post on this board, i have to apologize for starting in the bug section... You provide a really great mod here which brought me back to playing this fantastic game after years, so it´s not polite to start with a post adressing something that might not be working perfect so far.
No worries; bug confirmations are appreciated too. :doff

i observed the same behaviour when selling the old ship combined with buying a new ship exacly as Tingyun described it.
And confirmed it is! :cheers

you can also "sell" smuggling goods via the shipyar
Really? Normally there should be a note stating "Smuggling goods on board" or something like that and then you are unable to sell the ship. o_O
 
Really? Normally there should be a note stating "Smuggling goods on board" or something like that and then you are unable to sell the ship. o_O
I checked again a few minutes ago and unfortunately have to confirm this. It is possible to sell a ship full of smuggling goods, and not only by switching (buying) directly to a new ship but also when selling the ship without directly buying a new one. There was no note popping up at all.

If it might be good to know, i am playing with the 7th october zip. I cannot confirm it anymore but if i remember the right way this (meaning switching ships without loosing cargo and also selling ships with smuggling goods in cargo) was already possible with the 28th July version i was playing before. But as i am not a 100% sure maybe someone still using that version should have a short test?!
 
@Levis, you have any clues on this one?
I thought that "unable to sell while Smuggling goods are on board" thing was working not too long ago. :shock
 
@Pieter Boelen would you be able to confirm it also not working in the 28th of july version?
This weekend I've planed to look at stuff like this
 
I still have the July version as a backup and tried this. You are indeed not able to sell your ship while having smuggling goods on board. However, this wasn't the case anymore as soon as the perk 'Trustworthy' was learned.
The same happened in Levis's latest October ZIP btw, for both cases, so as far as I can see nothing is broken here.
 
@Pieter Boelen would you be able to confirm it also not working in the 28th of july version?
This weekend I've planed to look at stuff like this
I cannot give any guarantees; this evening I need to sort out some paperwork and tomorrow I've got a fair few activities.
Looks like @Cassadar was already kind enough to check it though.

I still have the July version as a backup and tried this. You are indeed not able to sell your ship while having smuggling goods on board. However, this wasn't the case anymore as soon as the perk 'Trustworthy' was learned.
The same happened in Levis's latest October ZIP btw, for both cases, so as far as I can see nothing is broken here.
That does sound like it works like it should then. :onya

I checked again a few minutes ago and unfortunately have to confirm this. It is possible to sell a ship full of smuggling goods, and not only by switching (buying) directly to a new ship but also when selling the ship without directly buying a new one. There was no note popping up at all.
Could you check if you have the Trustworthy ability?
 
As suggested above

Maybe something is wrong with the skip cargo functionality.

an initial look at this with some trace logging does indeed show that "skipcargo" calls are currently including the cargo value which has several effects.

1) The one noted above when swapping ships you both keep the cargo but also get its value.
2) The initial values shown for your ships include cargo which IMO can mask their real trade in value when window shopping in the shipyard.
3) The price you get on a straight sale doesn't clarify how much is for ship and how much is for cargo which doesn't help judge if its a good deal.
4) The ship swap price is incorrectly displayed.

I'm working at the various uses of skipped or included cargo to massage them back to what they seem intended to be. I didn't check the functionality of this element out (just looked at the code) when previously finding you getting the traded in ship value twice in the earlier thread as reported in #1 above - my (big) mistake.

I will also take a look at this one at the same time if I can

http://www.piratesahoy.net/threads/ship-upgrades-interface-shows-ticks-for-wrong-ship
 
Back
Top