1. Dismiss Notice
  2. GOG.com logo

    Thanks to YOUR votes, GOG.com now sells:
    - Sea Dogs - Sea Dogs: Caribbean Tales
    - Sea Dogs: City of Abandoned Ships

    Vote now to add Pirates of the Caribbean to the list!

    Dismiss Notice
  3. Under the Crossbones Podcast

    A Pirate Podcast with Interviews
    Music, Comedy and all things Pirate!

    - Episode Guide - About - Subscribe -
    - Twitter - Facebook - iTunes - Android -
    - Youtube - Fill the Coffers -

    Dismiss Notice
  4. New Horizons logo

    Quick links for PotC: New Horizons
    - Download latest version
    - Wiki - FAQ - Report bugs here
    - ModDB profile

  5. GOF logo

    Quick links for AoP2: Gentlemen of Fortune 2
    - Downloads and info
    - Historical Immersion Supermod
    - ModDB Profile

Dismiss Notice
New to the forum?
Please take a moment to read our Welcome Message and Forum Rules.

Solved Dutchman Quest Revisions (Test Game Download Included)

Discussion in 'Sea Dogs: Caribbean Tales' started by Modder01, Oct 11, 2017.

  1. Modder01

    Modder01 Freebooter Storm Modder

    Joined:
    Feb 1, 2014
    Messages:
    294
    Gender:
    Male
    Location:
    Oxford, Michigan, USA
    Logbook now updates for dutchman death without commander killed by aboardage, however it does not re-spawn... Also the quest updates that logbook entry twice... Still testing for the win condition...
    EDIT:
    Win works perfectly....
     
    Last edited: Oct 25, 2017
  2. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    221
    Try changing condition for !=KILL_BY_ABORDAGE to this:

    Pchar.quest.dutchman_Respawn.win_condition.l1 = "ExitFromSea");
    PChar.quest.dutchman_Respawn.win_condition = "spawn_dutchman";

    That won't do exactly what you wanted...to leave Grenada. But as soon as you exit sea, it should recall the spawn_dutchman case and you can check the log to verify.
     
  3. Modder01

    Modder01 Freebooter Storm Modder

    Joined:
    Feb 1, 2014
    Messages:
    294
    Gender:
    Male
    Location:
    Oxford, Michigan, USA
    The Dutchman, in that previous test, was killed by a storm that I spawned into while avoiding pirates... I also want to hear the possibility of correcting the island spawn locators around Grenada. It appears that despite my best efforts, the quest still occasionally wants to spawn the Dutchman on a invalid locator around Grenada. Also I would like to add that when the Dutchman is spawned, he is spawned with some of his health missing due to colliding somehow with the island before encountering me....
     
  4. Modder01

    Modder01 Freebooter Storm Modder

    Joined:
    Feb 1, 2014
    Messages:
    294
    Gender:
    Male
    Location:
    Oxford, Michigan, USA
    I did the test again and sunk it with a war galleon I stole from the pirates, however the ship didn't respawn....
     
  5. Modder01

    Modder01 Freebooter Storm Modder

    Joined:
    Feb 1, 2014
    Messages:
    294
    Gender:
    Male
    Location:
    Oxford, Michigan, USA
    Logs:
     

    Attached Files:

  6. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    221
    Good news. Even without your save, I constructed some console.c code to replicate the one part not yet working and this will probably do it:

    First, there are a couple bugs in the original CT CharacterUtilite.c. Change these two functions:

    Code:
    int GetCharacterCurrentIsland(ref _refCharacter)
    {
        //#20171026-01 Bug fix
        int curLocNum = FindLocation(_refCharacter.location);
        if(curLocNum<0) return -1;
        return GetIslandIdxByLocationIdx(curLocNum);
    }
    
    int GetIslandIdxByLocationIdx(int locIdx)
    {
        aref rootar,ar;
        makearef(rootar,Locations[0].IslandsList);
        for(int i=0; i<GetAttributesNum(rootar); i++)
        {
            ar = GetAttributeN(rootar,i);
            //#20171026-01 Bug fix Begin of next island locators is same as end of previous
            if( locIdx>=sti(ar.begin) && locIdx<sti(ar.end) )
            {
                return FindIsland(GetAttributeName(ar));
            }
        }
        return -1;
    }
    In quests_check.c, I developed a way to get your desired feature to indicate that you left the island. Find function bool ProcessCondition(aref condition), scroll toward the end and insert, immediately after the case "ActIntoLocator": break; statement:

    Code:
        case "ActIntoLocator":
        .
        .
        .
        break;
        //#20171026-02 Add ExitIsland quest condition
        case "ExitIsland":
            if(CheckAttribute(worldMap, "isLoaded") && worldMap.isLoaded == "true")
            {
                if(worldMap.island != condition.island)
                    return true;
                else
                    return false;
            }
            if(bSeaActive)
            {
                if(CheckAttribute(AISea, "island") && AISea.Island != condition.island)
                    return true;
                else
                    return false;
            }
            int myIslandIdx = GetCharacterCurrentIsland(refCharacter);
            if(myIslandIdx > -1) {
                 string myisland = Islands[myIslandIdx].id;
                 if(myisland != condition.island)
                    return true;
            }
            return false;
        break;
    Last, change dutch_encounter.c:

    Code:
                case "dutchman_KillJones":
               //Kill Jones by function
               chr = GetCharacter(GetCharacterIndex("Davy Jones"));
               if( CheckAttribute(chr,"Killer.status") && sti(chr.Killer.status)==KILL_BY_ABORDAGE )
               {
                    SetQuestHeader("Dutchman");
                    AddQuestRecord("Dutchman", "3_captured");
                    trace("*** Davy Jones Killed by Abordage");
                    DoQuestCheckDelay("dutchman_dead", 2.0);
                }
                else
                {
                    trace("Flying Dutchman Killed by Cannonfire");
                    SetQuestHeader("Dutchman");
                    AddQuestRecord("Dutchman", "2_failed");
                    LAi_group_Delete("FlyingDutchman"); //Sea group
                    Pchar.quest.spawn_dutchman.win_condition.l1 = "ExitIsland");
                    Pchar.quest.spawn_dutchman.win_condition.l1.island = "Guadeloupe");
                    PChar.quest.spawn_dutchman.win_condition = "spawn_dutchman";
                }
           break;
     
  7. Modder01

    Modder01 Freebooter Storm Modder

    Joined:
    Feb 1, 2014
    Messages:
    294
    Gender:
    Male
    Location:
    Oxford, Michigan, USA
    Why Guadeloupe?
     
  8. Modder01

    Modder01 Freebooter Storm Modder

    Joined:
    Feb 1, 2014
    Messages:
    294
    Gender:
    Male
    Location:
    Oxford, Michigan, USA
    I tested it and the game crashes when the Dutchman sinks.... I tested twice... Interesting thing is that the first run had an error log while the second run didn't... Logs of 2nd run:
     

    Attached Files:

  9. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    221
    The crash looks to be a completely unrelated problem, not the scenario we are resolving. The crash is in system.log: Assert failed in AIShipCannonController.cpp line 870, expression string pADamages

    But look at your compile.log...the change worked for respawn.

    Midway in the file, is the first instance:

    *** Davy Jones login successful
    returning qChar = 317

    His respawn at the end:

    NPC_Death Davy Jones
    Flying Dutchman Killed by Cannonfire
    Quest ADDED
    Davy exist = 317
    *** Davy Jones login successful
    returning qChar = 317
     
  10. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    221
    Because that is the .id of the island. See Islands_init.c:

    Islands[n].id = "Guadeloupe";
     
  11. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    221
    I think the problem for the crash is use of SetBaseShipData. It removes the .damages attribute. On first char/ship init, it's probably fine because that attribute gets created by the engine on ship initialization. But, for re-use of the same char/ship, calling SetBaseShipData removes .damages, doesn't re-init the ship in the engine and causes the problem. Gonna have to figure a way around that.
     
  12. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    221
    Let's abandon SetBaseShipData in the dutchman. Add these to CharacterUtilite.c:

    Code:
    //Borrow COAS
    void PGG_UpdateShipEquip(ref chr)
    {
    
        if (sti(chr.Ship.Type) == SHIP_NOTUSED) return;
    
        ref refTown, chref;
        string curTown;
    
        ProcessHullRepair(chr, 100.0);
        ProcessSailRepair(chr, 100.0);
        SetCrewQuantityFull(chr);
        Fantom_SetCannons(chr, "pirate");
        Fantom_SetBalls(chr, "pirate");
        Fantom_SetGoods(chr, "pirate");
    }
    //Borrow COAS
    void SetCrewQuantityFull(ref _refCharacter)
    {
        SetCrewQuantity(_refCharacter, GetMaxCrewQuantity(_refCharacter));
    }
    Change call in SpawnDutchman():
    Code:
         else { //Reset ship attributes (restock HP, ammo, etc.)
            PGG_UpdateShipEquip(GetCharacter(qChar));
        }
     
  13. Modder01

    Modder01 Freebooter Storm Modder

    Joined:
    Feb 1, 2014
    Messages:
    294
    Gender:
    Male
    Location:
    Oxford, Michigan, USA
    The Dutchman Still doesn't re-spawn... At least the game doesn't crash anymore... (After sinking I returned to the worldmap then sailed around a bit then came back to grenada)... Logs:
     

    Attached Files:

  14. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    221
    I think I'm going to need that save and sink it myself. Your log is showing:

    Flying Dutchman Killed by Cannonfire
    Quest ADDED
    *** Davy Jones login successful

    That is way too quick...you should have to leave first for the ExitIsland to initiate the Davy Jones rebirth, but it's immediately recognized as true. When I do this in my console.c replica, it works, but when run through the NPC_Death scenario, it's firing immediately.
     
  15. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    221
    OK, no need for the save, I just adjusted the ship hp to 10 so I'd sink it with one hit. I figured out both why your double log post and no respawn; NPC_Death is finding your respawned char immediately and noting it is still dead (due to zero chr_ai.hp) so it repeats that part of the process for the log and also doesn't ever show up because the char is dead. In SpawnDutchman:

    Code:
    else { //Reset ship attributes (restock HP, ammo, etc.)
            PGG_UpdateShipEquip(GetCharacter(qChar));
            LAi_SetCurHPMax(GetCharacter(qChar));
        }
    Of course I'm also dumb...I finally understand your questioning now about Guadeloupe...yes, change that to Grenada. I was testing where my character already was, Guadeloupe and got it to work with the HP fix above, but obviously you wanted everything in Grenada but I failed to put that fact together when you asked about it before, LOL:

    Code:
                    Pchar.quest.spawn_dutchman.win_condition.l1 = "ExitIsland");
                    Pchar.quest.spawn_dutchman.win_condition.l1.island = "Grenada");
                    PChar.quest.spawn_dutchman.win_condition = "spawn_dutchman";
     
    Last edited: Oct 27, 2017
  16. Modder01

    Modder01 Freebooter Storm Modder

    Joined:
    Feb 1, 2014
    Messages:
    294
    Gender:
    Male
    Location:
    Oxford, Michigan, USA
    Updated version with latest edits (excluding your latest fixes - will manually update it when I get home tomorrow from my dorm):
    CTSupermod.zip

    In the meantime, I will test those edits with the school client.
     
  17. Modder01

    Modder01 Freebooter Storm Modder

    Joined:
    Feb 1, 2014
    Messages:
    294
    Gender:
    Male
    Location:
    Oxford, Michigan, USA
    The Dutchman finally re-spawns, however the cannons on the ship post re-spawn are not correct. 48 pdr demi-cannons are supposed to be the dutchman's cannons...
     
  18. Modder01

    Modder01 Freebooter Storm Modder

    Joined:
    Feb 1, 2014
    Messages:
    294
    Gender:
    Male
    Location:
    Oxford, Michigan, USA
    Logs from latest run:
     

    Attached Files:

  19. ChezJfrey

    ChezJfrey Master Mariner Storm Modder

    Joined:
    Apr 24, 2015
    Messages:
    221
    I'm guessing that call to update the ship equipment (replenish cannon balls, etc.), might quash the cannon override you had in the initial char setup. Just copy that characters[qChar].Ship.Cannons.Type = CANNON_TYPE_CANNON_LBS48; line into the else block, after the ShipEquip call.
     
  20. Modder01

    Modder01 Freebooter Storm Modder

    Joined:
    Feb 1, 2014
    Messages:
    294
    Gender:
    Male
    Location:
    Oxford, Michigan, USA
    That works and the respawned captain even shoots at me this time.... The Topic is now resolved and now we can iron out some of the bugs that occur in the game.
     
    DeathDaisy likes this.

Share This Page