• 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 Game crash when recruiting captured ship captain/exit captured ship

Wolve

Sailor
Ahoi!

When capturing an enemy ship I like to be more polite and give the captains a chance to join my crew. However, quite often I find the game crashing when he accepts to be my officer and I exit the dialogue.
Also when succesfully boarded a ship before, it often happens the game crashes when exiting the next ship I just cleared.
Are these known issues? And is there a way to fix them besides saving a lot and just deal with it?
Posted here since I'm not sure if it counts as a bug...
 
We know that looting during boarding can make the game unstable and cause it to crash.
Are you doing that?

Any log files?

What exact game version are you running?
With what extra fixes applied?
 
Also, when you get the enemy captain to join you, does he tell you what kind of officer type he is?
Can you maintain a list of the officer types mentioned and whether they cause a crash or not?
I wonder if that might be related....
 
He does not tell me what officer he is, so I cannot tell you. I'm running the Beta 4 from 2nd of April. The only extra fixes I added where the ship interface one (block assign officers button for companion ships) and the fixed ship hunting quest. If I recall correctly this tuff happened before those fixes as well. I'll post log files as soon as it happens again.
 
If it's crashing for the same reason as random walkers who offer to become officers sometimes crash the game, it happens before the officer can tell you his type. Log files probably won't say anything useful.

Try locking him up, then talking to him in the ship's hold. I think you have the option there to hire him as an officer as well, and if so, that has the advantage that you can save game before you talk to him - you don't need to go through another boarding action and find a co-operative captain to repeat the experiment.
 
He does not tell me what officer he is, so I cannot tell you.
Fair enough.

Should be quite easy to have compile.log tell us though.
I'll move this to the Bug Tracker so that I won't forget and we can get some more details.

If it's crashing for the same reason as random walkers who offer to become officers sometimes crash the game
Does that still happen? I tested that and couldn't replicate it, but if it randomly appears then it could still be a real problem.
A really ANNOYING problem too.
 
For reference, the relevant code file is PROGRAM\DIALOGS\Cabinfight_dialog.c .
Somewhere there is a line LAi_CreateOfficer in there. It could be in some way related to that.

Interesting things to check for starters would be to add these lines to the dialog file:
Code:
TraceAndLog("Before LAi_CreateOfficer: " + NPChar.quest.officertype);
LAi_CreateOfficer (....) // put the lines above and below around the actual 'LAi_CreateOfficer' line in that dialog file
TraceAndLog("After LAi_CreateOfficer:" + NPChar.quest.officertype);

Then every time you try to hire such an officer, check compile.log straight after
and mark both the "before" and "after" types and whether that example caused a crash or not.
 
I just had a crash again. Error.log and compile.log in attachment
 

Attachments

  • Pirates of the Caribbean.rar
    10.9 KB · Views: 122
These are a bit weird:
Code:
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 2908
missed attribute: fantomtype
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 2908
no rAP data
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 2908
missed attribute: fantomtype
RUNTIME ERROR - file: sea_ai\AIShip.c; line: 2908
no rAP data
RUNTIME ERROR - file: dialog.c; line: 414
incorrect argument index

What kind of encounter was this? WorldMap? Random ship surrounding an island? Quest Ship? If so, what quest?
 
It was a random spawned ship surrounding an island. Went from harbour to sea and then attacked it.
 
How can Coast Raiders be missing their "fantomtype"???
To be investigated some time.... :facepalm
 
I'll post more logs if I get the error again, that might help some (as I recall the game crashed also during worldmap encounters).
 
What hardware do you have? I'm beginning to wonder if your computer is having a hard time handling the game.

If you have apparently random crashes all over the place, perhaps there simply isn't a single code error that is responsible for it.
 
AMD Phenom II x2 550 BE (3.1 GHz dualcore, 64 bit)
8GB RAM
AMD Radeon HD 7790
OS: Windows 7 Ultimate 64 bit

Should be more than capable :p
 
I have the same problem yesterday, game crashed after the captain accept
to be my officer.Can it be this:Template <follow> -> path not found chr.id = Enc_Officer_7.
 

Attachments

  • compile.log
    12.5 KB · Views: 141
I have the same problem yesterday, game crashed after the captain accept
to be my officer.Can it be this:Template <follow> -> path not found chr.id = Enc_Officer_7.
Possibly. I wonder....
Please install the file attached to this post: Unconfirmed Bug - Empty officer appearing in Passengers | PiratesAhoy!
And then make the change as suggested by me in post #12 of that same thread.

I wonder if these two issues could possibly be related.

EDIT: Never mind, @Wolve's compile.log basically confirms my suspicion:
Code:
ClearCharacter erases Enc_Officer_7(Heynen Metsalaer)
ClearCharacter erases Enc_Officer_7()
ClearCharacter erases Enc_Officer_7()
ClearCharacter erases Enc_Officer_7()
Template <follow> -> path not found chr.id = Enc_Officer_7
Which is weird for several reasons:
1. Why does it happen FOUR TIMES?
2. Why does it happen when I'm pretty sure I deliberately added some code to NOT erase characters in the same location as the player to prevent specifically problems like this

It does seem that this problem is real and we're getting closer to the reason....

One thing you can both try as an experiment. Open PROGRAM\MAXIMUS_functions.c and find:
Code:
   //if(!UsableOfficer(_refEnemy))
   //{
     /*switch(Rand(7))
     {
       case 0: Fightincabin.quest.officertype = OFFIC_TYPE_BOATSWAIN; break;
       case 1: Fightincabin.quest.officertype = OFFIC_TYPE_CANNONEER; break;
       case 2: Fightincabin.quest.officertype = OFFIC_TYPE_QMASTER; break;
       case 3: Fightincabin.quest.officertype = OFFIC_TYPE_NAVIGATOR; break;
       case 4: Fightincabin.quest.officertype = OFFIC_TYPE_FIRSTMATE; break;
       case 5: Fightincabin.quest.officertype = OFFIC_TYPE_CARPENTER; break;
       case 6: Fightincabin.quest.officertype = OFFIC_TYPE_DOCTOR; break;
       case 7: Fightincabin.quest.officertype = OFFIC_TYPE_ABORDAGE; break;
     }*/
//     if(!CheckAttribute(Fightincabin,"quest.officertype")) Fightincabin.quest.officertype = GetRandomOfficerType(); //Levis let's use a global function so we can easily add types later.
//     LAi_Create_Officer(rand(8), &Fightincabin);
   //}
And replace with:
Code:
   //if(!UsableOfficer(_refEnemy))
   //{
     /*switch(Rand(7))
     {
       case 0: Fightincabin.quest.officertype = OFFIC_TYPE_BOATSWAIN; break;
       case 1: Fightincabin.quest.officertype = OFFIC_TYPE_CANNONEER; break;
       case 2: Fightincabin.quest.officertype = OFFIC_TYPE_QMASTER; break;
       case 3: Fightincabin.quest.officertype = OFFIC_TYPE_NAVIGATOR; break;
       case 4: Fightincabin.quest.officertype = OFFIC_TYPE_FIRSTMATE; break;
       case 5: Fightincabin.quest.officertype = OFFIC_TYPE_CARPENTER; break;
       case 6: Fightincabin.quest.officertype = OFFIC_TYPE_DOCTOR; break;
       case 7: Fightincabin.quest.officertype = OFFIC_TYPE_ABORDAGE; break;
     }*/
     if(!CheckAttribute(Fightincabin,"quest.officertype")) Fightincabin.quest.officertype = GetRandomOfficerType(); //Levis let's use a global function so we can easily add types later.
     LAi_Create_Officer(rand(8), &Fightincabin);
   //}

See if that makes any difference.
 
Fun fact: Heynen Metsalaer is one of my officers.
So if he gets deleted that will create the empy officer?
Replaced the code, will post new log if the game crashes again (off to hunt some ships it is!:g2)
 
Do you have a save where that guy is still with you?
He isn't supposed to be deleted, so I wonder how that is even possible.

Where and how do you have him assigned?
 
Back
Top