• 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 Standard Storyline: Black Pearl at Martinique removed too early using DirectSail

morgan terror

Magnificent bastard
Storm Modder
Public Relations
I recall seeing this back in build 13 already, but it's apparently not yet been fixed in beta 3.4. When you're suppose to encounter the black pearl for the first time, it simply does not spawn. You'll get the message that it did, and you'll be able to continue the quest, but the ship itself doesn't show up. Only happens when using directsail for as far as i'm aware.

I've attached a savegame where i'm on my way there from barbados. The wind is good, so it should be possible to get to martinique in an hour change or two for testing.
 

Attachments

  • -=Player=- Open Sea February 8th, 1751.zip
    986.9 KB · Views: 106
Any log files to go with that?

That is still a Beta 3.4 save, is it?
 
Most interesting will be to see in compile.log if the quest case that puts the Pearl in place IS triggered.
It should be. But then if it is, the ship should be there as well. So it's a bit odd....
 
I've got some logs. The compile log is the most interesting one out of these. Also included a better savegame, mere minutes away from getting to martinique.
 

Attachments

  • -=Player=- Open Sea February 7th, 1751.zip
    981.5 KB · Views: 84
  • system.log
    3.5 KB · Views: 106
  • error.log
    364 bytes · Views: 101
  • compile.log
    4.2 KB · Views: 85
Code:
Quest name Seen_Black_Pearl FOUND in BothQuestComplete
Quest name seen_black_pearl_away FOUND in BothQuestComplete
^ Could you post those two quest cases from the Standard storyline both_reaction.c file?
Looks like they're both triggered at the same time, while my first impression is that only the FIRST should be triggered to begin with.
 
Code:
Quest name Seen_Black_Pearl FOUND in BothQuestComplete
Quest name seen_black_pearl_away FOUND in BothQuestComplete
^ Could you post those two quest cases from the Standard storyline both_reaction.c file?
Looks like they're both triggered at the same time, while my first impression is that only the FIRST should be triggered to begin with.

Here you go:

Code:
    case "Seen_Black_Pearl":
       Log_SetStringToLog(QUEST_MESSAGE7);

       Group_CreateGroup("Big Boss");
       Group_AddCharacter("Big Boss", "Barbossa");
       Group_SetGroupCommander("Big Boss", "Barbossa");
       Group_SetPursuitGroup("Big Boss", PLAYER_GROUP);
       Group_SetAddress("Big Boss", "FalaiseDeFleur", "", "");
       Group_SetTaskMove("Big Boss", 10000, 10000);
       Group_LockTask("Big Boss");
       
       SetCharacterRelationBoth(GetCharacterIndex("Barbossa"),GetMainCharacterIndex(),RELATION_FRIEND);
// KK -->
       // prevent companions from attacking Black Pearl (for now)
       for(i = 0; i < 4; i++) {
         if (GetCompanionIndex(PChar, i) >= 0 && GetRemovable(GetCharacter(GetCompanionIndex(PChar, i))))
         {
           SetCharacterRelationBoth(GetCharacterIndex("Barbossa"),GetCompanionIndex(PChar, i),RELATION_FRIEND);
         }
       }
// <-- KK

// KK -->
       if (ENABLE_FLAGS == 1) {
         PChar.previous_relation = GetActualRMRelation(PIRATE);
         PChar.previous_flag = PChar.nation;
         PChar.nation = PERSONAL_NATION; // PB: Otherwise the below doesn't work
         SetActualRMRelation(PIRATE, REL_NEUTRAL);

         iForceDetectionFalseFlag = -1;
       }
// <-- KK
       UpdateRelations();

       PChar.quest.seen_black_pearl_away1.win_condition.l1 = "MapEnter";
       PChar.quest.seen_black_pearl_away1.win_condition = "seen_black_pearl_away";
       
       PChar.quest.seen_black_pearl_away2.win_condition.l1 = "location";
       PChar.quest.seen_black_pearl_away2.win_condition.l1.location = "Falaise_De_Fleur_port_01";
       PChar.quest.seen_black_pearl_away2.win_condition = "seen_black_pearl_away";
       
       PChar.quest.seen_black_pearl_away3.win_condition.l1 = "location";
       PChar.quest.seen_black_pearl_away3.win_condition.l1.location = "Falaise_De_Fleur_shore_01";
       PChar.quest.seen_black_pearl_away3.win_condition = "seen_black_pearl_away";
     break;

Code:
    case "seen_black_pearl_away":
// KK -->
       if (ENABLE_FLAGS == 1) {
         PChar.nation = PChar.previous_flag;
         SetActualRMRelation(PIRATE, stf(PChar.previous_relation));
         iForceDetectionFalseFlag = 0;
         DeleteAttribute(PChar, "previous_relation");
         DeleteAttribute(PChar, "previous_flag");
       }
// <-- KK
       PChar.quest.seen_black_pearl_away2.over = "yes";
       PChar.quest.seen_black_pearl_away3.over = "yes";
       Group_SetAddress("Big Boss", "none", "", "");
       PChar.quest.seen_black_pearl_away1.over = "yes";
       PChar.quest.seen_black_pearl_away2.over = "yes";
       PChar.quest.seen_black_pearl_away3.over = "yes";
     break;
 
Looks like I was right. The needed quest case IS executed, but so is the NEXT one that removes her again.

DirectSail updates trigger quest cases of the "MapEnter" type, specifically so that you don't need to use the worldmap for the quests to proceed.
So I think this is trhe culprit:
Code:
  PChar.quest.seen_black_pearl_away1.win_condition.l1 = "MapEnter";
  PChar.quest.seen_black_pearl_away1.win_condition = "seen_black_pearl_away";
You could comment out those two lines and try again, just to confirm that suspicion of mine as well.

Assuming that I am correct, it seems that the "MapEnter" on DirectSail updates is working TOO GOOD.
As in: It is set and executed basically at the same time.

But how to fix it in such a way that it doesn't break anything?
Maybe we could check "if in DirectSail, don't use that check", which would mean that you MUST go ashore in order for the Pearl to be removed again.
Ideally you would want "just passing Martinique" to do that as well though. But if we add a delay of sorts, that may be a bit risky. :facepalm
 
Is there no way of saying that the black pearl should be present until the next sea reload? That way it'll be present until you head back out to sea, or you continue sailing for some more time using directsail without actually landing at martinique. The latter isn't quite as important though. The questline that spawns the pearl there also requires you to land at martinique to speak to an NPC, so it's quite likely the player will land there anyway,
 
Is there no way of saying that the black pearl should be present until the next sea reload?
That is exactly what that current code is already meant to be doing. Except apparently in DirectSail it doesn't quite work.
Which is to say: It works TOO GOOD.

Please try without that line and see if that seems OK. Since you need to go ashore anyway, maybe we could get away with that as a "quick fix".
 
That is exactly what that current code is already meant to be doing. Except apparently in DirectSail it doesn't quite work.
Which is to say: It works TOO GOOD.

Please try without that line and see if that seems OK. Since you need to go ashore anyway, maybe we could get away with that as a "quick fix".

You're damn right it works! Thing showed up right in my face. :8qI like the smoke effect though.

I've also tried doing the visit to shore afterwards and heading back out to sea after i'd finished my business. Black pearl was indeed gone. Should i test to see if it'll show up again on a second visit to the island, or will this be allright as-is?
 

Attachments

  • system.log
    9.5 KB · Views: 107
  • error.log
    299 bytes · Views: 117
  • Build Info.txt
    138.9 KB · Views: 130
What it will do now is to simply stick around until you go ashore and after that she'll be gone.
If you come from worldmap, she should be there as well. If you then go back to worldmap and return, she'll still be there.
That last part is different due to the removed code, since she used to disappear in that case as well.

Unless anyone has any objections, I think we can just comment out those lines and call it a day.
Otherwise this might become a complex thing to fix. And I like simple fixes. ;)
 
What it will do now is to simply stick around until you go ashore and after that she'll be gone.
If you come from worldmap, she should be there as well. If you then go back to worldmap and return, she'll still be there.
That last part is different due to the removed code, since she used to disappear in that case as well.

Unless anyone has any objections, I think we can just comment out those lines and call it a day.
Otherwise this might become a complex thing to fix. And I like simple fixes. ;)

So the pearl only dissapears when you land at martinique? That might work.
 
So the pearl only dissapears when you land at martinique? That might work.
Yup.

So gone it is:
Code:
      // PB: Disabled because this triggers TOO EARLY when using DirectSail -->
     //   PChar.quest.seen_black_pearl_away1.win_condition.l1 = "MapEnter";
     //   PChar.quest.seen_black_pearl_away1.win_condition = "seen_black_pearl_away";
       // PB: Disabled because this triggers TOO EARLY when using DirectSail <--

I reckon that will be good enough to call this "Fixed". Easy does the trick. :razz
 
Yup.

So gone it is:
Code:
      // PB: Disabled because this triggers TOO EARLY when using DirectSail -->
     //   PChar.quest.seen_black_pearl_away1.win_condition.l1 = "MapEnter";
     //   PChar.quest.seen_black_pearl_away1.win_condition = "seen_black_pearl_away";
       // PB: Disabled because this triggers TOO EARLY when using DirectSail <--

I reckon that will be good enough to call this "Fixed". Easy does the trick. :razz

Yeah, can put that right in the next installer.
 
Looks like I was right. The needed quest case IS executed, but so is the NEXT one that removes her again.

DirectSail updates trigger quest cases of the "MapEnter" type, specifically so that you don't need to use the worldmap for the quests to proceed.
So I think this is trhe culprit:
Code:
  PChar.quest.seen_black_pearl_away1.win_condition.l1 = "MapEnter";
  PChar.quest.seen_black_pearl_away1.win_condition = "seen_black_pearl_away";
You could comment out those two lines and try again, just to confirm that suspicion of mine as well.

Assuming that I am correct, it seems that the "MapEnter" on DirectSail updates is working TOO GOOD.
As in: It is set and executed basically at the same time.

But how to fix it in such a way that it doesn't break anything?
Maybe we could check "if in DirectSail, don't use that check", which would mean that you MUST go ashore in order for the Pearl to be removed again.
Ideally you would want "just passing Martinique" to do that as well though. But if we add a delay of sorts, that may be a bit risky. :facepalm
So, which lines did you totally coment out so i can do it to my game as well?

Says it right here mate. You can find them in both_reaction.c. CTRL+F is your friend.
 
Back
Top