• 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 Marie Celeste

Wasn't bAlies rewritten to check properly on prisoner status?
Or was that another function? Maybe IsPassenger or something?
I have a vague memory of changing some of this behaviour ages ago for reasons related to this.
 
'bAllies' checks, in sequence, if the character is you, your companion, your officer, an officer of a companion, a passenger, on shore leave, is a "stored fellow", and - of particular significance here - if the character is in LAI_GROUP_PLAYER. Prisoners are, probably to prevent you from killing them except by talking to them first.

'IsPassenger' just looks through your passengers trying to find one whose index matches that of the character you're checking.

Another function, 'IsPrisoner', is even simpler - it just checks if the character has the "prisoned" attribute. That attribute is wiped from a prisoner being hired as an officer before he's cloned into an EncOfficer.
 
I think I've cracked it!

First I ran that console on my own savegame, paying particular attention to three cabincaptains who are genuine prisoners - numbers 7, 10 and 11. Down in the hold, I executed one, released one and hired one; then I returned to sea and ran the console again. The executed prisoner and hired prisoner still showed up as allies; only the released one had been cleared.

So I looked in "Cabinfight_dialog.c" to see what happens when a prisoner is executed. It decides randomly whether he's to be hanged or fed to the sharks; both cases do some stuff to steal his equipment, play the relevant video, and trigger event "LAi_RemoveDeadCap", which is handled in "LAi_boarding.c" by function 'Lai_RemoveDeadBody()', which kills the character. First question: if he's dead, why is he still in LAI_GROUP_PLAYER? Second question - why am I looking in "Cabinfight_dialog.c"? That's the file for when he's on his own deck - the one I should be looking in is "Prisoned_dialog.c". :facepalm OK, look in "Prisoned_dialog.c", which does some different things to the prisoner and ends by playing the same videos, but does not trigger event "LAi_RemoveDeadCap". So I added that line at the end of both cases "Exit_hanged" and "Exit_sharks".

Next I added the "ClearUponExit" attribute to the original character at the end of 'TIH_PrisonerHiredAsOfficerProcess'. Then I repeated the test - loaded the savegame, ran the console to show all the cabincaptains, executed a prisoner, released a prisoner and hired a prisoner, and ran the console again. The executed prisoner still showed up but was no longer an ally - and as this version of "console.c" ends by calling 'FindFreeCabinCaptain()' to show which cabin is free, it now showed slot 7 (the one used by the dead captain) as being free. Meanwhile the hired captain had been cleared entirely. One odd thing, though - before adding the line to clear him, the hired captain went into "officer" mode and followed me around the hold. Now he just stood still and "compile.log" had an error about him not having an ai type. I added 'LAi_SetOfficerType(RefChar);' right above the line to set his "ClearUponExit" attribute, and then he behaved properly - he followed me around the hold and "compile.log" didn't have the error.

The attached "cabincaptain_fix.zip" contains the modified "Prisoned_dialog.c" and "Dialog_func.c".

Also attached is another version of "console.c". This one scans through all cabincaptains and clears any who aren't actual passengers. I loaded the savegame supplied in the previous thread and ran that console. It listed a whole load of cabincaptains being wiped, then I checked the "Passengers" list, where all the passengers and prisoners who had been there before the purge were still there. And then I boarded the nearby surrendered ship, where the captain duly appeared.

@nich666: if you're still having the problem with surrendered captains failing to show up, download this "console.c", load up your most current savegame and press F12. Also download "cabincaptain_fix.zip", unzip it and copy it into place, which should prevent the problem from happening again later.
 

Attachments

  • cabincaptain_fix.zip
    28 KB · Views: 589
  • console.c
    34.7 KB · Views: 444
Hey so apparently captains still dont always appear on deck of surrendered ships(happens 25% of times on average). Not always surrendered. I had to fight crew of enemy ship on 5 different decks and once I got to captains cabin there was nobody there(happens 10% of times on average). There appears to be hand icon in the spot where captain should be. When I press F3, Space or Enter nothing happens tho.

upload_2019-6-4_19-6-3.png
 
Last edited:
Hello @Paul,

I've moved your post to this thread as this is where the problem of the non-appearing captain is discussed. Please use this thread in future, don't post bug reports to the general "Build 14 Beta" thread.

Have you downloaded the files from post #23? Have you run the "console.c" from that post? If not, then you will indeed continue to have the problem.

If you have downloaded those files, copied them into place, run the console, and are still getting the problem, then please try to get a savegame from just before you're about to board a surrendered ship, then post that savegame. I'll then be able to look at what's going on in your game.

The hand icon is nothing to do with the captain. It's a locator which is used for a special purpose in one storyline and does nothing except show the icon in any other storyline. "Tales of a Sea Hawk" is not the storyline which uses the locator.
 
Hey,

I have downloaded those files as soon as you posted them. Not sure if I run console tho. I will report if it happens again.
 
It shouldn't do any harm if you run that console more than once so, if you're not sure, press F12 and do it again.
 
@nich666: if you're still having the problem with surrendered captains failing to show up, download this "console.c", load up your most current savegame and press F12. Also download "cabincaptain_fix.zip", unzip it and copy it into place, which should prevent the problem from happening again later.


'I think I've cracked it!'

Hey Grey, Almost a year later and you certainly have.
I have been playing on and off over the year and then find myself again on a deserted deck with no way to get off or carry on with the game bar shutting down.

I followed your instructions putting files consol.c and cabincaptain_fix.zip into the game files replacing the originals, opened up the game again, (I had a save point), pressed F12 and voila (as they say down here), there was the captain waiting for me.
BRILLIANT. Well done, certainly I can confirm a fix.

Stay indoors stay safe and play games to while away the Lockdown.
Regards, Brian.
 
The fix where enemy captains don't appear after boarding a surrendered ship.
 

Attachments

  • error.log
    809 bytes · Views: 250
It only happened recently (I'm level 60 now), never happened before. It seems to happen every 4/5 boardings where the captain surrenders. Looked all around the deck 10 times each but still could not find them
 
@Foo Mxcah: I've moved your posts here as this is the most complete thread about surrendered captains failing to appear.

Which version of the game are you playing? This problem should be fixed in the most recent update, or indeed any update since mid 2019. Can you upload "compile.log" after failing to find a surrendered captain?

If you haven't installed the updates, try downloading the fix from post #23. Zipped file "cabincaptain_fix.zip" contains the fixed files. Downloading "console.c", then pressing F12 while running the game, clears any unwanted prisoner characters who weren't properly cleared when they were hired or executed - you'll need to run this if you want to continue your existing game.
 
Why it is happening: the bug was fixed in an update after 21st May. You could try downloading the fix from post #23.

Why it is happening only later in the game: there are only a limited number of free slots for captured captains. They aren't being properly cleared if you hire or execute your prisoners. So if you keep doing it, those slots eventually fill up and the game can not generate a new captain to surrender.

What the fix does: "cabincaptain_fix.zip" contains modified versions of a couple of files so that, if you hire or execute a prisoner, his slot is properly cleared and freed up for a new prisoner. "console.c" can be run on an existing game to purge all the slots for captured captains so that a new captain can be created.
 
Download "cabincaptain_fix.zip" and extract it into your game installation folder. The zip contains the folder "PROGRAM" which should be merged with the "PROGRAM folder in your installation. (Or extract the contents of the zip to somewhere else, then copy the files into place yourself. There are only two, "PROGRAM\Dialog_func.c" and "PROGRAM\DIALOGS\Prisoned_dialog.c".)

Also download "console.c" and put that into your "PROGRAM" folder.

Once all the files are in place, run the game and press F12 to run "console.c". That should clear out any unwanted captains and free up space for new prisoners.
 
Back
Top