• 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 Food and rum from Escort Ship transfered to your ship without reason

HellSailor

Privateer
Storm Modder
This problem is not really a big issue, but it's certainly annoying. Detected since some patches ago. Here is the thing.

I start a escort quest and I check my cargo hold to see if all it's working properly. Here you have the screenshots of the cargo hold of my ship and the companion's ship:

My cargo 1.jpg Cargo companion 1.jpg

Then I start sailing towards the point of destiny of the ship, and then, when we pass one day, suddenly my cargo of food and rum get increased without having bought any food or rum previously. I check again my cargo and the cargo of the companion ship and... here is what I found:

My cargo 2.jpg Cargo companion 2.jpg

The thing is, without any reason, the food and rum of the companion's ship is transfered to my ship. I would usually like this glitch, but it's a bit annoying happening in every escort quest I do.

If you want to test this yourself, here is a save with a escort quest recently started.
 

Attachments

  • -=Player=- Jamaica.zip
    748.6 KB · Views: 65
Weeeiiird! And you say that happens after a day of sailing? Can you confirm if it occurs at midnight?
There are a lot of "DailyCrewUpdates" which occur at that time and that includes all the food and rum consumption.
If you can confirm that too, then at least we'll know where to start looking. :facepalm
 
Weeeiiird! And you say that happens after a day of sailing? Can you confirm if it occurs at midnight?
There are a lot of "DailyCrewUpdates" which occur at that time and that includes all the food and rum consumption.
If you can confirm that too, then at least we'll know where to start looking. :facepalm

Yes, I have done a check at midnight, and this problem I mentioned happens also during that time. I can confirm it.
 
Thanks; then I know what section of code to look at.
PROGRAM\WorldMap\DailyCrewUpdate.c specifically the part that deals with rations.
 
Is this a NEW problem? Does anyone else notice this too?

I'd expect the problem to be hiding somewhere in here:
Code:
      rumusedtemp = rumusedtemp + rationedRumConsumption; //JA: total rum used today and rest of yesterday

       //Handle fractional rum requiements.
       //ignore small leftover rum fractions
       if(round(rumusedtemp) - rumusedtemp <= 0.05 && round(rumusedtemp) - rumusedtemp >= -0.05) rumusedtemp = round(rumusedtemp);
       else //add extra rum fraction to next day's rum, and round down todays rum.
       {
         pchar.Crewstatus.rumused = rumusedtemp - makefloat(makeint(rumusedtemp));
         rumusedtemp = makeint(rumusedtemp);
       }
       //Remove eaten rum from total quantity
       rumQ = rumQ - rumusedtemp;
       
       if(rumQ <= 0)
       {
         rumQ = 0;
         pchar.Crewstatus.rumused = 0.0
       }

       //divide remaining rum back into ships
       for(i=0; i<4; i++)
       {
         cn = GetCompanionIndex(&pchar,i);
         if(cn!=-1) rt[i] = makeint(makefloat(rumQ)*rumRatio[i]);
       }

       if(rt[0]+rt[1]+rt[2]+rt[3] == 0 && rumQ > 0) //handle special case of trying to divide 1 or two rum between a few ships
       {
         rt[iMostRumShip] = 1; //put last remaning rum on this ship;
       }

       //if rum doesn't divide evenly:
       while(rt[0]+rt[1]+rt[2]+rt[3] != rumQ)
       {
         for(i=0; i<4; i++)
         {
           if(rt[i] > 0) //ship had rum
           {
             if(rt[0]+rt[1]+rt[2]+rt[3] > rumQ) //too much rum so remove one
             {
               rt[i]--;
             }
             if(rt[0]+rt[1]+rt[2]+rt[3] < rumQ) //not enough rum so add one
             {
               rt[i]++;
             }
           }
         }
       }
       SetCharacterGoods(&pchar, GOOD_RUM, rt[0]);
       for(i=1; i<4; i++)
       {
         cn = GetCompanionIndex(&pchar,i);
         if(cn!=-1) SetCharacterGoods(&Characters[cn],GOOD_RUM, rt[i]);
       }
But I don't understand why. That code hasn't been touched since Build 13, if I recall.
 
You never do know. Maybe indeed it should be tested on the next update as well.
 
This should be easy enough to replicate, right?
If so, it may be good to try again after the version I'll make tomorrow.

Also have to check an earlier version to see if this is new at all or not.
Do you remember seeing this before, @HellSailor? Or did you never notice one way or another?
 
This should be easy enough to replicate, right?
If so, it may be good to try again after the version I'll make tomorrow.

Also have to check an earlier version to see if this is new at all or not.
Do you remember seeing this before, @HellSailor? Or did you never notice one way or another?
Yeah, I saw this problem last month in the other versions. This must have developed from September. Not before that moment. But I just didn't care too much about it. :p
 
So it IS something relatively new then? YIKES!
What is the quickest way to replicate it? I'll probably have to check an older version. :modding
 
If for replicate you refer a situation where you can make this bug appear... well... it's just as easy as you start an escort quest and you see your cargo hold with more food and rum that it used to be. Then you notice the companion ship don't have any food or rum.

By the way, this info might be of your interest, @Pieter Boelen: When I went to the shipyard to repair the companion ship after a storm, the purser bought automatically food to the companion's ship. Then passed midnight (Or passed another day), that food the purser bought for the companion's ship was transfered to my ship. Just the same as with the first post.
 
Ah. I just did an escort quest and while I didn't check before starting my food never got very high, but I did notice that the other ship had no food or rum.
 
I'll have a look at it tomorrow, I suppose.

Does this affect ONLY Escort Quest companions or regular ones as well?
 
I just did the following test:
- Started new game on Assassin
- Hired an officer and purchased him a ship (cheatmode gave me the money of course)
- Got an escort quest to Barbados
- Wait one night in the tavern

Before the waiting, each of the three ships had a reasonable supply of supplies.
After waiting, the food and rum ended up split between my own and the regular companion ship.
The escort ship was left with nothing.

So this seems to limited to ONLY escort quest ships and not regular companions.
That being the case, I have at least some idea of where to search for the issue. I'll try.
In the meantime, thread renamed for accuracy. :doff
 
I removed some GetRemovable checks in the related code and now this no longer happens. :woot

However, all food and rum consumption seems to be taken from ONE ship rather than each ship handling their own.
Effectively in my case, that means the escort ship is feeding us all.
But I think if my companion and escort were swapped, it would be the other way around and my companion would be feeding the escort ship. :facepalm
 
Just tried it on version 3.4 and same thing overnight in tavern you strip the escort of food which goes to your vessel so actually not a new problem.

First glance at the code there are points in the code where the escort ship is indeed supposed to be excluded from the squadron calculations (which makes sense - you didn't agree to share provisions either way) but I presume it has been missed at some point(s) in the add up all the food/rum work out squadron crew, work out consumption, spread the remainder back into the squadron process. There is some code referenced to LDH in Oct06 as part of "fixing" quest ships.

If you like since this appears to be not part of recent changes (which are a bit too in-flux for me to get involved with) I'll look a bit deeper and see what I can work out?
 
Just tried it on version 3.4 and same thing overnight in tavern you strip the escort of food which goes to your vessel so actually not a new problem.
Thanks to check that on Beta 3.4: I didn't know that it was even more older than I thought.
 
Back
Top