• 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 Cargo Quests for Fleets

Hotshot

Freebooter
Storm Modder
If you have more then 1 ship and you accept a cargo quest, then the amount of cargo that you need to transport seems to be calculated as a sum of all available cargo space across your vessels!
  • Ship 1: 5.000 free
  • Ship 2: 3.000 free
  • -> you would need to transport ~7000 worth of cargo which is impossible because you don't have enough space on your own vessel (which gets filled up with the cargo you need to deliver, but not enough of it!)
 
Last edited by a moderator:
This savegame is [...] good to test out the cargo-quest issue; it's right at the store with an available quest, while having two ships.
 

Attachments

  • -=Player=- QuickSave 10.7z
    521.7 KB · Views: 115
Last edited by a moderator:
ok, sry for all the posts you head to move; I'm never sure on where to post :oops:
I always figure: Anything that seems like a bug can go on the Bug Tracker.
Separate threads for separate bugs are best. If they turn out to be related, it is easy enough to move/merge them.

For general questions, you could keep it in one thread as well. :doff
 
@Hotshot: If the entire cargo does not fit into the player ship, the remainder is automatically distributed over the other ships in your fleet.

The code doing that did look a bit weird though, so I rewrote it as:
Code:
bool AddCharacterGoods(ref _refCharacter,int _Goods,int _Quantity)
{
   ref ch;
   int i,cn,freeQuantity;
   string goodsName = Goods[_Goods].name;

   for (i = 0; i < COMPANION_MAX; i++)
   {
     cn = GetCompanionIndex(_refCharacter,i);
     if (cn < 0) continue;
     ch = GetCharacter(cn);
   //   if (IsTrader(ch)) continue; // KK - PB: Quest traders need cargo too
     freeQuantity = GetGoodQuantityByWeight( _Goods, GetCargoFreeSpace(ch) );
     if(freeQuantity>=_Quantity)
     {
       ch.Ship.Cargo.Goods.(goodsName) = sti(ch.Ship.Cargo.Goods.(goodsName)) + _Quantity;
       RecalculateCargoLoad(ch);
       return true;
     }
     ch.Ship.Cargo.Goods.(goodsName) = sti(ch.Ship.Cargo.Goods.(goodsName)) + freeQuantity;
     _Quantity = _Quantity - freeQuantity;
     RecalculateCargoLoad(ch);
   }
   Trace("Overup cargo space on "+_Quantity);
   return false;
}
Seems at least cleaner than it was and the function 'type' seemed wrong as well, so I corrected that too.

I did a test from your savegame and managed to complete the quest with the cargo split over both ships.
So this seems OK now.
 
Thx!

I'll gonna try this out as soon as I have 2 ships again! And I don't know - because I didn't look - if the "rest" was actually in the second ships cargo hold, but what I do know is, that the receiving shop keeper didn't recognize it.

cheers,
Hotshot
 
I don't remember now if it fully worked already when I tested; if I recall, the quantities didn't match up.
What I do know is that it seems to work after the rewrite I did. :cheeky
 
Back
Top