• 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!

Solved Need help on how to do this on other ships

PyroAtlas

Landlubber
It would really help if you guys could show me how to get the "Summon Kraken" and "Submerge/Emerge" abbilities from the flying dutchman into other ships. One of the reasons I want this and not just use the dutchman is because it annoys me how the dutchman has no visible crew and I always like seeing the crew as they do everything as I sail. I've tried doing this by myself but I couldn't find anything giving the dutchman such abbilites on the ship files in the game files. Thanks in advance! :)
 
I can't remember for certain which files control this (even though I added both features myself).
It's either BattleInterface.c or AIShip.c .
If you can't figure it out, let us know here; I can't look anything up today, but tomorrow or the day after I probably could.
 
I think I've found it on BattleInterface.c, would I just add what it says to another ship under it. For example:
Code:
// PB: Black Pearl -->
        case "BI_SubmergeDutchman":
            BI_retComValue = 0;
        break;
        case "BI_KrakenAttack":
            BI_retComValue = BI_COMMODE_ENEMY_SHIP_SELECT + BI_COMMODE_ALLLOCATOR_SELECT;
            BattleInterface.Commands.KrakenAttack.EffectRadius    = 1.5*MIN_ENEMY_DISTANCE_TO_DISABLE_MAP_ENTER;
        break;
// PB: Black Pearl <--

Edit: Also how would it know which variant of the ship it is, given that some ships such as the Black Pearl have different variants but only the cursed one has the sweeps.

Edit 2: After looking more through the BattleInterface.c I've found a lot more on it as it seems I'd have to add a lot of stuff to make it work.
 
Last edited:
Managed to get Submerging/Emerging to work after taking a few hours break. Its pretty easy to do so, all you have to do is copy and paste everything under the Dutchman under whichever ship you want (In my case the black pearl). But when you reach this:
Code:
BattleInterface.Commands.SubmergeDutchman.enable    = GetAttribute(mainCh, "ship.type") == "CursedDutchman";
You have to change "CursedDutchman" to the name of whichever ship you want. Still trying to find out the Kraken due to it not being under any ship.

Edit: Got the Summon Kraken to work just change the line above the aforementioned one to this
Code:
BattleInterface.Commands.KrakenAttack.enable        = KrakenAttackEnabled(mainCh, "ship.type") == "BlackPearl";
Or whichever ship you chose, now I'm not sure if this makes the Dutchman not be able to submerge/summon the kraken but if whoever's reading this is in the same situation as me it won't matter.
Thanks for the help Pieter!
 
Last edited:
You're welcome. :doff

There might also still be some relevant code in NK.c .
 
After adding the kraken abbility I've now noticed that the ship can't use any other (submerge, neptune's trident, blade of triton, etc.)
Any idea how I could fix this? I tried removing the kraken code to see what it would do and it changed the ship's abbilities to the commands given to other ships in your fleet, same thing happened by removing both and only submerge/emerge. I'm totally clueless on how to fix this.
 
PROGRAM\BATTLE_INTERFACE\BattleInterface.c:
Code:
        BattleInterface.Commands.KrakenAttack.enable        = KrakenAttackEnabled();                                            // PB: Kraken Attack
        BattleInterface.Commands.SubmergeDutchman.enable    = GetAttribute(mainCh, "ship.type") == "CursedDutchman";            // PB: Flying Dutchman
        BattleInterface.Commands.PearlSweeps.enable            = BPSweepsEnabled();                                                // PB: Black Pearl
        BattleInterface.Commands.QARSword.enable            = QARSwordEnabled();                                                // PB: Queen Anne's Revenge
        BattleInterface.Commands.TritonAttack.enable        = QARSwordEnabled();                                                // C92: Sword of Triton Attack
        BattleInterface.Commands.NeptuneTrident.enable        = CheckCharacterItem(mainCh, "Trident_Neptune");                    // TJ&PB: Neptune's Trident
Replace with:
Code:
        BattleInterface.Commands.KrakenAttack.enable        = KrakenAttackEnabled();                                            // PB: Kraken Attack
        BattleInterface.Commands.SubmergeDutchman.enable    = true;            // PB: Flying Dutchman
        BattleInterface.Commands.PearlSweeps.enable            = BPSweepsEnabled();                                                // PB: Black Pearl
        BattleInterface.Commands.QARSword.enable            = QARSwordEnabled();                                                // PB: Queen Anne's Revenge
        BattleInterface.Commands.TritonAttack.enable        = QARSwordEnabled();                                                // C92: Sword of Triton Attack
        BattleInterface.Commands.NeptuneTrident.enable        = CheckCharacterItem(mainCh, "Trident_Neptune");                    // TJ&PB: Neptune's Trident

PROGRAM\NK.c find:
Code:
bool KrakenAttackEnabled()
{
    ref pchar = GetMainCharacter();
    ref ch;
    if(CheckAttribute(pchar, "KrakenAttack"))                        return false;    // No Kraken attack is available until a set time after the previous attack
    if(CheckAttribute(pchar, "ship.SubmergeDutchman"))                return false;    // No Kraken attack is available while the Dutchman is submerged
    for (int i = 0; i <= GetCompanionQuantity(PChar); i++) {
        ch = GetCharacter(GetCompanionIndex(pchar, sti(i)));
        if(GetAttribute(ch, "ship.type") == "CursedDutchman")        return true;    // Only the CURSED Flying Dutchman can call upon the Kraken
    }
    return false;
}
Replace with:
Code:
bool KrakenAttackEnabled()
{
    ref pchar = GetMainCharacter();
    ref ch;
    if(CheckAttribute(pchar, "KrakenAttack"))                        return false;    // No Kraken attack is available until a set time after the previous attack
    if(CheckAttribute(pchar, "ship.SubmergeDutchman"))                return false;    // No Kraken attack is available while the Dutchman is submerged
    return true;
}

PROGRAM\NK.c find:
Code:
bool BPSweepsEnabled()
{
    ref pchar = GetMainCharacter();
    if(sti(GetAttribute(pchar, "ship.type")) != SHIP_CURSED)        return false;    // Only the Cursed Black Pearl can use the sweeps
    if(CheckAttribute(pchar, "ship.speedburst"))                    return false;    // Sweeps cannot be used for a certain period of time
    return true;
}
Replace with:
Code:
bool BPSweepsEnabled()
{
    ref pchar = GetMainCharacter();
    if(CheckAttribute(pchar, "ship.speedburst"))                    return false;    // Sweeps cannot be used for a certain period of time
    return true;
}

PROGRAM\SEA_AI\AIShip.c find:
Code:
if(HasSubStr(GetAttribute(rCharacter, "ship.type"), "Dutchman") && CheckAttribute(arCharShip, "SubmergeDutchman"))    // Submerging Ability
Replace with:
Code:
if(CheckAttribute(arCharShip, "SubmergeDutchman"))    // Submerging Ability

I haven't tested it, but I *think* that should unlock those special abilities for any player ship.
 
No worries, mate.
I had the advantage because I already knew what to look for. ;)
 
Back
Top