• 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 Boarding: Crash Due to Not Correctly Initialized Enemy Captain

afar

Landlubber
guys, game crash during boarding. modpack 14 beta4 15 nov.
 

Attachments

  • compile.log
    5.5 KB · Views: 121
  • error.log
    859 bytes · Views: 137
  • system.log
    16.7 KB · Views: 132
guys, game crash during boarding. modpack 14 beta4 15 nov.
Ouch, these are a lot of error logs:
Code:
RUNTIME ERROR - file: Loc_ai\LAi_boarding.c; line: 1698
missed attribute: nation
RUNTIME ERROR - file: Loc_ai\LAi_boarding.c; line: 1698
no rAP data
RUNTIME ERROR - file: ships\ships.c; line: 891
missed attribute: nation
RUNTIME ERROR - file: ships\ships.c; line: 891
no rAP data
RUNTIME ERROR - file: Loc_ai\LAi_boarding.c; line: 1781
missed attribute: morale
RUNTIME ERROR - file: Loc_ai\LAi_boarding.c; line: 1781
no rAP data
RUNTIME ERROR - file: Loc_ai\LAi_boarding.c; line: 1365
missed attribute: morale
RUNTIME ERROR - file: Loc_ai\LAi_boarding.c; line: 1365
no rAP data
RUNTIME ERROR - file: Loc_ai\LAi_boarding.c; line: 1013
invalid index -1 [size:1000]
RUNTIME ERROR - file: Loc_ai\LAi_boarding.c; line: 1013
invalid array index
RUNTIME ERROR - file: Loc_ai\LAi_boarding.c; line: 1013
function 'LAi_ReloadBoarding' stack error
Looks to me like either the player character or the captain you are boarding wasn't fully initialized and is therefore missing all sorts of data.

Does this happen during ALL boardings?
If not, what (kind of) ship did you board?
 
guys, game crash during boarding. modpack 14 beta4 15 nov.
Please extract attached ZIP to your main game folder. It contains some extra checks.
This will NOT solve the problem, but hopefully will give us more details if and when it happens again.

Right now we just don't seem to know enough, though I suspect the problem comes from an incorrectly initialized enemy captain.
 

Attachments

  • BoardingLogging.zip
    36.6 KB · Views: 130
@Levis: I suspect that what happened here is that SetBaseShipData was never called for the enemy ship.
Which means that he somehow got past the Character_PostInit process.
How could that happen?

This function may even be called a SECOND time here in AIShip.c:
Code:
  if (iCharacterIndex >= FANTOM_CHARACTERS && !CheckAttribute(&rCharacter, "skipsetfantom")) // WM to not do this for fantoms already done.
   {
     SetBaseShipData(rCharacter);
     Ship_SetFantomData(rCharacter);

     Fantom_ClearCargo(rCharacter); // TIH clear out prior slot cargo
     Fantom_SetBalls(rCharacter, sFantomType);
     Fantom_SetGoods(rCharacter, sFantomType);
   }

And this call for all sea fantom should trigger a PostInit as well, no?
Code:
InitCharacterSkills(rFantom);   // PB: Reset this character
 
@Levis: I suspect that what happened here is that SetBaseShipData was never called for the enemy ship.
Which means that he somehow got past the Character_PostInit process.
How could that happen?

This function may even be called a SECOND time here in AIShip.c:
Code:
  if (iCharacterIndex >= FANTOM_CHARACTERS && !CheckAttribute(&rCharacter, "skipsetfantom")) // WM to not do this for fantoms already done.
   {
     SetBaseShipData(rCharacter);
     Ship_SetFantomData(rCharacter);

     Fantom_ClearCargo(rCharacter); // TIH clear out prior slot cargo
     Fantom_SetBalls(rCharacter, sFantomType);
     Fantom_SetGoods(rCharacter, sFantomType);
   }

And this call for all sea fantom should trigger a PostInit as well, no?
Code:
InitCharacterSkills(rFantom);   // PB: Reset this character
 
i use light fluyt. so far i only tried to board tier 1 ship named trinity, tier 2 ship and tier 4 frigate. all of them are french warships. even when i manage to kill all crew on 1st stage without game crash, i can't proceed to gun deck, cargo deck and cabin. and on 1st stage, if i loot corpse the game will crash. it happened after i installed newest update.
 
i use light fluyt. so far i only tried to board tier 1 ship named trinity, tier 2 ship and tier 4 frigate. all of them are french warships. even when i manage to kill all crew on 1st stage without game crash, i can't proceed to gun deck, cargo deck and cabin. and on 1st stage, if i loot corpse the game will crash. it happened after i installed newest update.
Is this by any chance the Standard Storyline (Nathaniel Hawk) and are these the three ships right outside Speightstown, Barbados?
That should at least give us a very clear test-case to work from, because those are specifically QUEST ships.
 
yes, standard storyline. all of them from ships i chase at sea. if they are quest ships, i can't capture them?
 
i've extracted the file u give up there and try play save file when i board the tier 2 ship, flureon if i'm not mistaken. there is message in game stating
LAi_ReloadBoarding
nation missing, please report

this is how i do the boarding if its help u figure whats the problem

i use french flag, then sail near the french ship i want till boarding range, the i change to pirate flag and then boarding.
 
if they are quest ships, i can't capture them?
You should be able to, but there is a difference in how they're generated.
Maybe that is the reason for it not working. If so, it definitely needs to be fixed. :yes

i've extracted the file u give up there and try play save file when i board the tier 2 ship, flureon if i'm not mistaken. there is message in game stating
LAi_ReloadBoarding
nation missing, please report
Once that happens, please post your compile.log again.
There should be some extra details now that should help us narrow down the problem.
 
more info. i've tried boarding lower tier pirate ship, i can't proceed to cabin.
 

Attachments

  • compile.log
    8.6 KB · Views: 137
  • error.log
    571 bytes · Views: 154
  • system.log
    2.6 KB · Views: 130
Will look at it tomorrow.
 
this is the file.
Holy crap, this is bizarre:
Code:
LAi_GetBoardingModel ERROR: Nation missing for ; Please report this at piratesahoy.net!
index = 2003
id =
location = none
  locator =
  group =
IsShipMerchant ERROR: Nation missing for ; Please report this at piratesahoy.net!
index = 2003
id =
location = none
  locator =
  group =
ERROR Captain  does't have a officertype. This shouldn't happen
Character doesn't even have an ID at all and ALL relevant attributes are missing.
Just like the character is fully cleared while it is still needed. :shock

more info. i've tried boarding lower tier pirate ship, i can't proceed to cabin.
Strangely enough, that file doesn't actually contain the "no nation" details that your other one does.
This definitely needs checking though. Being able to board most ships is quite a nice feature in the game and of course that needs to still work! :shock
 
For the sake of gaining more information, have any of our other players had such problems with boarding lately?
If so, do you remember with which modpack version that started? Is it a new problem as per the 15 Nov version or was it in the previous one (5 Nov) too?
 
Is it a new problem as per the 15 Nov version or was it in the previous
I think its a new problem with this 15 Nov version. It just happen for me now. I was
boarding a lot of ships in 5 Nov version without any problems.
 

Attachments

  • error.log
    66.4 KB · Views: 146
  • compile.log
    64.1 KB · Views: 122
Looks like we've got a new "scary problem" on our hands. :modding :modding :modding

@ANSEL: You were using some of the intermediate "Levis fixes" as well, right?
Did you have the problem there as well or does it truly seem to be related to the latest EXE itself?

The only TRULY related change in the new EXE compared to the "Levis fixes" file is this change posted here:
Fixed - After fast travel or quest reload non-existing characters are loaded | PiratesAhoy!

You can try to extract the attached file to your PROGRAM\Locations folder and see if that makes a difference.
This should set everything Levelling-related back to the state that @Levis left it in his files.
I have absolutely no clue if this will help anything at all or not. But trying will at least tell us for certain. :doff
 

Attachments

  • locations_loader.zip
    10 KB · Views: 121
@Pieter Boelen I think I might know the problem, but need to look into it more.
Please check the file where in the previous version the captains rank was also set. In a later file I removed that. Please check if that helps.
 
Please check the file where in the previous version the captains rank was also set. In a later file I removed that. Please check if that helps.
This one???
Code:
void Fantom_AddFantomCharacter(string sGroupName, int iShipType, string sFantomType, int iEncounterType, int iNation) // NK 04-09-05 add nation argument
{
   ref rFantom = GetFantomCharacter(iNumFantoms);
   ClearCharacter(rFantom); // PB: Clear ALL attributes from previous character
   rFantom.nation = iNation; // NK

//   DeleteAttribute(rFantom, "relation"); // PB: Character already cleared

   rFantom.SeaAI.Group.Name = sGroupName;
   rFantom.Ship.Type = GetShipID(iShipType); // PS
   //trace("added fantom " + rFantom.index + " with ship " + rFantom.ship.type);
   rFantom.Ship.idx = iShipType; // PS
   rFantom.Ship.Mode = sFantomType;
   rFantom.ship.cannons.Charge.Type = GOOD_BALLS;
//NK -->
//   DeleteAttribute(rFantom,"ship.cannons.borts"); rFantom.ship.cannons.borts = ""; // NK 05-04-18 cannon qty // PB: Character already cleared
   // PRS3 -->
   aref arship; makearef(arship, rFantom.ship);
//   DeleteAttribute(rFantom, "ship.stats"); // PB: Character already cleared
//KB - Tuning ships - changed call to SetRandomStatsToShip
   SetRandomStatsToShip(sti(rFantom.index), iShipType, iNation);
//KB - orig  SetRandomStatsToShip(arship, iShipType, iNation);
//KB
// PRS3 <--
   if(sti(rFantom.nation) == PIRATE) { sFantomType = "pirate"; }
   else { if(sFantomType == "pirate") { sFantomType = "war"; } }
   rFantom.shiptype = GetShipID(iShipType); // PS
   rFantom.FantomType = sFantomType;
   float mult = 1.0;
   if(DEBUG_EXPERIENCE>0) TraceAndLog("Fantom_AddFantomCharacter: Set officer type for " + GetMySimpleName(rFantom));
   /*switch(sFantomType)
   {
     case "trade":
       mult *= 1.0;
       rFantom.quest.officertype = OFFIC_TYPE_CAPMERCHANT;
       break;
       
     case "war":
       mult *= 1.25;
       rFantom.quest.officertype = OFFIC_TYPE_CAPNAVY;
       break;
       
     case "pirate":
       mult *= 1.25;
       rFantom.quest.officertype = OFFIC_TYPE_CAPPIRATE;
       break;

     case "error":
       mult *= 1.0;
       rFantom.quest.officertype = OFFIC_TYPE_CAPPIRATE;
       break;
   }*/
   //Levis moved this to already existing functions
   rFantom.quest.officertype = GetCaptainType(rFantom);
   mult *= CaptainMultFromOfficerType(rFantom.quest.officertype);
   ref Shiptype = GetShipByType(iShipType);
   int iMCShipClass = makeint(GetCharacterShipClass(GetMainCharacter()));
   if (sti(Shiptype.Class) < iMCShipClass) {
     mult *= 1.15;
   } else {
     if (makeint(Shiptype.Class) > iMCShipClass) mult *= 0.85;
   }
   rFantom.Points = mult * stf(GetLocalShipAttrib(&arship,&Shiptype,"Weight")) / 5000; // PRS3
   //Log_SetStringToLog("Type: " + rFantom.FantomType + "; Mult: " + rFantom.Points);
// NK <--
   InitCharacterSkills(rFantom);   // PB: Reset this character
   iNumFantoms++;
}
 
Back
Top