• 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 Jack Sparrow Storyline: Quest Issues with Cortez Treasure

Mirsaneli

Privateer
Storm Modder
Ok, so I have been testing the Jack Sparrow storyline pretty detailed, searching for bugs or bad codes. My 4th attempt has been well for now, but the part of the storyline with the Cortez treasure has some issues which, in my opinion, should be fixed if we wanna have a complete storyline without bugs. I have posted 2 savegames:

first one is before I went to the cavern where the treasure is located. In that savegame, I managed to open the chest and take the coins three times without Barbossa suggesting me that we are being followed (which triggers the mutiny on the ship and opens the part where Barbossa robs Jack Sparrow and takes his ship). Fourth time, I walked through the shore a bit waiting for something to happen, and yes, he suddenly approached and started speaking about the treasure, and after that when we entered the cavern, he said that we are being followed. Now, we have to think as a common player, who will play this Mod without thinking what should be triggered. If I managed to leave the island without main storyline part being triggered, than that storyline broke from that moment and there is no way to continue it.

Second savegame: after I agreed that we shoud hoist the Portuguese flag and sail away to "distract the patrol", there happens a mutiny. Everthing is ok there, but when you are dumped on the shore, you shouldn't be able to return to your ship anymore, insted, you should only be able to watch it sail away (which does happen actually). But still, I was able to enter Black Pearl through quick commands menu and after that open the 3D sailing mode (and brake the main storyline by leaving Isla de Muerte). So, I think that quick commands menu should be disabled in that moment (or just disable the ability to enter the ship from which you were thrown out).
 

Attachments

  • savegame.rar
    1.3 MB · Views: 78
first one is before I went to the cavern where the treasure is located. In that savegame, I managed to open the chest and take the coins three times without Barbossa suggesting me that we are being followed (which triggers the mutiny on the ship and opens the part where Barbossa robs Jack Sparrow and takes his ship). Fourth time, I walked through the shore a bit waiting for something to happen, and yes, he suddenly approached and started speaking about the treasure, and after that when we entered the cavern, he said that we are being followed.
Do you have the compile.log for that happening? That should tell us the quest case to look for.
I rewrote another section of code for a different scene on Isla de Muerta a while back which had a similar issue.
If it is what I think it is, it may be due to a "locator radius" being too small for the quest to trigger easily.

Second savegame: after I agreed that we shoud hoist the Portuguese flag and sail away to "distract the patrol", there happens a mutiny. Everthing is ok there, but when you are dumped on the shore, you shouldn't be able to return to your ship anymore, insted, you should only be able to watch it sail away (which does happen actually). But still, I was able to enter Black Pearl through quick commands menu and after that open the 3D sailing mode (and brake the main storyline by leaving Isla de Muerte). So, I think that quick commands menu should be disabled in that moment (or just disable the ability to enter the ship from which you were thrown out).
Compile.log should help here too.
I'm sure @Grey Roger remembers the command to disable fast travel and travel to your ship.
That should be relatively easy to add.
 
Do you have the compile.log for that happening? That should tell us the quest case to look for.
I rewrote another section of code for a different scene on Isla de Muerta a while back which had a similar issue.
If it is what I think it is, it may be due to a "locator radius" being too small for the quest to trigger easily.
One way to fix this is by increasing the size of the locator. I had a similar problem in "Hornblower" when, following a battle with some French soldiers, you need to approach Lt. Uriah Quelp to talk to him, and this was my first solution:
Code:
Locations[FindLocation("Antigua_outskirts")].locators_radius.goto.goto60 = 5.0;
And then I took a completely different approach to the same problem:
Code:
LAi_SetGuardianType(characterFromID("Lt. Uriah Quelp"));
Now you don't need to walk around trying to find the magic spot. He stands there and you go and talk to him - it's you who initiates the dialog, not he. Perhaps the same could be done for Barbossa? Otherwise is there a way to have the taking of the coins trigger the next quest case, so that Barbossa would come to you?

Compile.log should help here too.
I'm sure @Grey Roger remembers the command to disable fast travel and travel to your ship.
Code:
DisableFastTravel(true);

Also, if your ship has just been stolen then you are currently shipless, as Hornblower is when he's been taken prisoner:
Code:
       DeleteAttribute(pchar, "Ship");
       pchar.Ship.Type = SHIP_NOTUSED_TYPE_NAME;
       pchar.Ship.Name = "";
 
Here's the compile.log.
Looks like it isn't. That contains zero details about any quests. Whenever a "quest case" is executed, that is written to compile.log .
In this case, what I need are specifically the names of those quests that were most recently executed when your reports occurred.
That tells us where to search in the code files and greatly speeds up the trouble-shooting.
 
Looks like it isn't. That contains zero details about any quests. Whenever a "quest case" is executed, that is written to compile.log .
In this case, what I need are specifically the names of those quests that were most recently executed when your reports occurred.
That tells us where to search in the code files and greatly speeds up the trouble-shooting.

How can I get that particular part of quest?
 
One way to fix this is by increasing the size of the locator. I had a similar problem in "Hornblower" when, following a battle with some French soldiers, you need to approach Lt. Uriah Quelp to talk to him, and this was my first solution:
Code:
Locations[FindLocation("Antigua_outskirts")].locators_radius.goto.goto60 = 5.0;
And then I took a completely different approach to the same problem:
Code:
LAi_SetGuardianType(characterFromID("Lt. Uriah Quelp"));
Now you don't need to walk around trying to find the magic spot. He stands there and you go and talk to him - it's you who initiates the dialog, not he. Perhaps the same could be done for Barbossa? Otherwise is there a way to have the taking of the coins trigger the next quest case, so that Barbossa would come to you?


Code:
DisableFastTravel(true);

Also, if your ship has just been stolen then you are currently shipless, as Hornblower is when he's been taken prisoner:
Code:
       DeleteAttribute(pchar, "Ship");
       pchar.Ship.Type = SHIP_NOTUSED_TYPE_NAME;
       pchar.Ship.Name = "";

I like your post, though I don't own the necessary skills to rewrite that code... :/
 
How can I get that particular part of quest?
Play through it, then the moment the error occurred, check your compile.log .
That name should then be one of the last things logged in that file.

I like your post, though I don't own the necessary skills to rewrite that code... :/
Once we know where to look from the quest case name, it should be easy enough to add that.
Assuming that is indeed what's wrong; at the moment I'm just guessing.
 
Still missing those compile.log files showing the relevant quest cases.
Having those would save me a lot of time when looking into this one.... :rolleyes:
 
Compile.log should help here too.
I'm sure @Grey Roger remembers the command to disable fast travel and travel to your ship.
That should be relatively easy to add.


This code starts with the case after the dialog with Barbossa when he suggests sailing away with a portuguese flag, in the cave on Isle de Muerta

covers the mutiny and being castaway on small island & meeting Smugglers. :yes

The small island is not a real island on the world map - it is just a fake made up of 2 beach locations & a bit of jungle inbetween. :yes

from quests_reaction.c

Code:
case "Barbossa_and_me_back_to_Beach":
       LAi_SetOfficerType(characterFromID("Barbossa"));
       LAi_SetPlayerType(pchar);
       SetNextWeather("Blue Sky");
       pchar.quest.before_first_marooning.win_condition.l1 = "MapEnter";
       pchar.quest.before_first_marooning.win_condition = "before_first_marooning";
     break;

     case "before_first_marooning":
       Locations[FindLocation("Oxbay_lighthouse")].reload.l4.disable = false;
       Locations[FindLocation("Oxbay_lighthouse")].reload.l3.disable = false;
       SetNextWeather("Blue Sky");
       RemoveCharacterEquip(pchar, BLADE_ITEM_TYPE);
       RemoveCharacterEquip(pchar, GUN_ITEM_TYPE);
       EnableEquip(pchar, BLADE_ITEM_TYPE, false);
       EnableEquip(pchar, GUN_ITEM_TYPE, false);
       EquipCharacterByItem(pchar, "bladeX4");

       //--> CTM (Fix for Barbossa and Ragetti/Pintel turning up when landing on Isla with Interceptor)
       RemovePassenger(Pchar, characterFromID("Barbossa"));

       if (GetAttribute(pchar,"Rag")=="1"){
         RemovePassenger(Pchar, characterFromID("Ragetti"));
       }
       // CTM <--

       pchar.Bosun = "cursed";
       if(IsPassenger(characterFromID("Bos'un")) || IsOfficer(characterFromID("Bos'un")))
       {
         Characters[GetCharacterIndex("Bos'un")].name = "Nigel";
         Characters[GetCharacterIndex("Bos'un")].lastname = "the Slave";
         Characters[GetCharacterIndex("Bos'un")].model = "Ancient";
         Characters[GetCharacterIndex("Bos'un")].headmodel = "h_Ancient";
       }
       //StorePassengers("Blaze");
       StorePassengers(Pchar.id);
       pchar.tempmoney = pchar.money;
       pchar.money = 100;

       DoQuestReloadToLocation("ShipDeck7", "goto", "goto7", "talk_before_first_marooning");
     break;

     case "talk_before_first_marooning":
       if(GetOfficersIndex(Pchar, 3) != -1)
       {
         iPassenger = GetOfficersIndex(Pchar, 3);
         LAi_SetActorType(&characters[iPassenger]);
         ChangeCharacterAddress(&characters[iPassenger], "none", "");
       }
       if(GetAttribute(pchar,"Rag")=="1")
       {
         ChangeCharacterAddressGroup(CharacterFromID("Ragetti"), "ShipDeck7", "rld", "wheel");
         ChangeCharacterAddressGroup(CharacterFromID("Pintel"), "ShipDeck7", "goto", "goto8");
         //-->CTM (adds Ragetti and Pintel on deck when Barbossa is being a B@$T@RD
         LAi_SetActorType(characterFromID("Ragetti"));
         LAi_ActorWaitDialog(pchar, characterFromID("Ragetti"));
         LAi_SetActorType(characterFromID("Pintel"));
         LAi_ActorWaitDialog(pchar, characterFromID("Pintel"));
         //<--CTM
       }
       ChangeCharacterAddressGroup(CharacterFromID("Barbossa"), "ShipDeck7", "goto", "goto14");
       pchar.quest.Beckett = "Barbossa_enacts_Mutiny";
       characters[GetCharacterIndex("Barbossa")].Dialog.Filename = "Barbossa_dialog.c";
       LAi_SetActorType(characterFromID("Barbossa"));
       Characters[GetCharacterIndex("Barbossa")].dialog.CurrentNode = "first time";
       LAi_ActorDialog(characterFromID("Barbossa"), pchar, "", 10.0, 10.0);
     break;

     case "Barbossa_leaves_for_now":
       if(GetOfficersIndex(Pchar, 1) > 0)
       {
         Pchar.Temp.Officer.idx1 = getOfficersIndex(Pchar, 1);
         Pchar.Temp.Officer.idx1.Dialog = Characters[getOfficersIndex(Pchar, 1)].Dialog.Filename;
         Pchar.Temp.Officer.idx1.CurrentNode = Characters[getOfficersIndex(Pchar, 1)].Dialog.CurrentNode;
       }
       else
       {
         Pchar.Temp.Officer.idx1 = -1;
       }
       if(GetOfficersIndex(Pchar, 2) > 0)
       {
         Pchar.Temp.Officer.idx2 = getOfficersIndex(Pchar, 2);
         Pchar.Temp.Officer.idx2.Dialog = Characters[getOfficersIndex(Pchar, 2)].Dialog.Filename;
         Pchar.Temp.Officer.idx2.CurrentNode = Characters[getOfficersIndex(Pchar, 2)].Dialog.CurrentNode;
       }
       else
       {
         Pchar.Temp.Officer.idx2 = -1;
       }
       if(GetOfficersIndex(Pchar, 3) > 0)
       {
         Pchar.Temp.Officer.idx3 = getOfficersIndex(Pchar, 3);
         Pchar.Temp.Officer.idx3.Dialog = Characters[getOfficersIndex(Pchar, 3)].Dialog.Filename;
         Pchar.Temp.Officer.idx3.CurrentNode = Characters[getOfficersIndex(Pchar, 3)].Dialog.CurrentNode;
       }
       else
       {
         Pchar.Temp.Officer.idx3 = -1;
       }
       if (GetCompanionIndex(pchar,1) > 0)
       {
         Pchar.Temp.Companion.idx1 = GetCompanionIndex(pchar,1);
         iPassenger = GetCompanionIndex(pchar,1);
         RemoveCharacterCompanion(Pchar, &Characters[iPassenger]);
       }
       else
       {
         Pchar.Temp.Companion.idx1 = -1;
       }
       if (GetCompanionIndex(pchar,2) > 0)
       {
         Pchar.Temp.Companion.idx2 = GetCompanionIndex(pchar,2);
         iPassenger = GetCompanionIndex(pchar,2);
         RemoveCharacterCompanion(Pchar, &Characters[iPassenger]);
       }
       else
       {
         Pchar.Temp.Companion.idx2 = -1;
       }
       if (GetCompanionIndex(pchar,3) > 0)
       {
         Pchar.Temp.Companion.idx3 = GetCompanionIndex(pchar,3);
         iPassenger = GetCompanionIndex(pchar,3);
         RemoveCharacterCompanion(Pchar, &Characters[iPassenger]);
       }
       else
       {
         Pchar.Temp.Companion.idx3 = -1;
       }
       TakeItemFromCharacter(Pchar,"aztec_compass");
       pchar.money = 100;
       //AddQuestRecord("Hector Barbossa",4);
       if (GetAttribute(pchar, "stolen") != "1")
       {
         SetQuestHeader("Stolen");
         pchar.stolen = "1";
       }
       AddQuestRecord("Stolen",2);
       SetCurrentTime(10, 0);
       if(AUTO_SKILL_SYSTEM)
       {
         AddPartyExpChar(pchar, "Leadership", 500);
         AddPartyExpChar(pchar, "Sneak", 50);
       }
       else { AddPartyExp(pchar, 500); }
       // PB -->
       // KK -->
       if (PreprocessText("#scursed_ship#") == "Black Pearl")
         GiveShip2Character(CharacterFromID("Barbossa"),"UncursedPearl",PreprocessText("#scursed_ship#"),-1,PIRATE,TRUE,TRUE);
       else
       {
         GiveShip2Character(CharacterFromID("Barbossa"),"CrimsonBlood", PreprocessText("#scursed_ship#"),-1,PIRATE,TRUE,TRUE);
       // <-- KK
         characters[GetCharacterIndex("Barbossa")].Ship.EmblemedSails.normalTex = "sail_Petros_black_red.tga"; // PB
         characters[GetCharacterIndex("Barbossa")].Ship.EmblemedSails.nationFileName = "sail_Petros_black_red.tga"; // PB
       }
       characters[GetCharacterIndex("Barbossa")].Flags.Pirate = 0; // PB: Jack Rackham Pirate Flag
       characters[GetCharacterIndex("Barbossa")].Flags.Pirate.texture = 0;
       setCharacterShipLocation(characterFromID("Barbossa"), "Deserted_Island_shore_01");
       characters[GetCharacterIndex("Barbossa")].sailaway = true;
       // PB <--
       DoQuestReloadToLocation("Deserted_Island_shore_01", "officers", "reload1_3", "Barbossa_leaves_for_now2");
       LAi_SetPlayerType(pchar);
       locations[FindLocation("Deserted_island_Jungle_01")].vcskip = true;
     break;

     case "Barbossa_leaves_for_now2":
       RestorePassengers(Pchar.id);
       //StorePassengers("Blaze");
       if(GetOfficersIndex(Pchar, 3) != -1)
       {
         iPassenger = GetOfficersIndex(Pchar, 3);
         LAi_SetActorType(&characters[iPassenger]);
         ChangeCharacterAddress(&characters[iPassenger], "none", "");
       }
       DeleteAttribute(characterFromID("Barbossa"), "sailaway"); // PB: Reset - just in case

       Pchar.quest.get_the_Tartane.win_condition.l1 = "location";
       Pchar.quest.get_the_Tartane.win_condition.l1.location = "Deserted_Island_Jungle_01";
       PChar.quest.get_the_Tartane.win_condition = "get_a_ride_with_smugglers";
     break;

     case "get_a_ride_with_smugglers":
       GiveShip2Character(pchar,"Barque4_47","Free at Last",-1,PIRATE,true,true);
       SetCharacterShipLocation(Pchar, "Deserted_Island_shore_02");
       EquipCharacterByItem(pchar, "bladeX4");
       ChangeCharacterAddress(characterFromID("Barbossa"), "None", "");
       RemovePassenger(Pchar, characterFromID("Barbossa"));

       pchar.quest.gets_off_marooned_island2.win_condition.l1 = "location";
       pchar.quest.gets_off_marooned_island2.win_condition.l1.location = "Deserted_Island_Jungle_01";
       pchar.quest.gets_off_marooned_island2.win_condition = "gets_off_marooned_island2";
     break;

     case "gets_off_marooned_island2":
       if(AUTO_SKILL_SYSTEM)
       {
         AddPartyExpChar(pchar, "Leadership", 5000);
         AddPartyExpChar(pchar, "Sneak", 50);
       }
       else { AddPartyExp(pchar, 5000); }
       ChangeCharacterAddressGroup(characterFromID("quest_smuggler_01"), "Deserted_Island_shore_02", "goto", "locator14");
       ChangeCharacterAddressGroup(characterFromID("Treas_Pirate_1"), "Deserted_Island_shore_02", "goto", "citizen04");
       LAi_SetActorType(characterFromID("quest_smuggler_01"));
       LAi_SetActorType(characterFromID("Treas_Pirate_1"));
       SetCrewQuantity(pchar, 3)
       AddCharacterGoods(pchar, GOOD_WHEAT, 2);
       AddCharacterGoods(pchar, GOOD_RUM, 40);
       HoistFlag(PIRATE);

       pchar.quest.Chatter_to_smuggler.win_condition.l1 = "location";
       pchar.quest.Chatter_to_smuggler.win_condition.l1.location = "Deserted_Island_shore_02";
       pchar.quest.Chatter_to_smuggler.win_condition = "Chatter_to_smuggler";
     break;

     case "Chatter_to_smuggler":
       pchar.quest.Smuggler = "With_Smugglers_To_Tortuga";
       bQuestDisableMapEnter = false;
       LAi_ActorTurnToCharacter(characterFromID("Treas_Pirate_1"), pchar);
      
       LAi_QuestDelay("Chatter_to_smuggler2", 5.0); //5.0);
     break;

     case "Chatter_to_smuggler2":
       pchar.quest.Smuggler = "With_Smugglers_To_Tortuga";
       LAi_SetActorType(characterFromID("quest_smuggler_01"));
       LAi_ActorDialog(characterFromID("quest_smuggler_01"),PChar,"",10.0,1.0);
       characters[GetCharacterIndex("quest_smuggler_01")].Dialog.Filename = "Port Guard_dialog.c";
       Characters[GetCharacterIndex("quest_smuggler_01")].dialog.currentnode = "Smuggler Talk";

       worldMap.playerShipX = -527; //stf(worldMap.islands.Turks.position.rx) + 19.;
       worldMap.playerShipZ = -540; //stf(worldMap.islands.Turks.position.rz) + 18.;
       worldMap.playerShipAY = 3.0;
       worldMap.playerShipActionRadius = 20.0;
       worldMap.playerShipDispX = stf(worldMap.playerShipX)- stf(worldMap.islands.Turks.position.rx);
       worldMap.playerShipDispZ = stf(worldMap.playerShipZ)- stf(worldMap.islands.Turks.position.rz);
       SetNextWeather("Blue Sky");
       pchar.quest.position_smuggler_ship.win_condition.l1 = "MapEnter";
       pchar.quest.position_smuggler_ship.win_condition = "position_smuggler_ship";
     break;

     case "position_smuggler_ship":
       AddPassenger(Pchar, characterFromID("quest_smuggler_01"), 0);
       SetOfficersIndex(Pchar, 1, getCharacterIndex("quest_smuggler_01"));

       pchar.quest.Tortuga_Get_ready_for_Film.win_condition.l1 = "location";
       pchar.quest.Tortuga_Get_ready_for_Film.win_condition.l1.location = "Tortuga_port";
       pchar.quest.Tortuga_Get_ready_for_Film.win_condition = "Tortuga_Get_ready_for_Film";
     break;


Sorry it is so long
:drunk
 
first one is before I went to the cavern where the treasure is located. In that savegame, I managed to open the chest and take the coins three times without Barbossa suggesting me that we are being followed (which triggers the mutiny on the ship and opens the part where Barbossa robs Jack Sparrow and takes his ship). Fourth time, I walked through the shore a bit waiting for something to happen, and yes, he suddenly approached and started speaking about the treasure, and after that when we entered the cavern, he said that we are being followed.
I have added the "larger locator" trick into the Brock branch of the storyline as well; I did this before for the Mings version.
However, it seems your savegame isn't actually before that scene, so I cannot test how it plays out.

Do you still have one from that point? If not, I'll consider this "Fixed" anyway.
 
I have added the "larger locator" trick into the Brock branch of the storyline as well; I did this before for the Mings version.
However, it seems your savegame isn't actually before that scene, so I cannot test how it plays out.

Do you still have one from that point? If not, I'll consider this "Fixed" anyway.

I have reinstalled PoTC and I've lost all my savegames (but I dont think they would be compatible either). You can consider it fixed.
 
I have reinstalled PoTC and I've lost all my savegames (but I dont think they would be compatible either).
Not 100% compatible, perhaps. But they were compatible enough for me to test from yesterday because that's what I was doing. ;)

Anyway, "Fixed" it is. :cheers
 
Back
Top