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

Spoiler Bartolomeu questline

BigBoi

Powder Monkey
I just finished "A strange statuette", i left Roxanne at the port and when i try to get off the island, meaning going to my ship deck and then the "Sea" tab, the screen just fades to black and nothing else happens. I can still use F1 to load another game, so it's not a crash.

Speeding up time also works, i can even unsheathe my weapon and attack and move but the screen is black
 
Can you post "compile.log", "system.log", and "error.log" if it exists?
 
Here you go
 

Attachments

  • system.log
    1.1 KB · Views: 57
  • compile.log
    4 KB · Views: 55
  • error.log
    1.3 KB · Views: 55
There are some odd reports in "error.log" which I'd like to investigate. Do you have a savegame from shortly before you arrive at the port, or even from shortly after arriving but before disposing of the statuette?
 
Odd. The game seems to have forgotten where your ship is. Do you have a savegame from after you defeated de Jonghe but before you arrived at St. Pierre?
 
You should be able to capture de Jonghe's ship. I've certainly captured it in the past when playing this storyline - much easier than trying to sink something that size with the little guns of the Santiago, plus prize money for selling it later.

The search for Santiago is a different quest entirely.

Did you do anything else between defeating de Jonghe at Curacao and arriving at Martinique?
 
I landed at Sao Jorge to get promoted, i didn't change anything else there i think, should i just go directly to Martinique?
 
That should not cause any trouble either.

Do you have a saved game from before you went to Martinique?
 
Didn't i send two save files in my attachment? Here's another.
 

Attachments

  • -=Bruh=- Open Sea April 18th, 1662.rar
    925.2 KB · Views: 48
The problem is when you sell a ship. I found the savegame in Sao Jorge, went to the shipyard to sell Gherarde de Jongh's ship, and the same thing happened - the game forgot where my ship was moored, I couldn't board it by walking to the port or beach, I could fast-travel to the deck and then the game broke when I tried to go to sea.

@pedrwyth: you have more experience with "PROGRAM\INTERFACE\shipyard.c" than I, so perhaps you could advise? The game here appears to have picked up attribute "location.old_from_sea", which is blank. As far as I can tell from a search for "location.old_from_sea", this attribute is set as a backup of "location.from_sea" when you sell or berth your last ship, then "location.from_sea" is blanked so that you can't try to board ship when you don't have one. When you buy or relaunch a ship, function 'ClampShipToType' checks if "location.old_from_sea" exists, and if so, copies it to "location.from_sea" and then deletes it. That function is also called when you sell a ship that isn't your last one. So it finds the blank "location.old_from_sea" in this game, copies it to "location.from_sea", and that's why the ship is no longer in port or at the beach. But there is a ship, so fast-travel is possible - and then when the game switches to sailing mode, it has no idea where to put the ship. My question is therefore, do you think it would break anything if I change this line in 'ClampShipToType':
Code:
chref.location.from_sea = chref.location.old_from_sea;
... to this:
Code:
if (chref.location.old_from_sea!= "") chref.location.from_sea = chref.location.old_from_sea;
It should still only get to this line if it's found "chref.location.old_from_sea", and will still delete the attribute; but there's no point in copying "chref.location.old_from_sea" to "chref.location.from_sea" if it's blank.
 
The problem is when you sell a ship. I found the savegame in Sao Jorge, went to the shipyard to sell Gherarde de Jongh's ship, and the same thing happened - the game forgot where my ship was moored, I couldn't board it by walking to the port or beach, I could fast-travel to the deck and then the game broke when I tried to go to sea.

@pedrwyth: you have more experience with "PROGRAM\INTERFACE\shipyard.c" than I, so perhaps you could advise? The game here appears to have picked up attribute "location.old_from_sea", which is blank. As far as I can tell from a search for "location.old_from_sea", this attribute is set as a backup of "location.from_sea" when you sell or berth your last ship, then "location.from_sea" is blanked so that you can't try to board ship when you don't have one. When you buy or relaunch a ship, function 'ClampShipToType' checks if "location.old_from_sea" exists, and if so, copies it to "location.from_sea" and then deletes it. That function is also called when you sell a ship that isn't your last one. So it finds the blank "location.old_from_sea" in this game, copies it to "location.from_sea", and that's why the ship is no longer in port or at the beach. But there is a ship, so fast-travel is possible - and then when the game switches to sailing mode, it has no idea where to put the ship. My question is therefore, do you think it would break anything if I change this line in 'ClampShipToType':
Code:
chref.location.from_sea = chref.location.old_from_sea;
... to this:
Code:
if (chref.location.old_from_sea!= "") chref.location.from_sea = chref.location.old_from_sea;
It should still only get to this line if it's found "chref.location.old_from_sea", and will still delete the attribute; but there's no point in copying "chref.location.old_from_sea" to "chref.location.from_sea" if it's blank.
These days unless I'm actually looking at something I don't remember so much how things work ... anyway....

I don't see what your proposed change could harm, however I can't initially see how location.old_from_sea gets set as a blank. and therefore if it is what location.from.sea could be left as.

Perhaps if their is no reset based on a previous location (because it's blank) the current town port should be set as a fall back if location.from.sea is blank. Could give you problems if it is a hostile location but better than a ctd.

I have speculated previously about selling a ship and running across the island to another port and buying/launching there, perhaps this is the time to look further at that too. Do you want me to look further or are you happy just to implement what you suggested for now?

PS if you are making that change it should go in Enc_officer.c and Fred Bob's dialogues too - the same code is in there.
 
I don't see what your proposed change could harm, however I can't initially see how location.old_from_sea gets set as a blank. and therefore if it is what location.from.sea could be left as.

Perhaps if their is no reset based on a previous location (because it's blank) the current town port should be set as a fall back if location.from.sea is blank. Could give you problems if it is a hostile location but better than a ctd.
Good idea:
Code:
        if( CheckAttribute(chref,"location.old_from_sea") )
        {
            if(chref.location.old_from_sea != "") chref.location.from_sea = chref.location.old_from_sea;
            if(chref.location.from_sea == "") chref.location.from_sea = GetAttribute(GetCurrentTown(), "boarding.l1");
            SetFleetInTown(GetTownIDFromLocID(chref.location.from_sea), "pchar"); // NK 05-04-02 WM/IT set fleet.
            DeleteAttribute(chref,"location.old_from_sea");
        }
A bit dirty, but it's the only way I can see to figure out the port belonging to the current town. As a bonus, although I don't think there are currently any pirate colonies with a shipyard and a shore location that isn't a port, if there is one now or in the future then that ought to put your ship at the right port. (Nevis Pirate Settlement's "port" looks like a shore but it's still called "QC_port".)

I have speculated previously about selling a ship and running across the island to another port and buying/launching there, perhaps this is the time to look further at that too. Do you want me to look further or are you happy just to implement what you suggested for now?
If you can figure out how to do it, go ahead. :onya

PS if you are making that change it should go in Enc_officer.c and Fred Bob's dialogues too - the same code is in there.
See? I knew it was a good idea to ask you for advice! I'll make the above changes to both of those as well. (Except that they use "PChar" instead of "chref".)
 
See? I knew it was a good idea to ask you for advice! I'll make the above changes to both of those as well. (Except that they use "PChar" instead of "chref".)
If you want half a tale that is...

Looking further there is similar code in transfer_main.c which I "recently" added into kam_shipberthing.ship.c so perhaps I should have remembered it existed there, but as I said unless looking at something I no longer retain the knowledge as instant recall.


perhaps it is there that the newer reported problem(s) stems from. This is all code trying to avoid having location_from_sea as a blank because of the resulting ctd. [I think this is also the reason for ctd after visiting other shipdecks at sea too]. I suggest you should probably consider if your tweak is appropriate for those two too?

Another not quite resolved issue is here -



So I think I will lay aside any other potc related stuff I might have done and look in more detail at location.from_sea and/or other shipberthing related issues. Such as - what sequence can wipe the ship from a berthed captain? How to address a run across an island before re-launching a ship for pchar? How do you get a blank location.old_from_sea? One thought is perhaps visiting a companion ship and then going to sell/berth ships without going to sea may be a route to have location.from_sea as a blank to set into location.old_from_sea. Something to start with testing. As Oates said (before disappearing in his case, hopefully not in mine) "I may be some time".
 
If you want half a tale that is...
Better than a quarter of a tale, which is all I had before.

Looking further there is similar code in transfer_main.c which I "recently" added into kam_shipberthing.ship.c so perhaps I should have remembered it existed there, but as I said unless looking at something I no longer retain the knowledge as instant recall.


perhaps it is there that the newer reported problem(s) stems from. This is all code trying to avoid having location_from_sea as a blank because of the resulting ctd. [I think this is also the reason for ctd after visiting other shipdecks at sea too]. I suggest you should probably consider if your tweak is appropriate for those two too?
See if the attached files work. Both in the code for not having any "location.from_sea" and for having it blank, the attempt to assign it from "location.old_from_sea" checks whether "location.old_from_sea" is blank:
Code:
                if(refMyCharacter.location.old_from_sea != "")
                {
                    refMyCharacter.location.from_sea = refMyCharacter.location.old_from_sea;
                    SetFleetInTown(GetTownIDFromLocID(refMyCharacter.location.from_sea), "pchar"); // NK 05-04-02 WM/IT set fleet.
                }
And as a last resort, if "location.from_sea" is still either non-existent or blank:
Code:
        if(!CheckAttribute(refMyCharacter,"location.from_sea") || refMyCharacter.location.from_sea == "")
        {
            if(GetCurrentTownID() != "")
            {
                refMyCharacter.location.from_sea = GetAttribute(GetCurrentTown(), "boarding.l1");
                SetFleetInTown(GetTownIDFromLocID(refMyCharacter.location.from_sea), "pchar");
            }
        }
... check that you're in a valid town, then set "location.from_sea" to be its port and put your ship there.

So I think I will lay aside any other potc related stuff I might have done and look in more detail at location.from_sea and/or other shipberthing related issues. Such as - what sequence can wipe the ship from a berthed captain? How to address a run across an island before re-launching a ship for pchar? How do you get a blank location.old_from_sea? One thought is perhaps visiting a companion ship and then going to sell/berth ships without going to sea may be a route to have location.from_sea as a blank to set into location.old_from_sea. Something to start with testing. As Oates said (before disappearing in his case, hopefully not in mine) "I may be some time".
The other question is how you have "location.old_from_sea" while you have a ship. As far as I know, the attribute is only set when you sell or berth your last ship, after which I can only think of two ways to get a ship. One is if you buy or relaunch a ship, which should delete "location.old_from_sea". The other is if you are trying to be sneaky and preserve or sell a ship which you're about to lose anyway in a quest which then gives you a replacement. (I remember having to delete "location.old_from_sea" in "Ardent" for that reason - right near the start, you sail from Havana to Santiago in a stolen tartane, then steal something better, which caused trouble when someone sold the tartane before getting the better ship.)
 

Attachments

  • kam_shipberthing_ship.c
    42.4 KB · Views: 40
  • transfer_main.c
    39.2 KB · Views: 40
The other question is how you have "location.old_from_sea" while you have a ship.
True, or at least another question is....

As far as I know, the attribute is only set when you sell or berth your last ship, after which I can only think of two ways to get a ship. One is if you buy or relaunch a ship, which should delete "location.old_from_sea". The other is if you are trying to be sneaky and preserve or sell a ship which you're about to lose anyway in a quest which then gives you a replacement. (I remember having to delete "location.old_from_sea" in "Ardent" for that reason - right near the start, you sail from Havana to Santiago in a stolen tartane, then steal something better, which caused trouble when someone sold the tartane before getting the better ship.)
Yep, I saw that deletion in my wider notepad++ search for the attribute in all PROGRAM files:onya but useful to bear in mind that there could be a quest related exception to the norm that produces unforeseen effects later somewhere else not just look at the "normal" code.

Thanks for the amended files, it should help with the resolution of the issues (I hope) when/if I can trace how they arise and then use the amended files to see if that is enough to fix whatever I find.
 
OK first observation is that the two cases in the dialogue files I pointed out are in redundant code - their cases are never called because a call to kam shipberthing has been put instead (reluctantly removing some of Fred Bob's dialogue in his case). I think by now the code can be taken out to clean up the files a bit.
 
So is the bug happening because i have a berthed ship? I berthed it because i had a really good ship and the game replaces your current ship with the Santiago at the start of the questline.
 
Back
Top