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

Need Help Hoist the colors (For the 125431th time)

Shouldn't it be // before default: ?

It checks for Shipdeck6 or shipdeck7, which i have specific locators set for already, if it's not equal to those we use a sandart set of locators, here is the whole code.

Default is used if operator doesn't match any case constant.


C:
//check deck sring from bigger to smaller decks
        case "tp_deck_after_prison_deck_check":
            switch(GetCharacterShipQDeck(pchar))
            {
                case "ShipDeck7":
                    LAi_QuestDelay("tp_deck_after_prison6and7", 0.0);;
                break;

                case "ShipDeck6":
                    LAi_QuestDelay("tp_deck_after_prison6and7", 0.0);
                break;

                default:
                LAi_QuestDelay("load_deck_turks_other", 0.0);
            }
        break;
       
        //Dialogue on ships deck with the crew
        //Used for deck6 and deck7 pearl and similar ships
        case "tp_deck_after_prison6and7":  
            ChangeCharacterAddressGroup(CharacterFromID("Annamaria"),GetCharacterShipQDeck(pchar),"goto","goto20");
            ChangeCharacterAddressGroup(CharacterFromID("Pirates_5"),GetCharacterShipQDeck(pchar),"goto","goto11");
            ChangeCharacterAddressGroup(CharacterFromID("Pirates_6"),GetCharacterShipQDeck(pchar),"goto","goto21");  
            ChangeCharacterAddressGroup(CharacterFromID("Mr. Gibbs"),GetCharacterShipQDeck(pchar),"goto","goto2");
            DoQuestReloadToLocation(GetCharacterShipQDeck(pchar), "goto", "goto27", "dialogue_start_deck_turks6and7");
            //LAi_QuestDelay("dialogue_start_deck_turks", 1.0);
        break;
       
        //To sea and now and set sail
        case "dialogue_start_deck_turks6and7":  
        LAi_SetActorType(CharacterFromID("Mr. Gibbs"));
        LAi_SetActorType(characterFromID("Annamaria"));
        LAi_ActorTurnToCharacter(characterFromID("Annamaria"), pchar);  
        LAi_ActorTurnToCharacter(characterFromID("Pirates_5"), pchar);
        LAi_ActorTurnToCharacter(characterFromID("Pirates_6"), pchar);
        LAi_ActorDialog(characterFromID("Mr. Gibbs"),PChar,"",1.0,1.0);  
        Characters[GetCharacterIndex("Mr. Gibbs")].dialog.currentnode = "talk_jack_ship_turks";
        break;
       
        //Dialogue on ships deck with the crew
        //Used for any other deck
        case "load_deck_turks_other":  
            DoQuestReloadToLocation(GetCharacterShipQDeck(pchar), "reload", "boatr", "dialogue_start_deck_turks_other");
        break;
       
        //Dialogue on ships deck with the crew
        //Used for other decks as scene should't requite anything really specific
        case "dialogue_start_deck_turks_other":  
        PlaceCharacter(characterFromID("Annamaria"), "goto");
        PlaceCharacter(characterFromID("Pirates_5"), "goto");
        PlaceCharacter(characterFromID("Pirates_6"), "goto");
        PlaceCharacter(characterFromID("Mr. Gibbs"), "goto");
       
        LAi_SetActorType(CharacterFromID("Mr. Gibbs"));
        LAi_SetActorType(characterFromID("Annamaria"));
        LAi_ActorTurnToCharacter(characterFromID("Annamaria"), pchar);  
        LAi_ActorTurnToCharacter(characterFromID("Pirates_5"), pchar);
        LAi_ActorTurnToCharacter(characterFromID("Pirates_6"), pchar);
        LAi_ActorDialog(characterFromID("Mr. Gibbs"),PChar,"",1.0,1.0);  
        Characters[GetCharacterIndex("Mr. Gibbs")].dialog.currentnode = "talk_jack_ship_turks";
        break;
 
Last edited:
I know but what I have seen in POTC and used myself is //default:

but //default will just comment out the default reaction, in that it will not do anything, so there is no fallback in case all of the cases above fail :confused:

Not the best practice unless you are 100% sure that at least one of the cases will go off.

In my case i'm not sure what deck the player might have, so i use it to run a quest reation for an "all purpose" situation with locators.
 
Last edited:
@Grey Roger i think this is the optimal code to decide if player's ship is a tartane or not, well it can be used for anything and should help me correctly assign the next quest cases to a ship!

C:
//All ships above rank 7 have crew qurters if(GetCharacterShipClass(chr)<=6) return "Seadogs"
        //Has all
        case "bootstrap_deck_check":     
        if(GetCharacterShipCabin(pchar)!="Cabin_none" && GetCharacterShipCargoHoldCount(pchar) > 1 && GetCharacterShipCQuarters(pchar)!="");
        LAi_QuestDelay("tp_deck_bootstrap_cabin_quarters_cargo", 0.0);
        //Has cabin and cargo but no crew quarters
        if(GetCharacterShipCabin(pchar)!="Cabin_none" && GetCharacterShipCargoHoldCount(pchar) > 1 && GetCharacterShipCQuarters(pchar) =="");
        LAi_QuestDelay("tp_deck_bootstrap_cabin_cargo", 0.0);
        //Has no cabin and cargo, most likely only has deck
        if (GetCharacterShipCabin(pchar)=="Cabin_none" && GetCharacterShipCargoHoldCount(pchar) < 1);
        LAi_QuestDelay("tp_deck_bootstrap_deck_only", 0.0);
        break;

I have not tested it yet but in theory should be quite bulletproof :D

EDIT: Scrap this, see later posts.
 
Last edited:
See quests_common.c line 3628.
Or Ardent quest_reaction.s line 2278.
 
Last edited:
See quests_common.c line 3628.
Or Ardent quest_reaction.s line 2278.

No idea to be honest, my assumption would be that default is just applied to anything outside of the cases, so you don't really need to specify it, but this is how i'm used to doing it :D
 
Last edited:
I have no problem with the default function. It works and I have used it. I'm just guessing
that the WORD default will mean a bug/crash.
 
@Grey Roger i think this is the optimal code to decide if player's ship is a tartane or not, well it can be used for anything and should help me correctly assign the next quest cases to a ship!

C:
//All ships above rank 7 have crew qurters if(GetCharacterShipClass(chr)<=6) return "Seadogs"
        //Has all
        case "bootstrap_deck_check":  
        if(GetCharacterShipCabin(pchar)!="Cabin_none" && GetCharacterShipCargoHoldCount(pchar) > 1 && GetCharacterShipCQuarters(pchar)!="");
        LAi_QuestDelay("tp_deck_bootstrap_cabin_quarters_cargo", 0.0);
        //Has cabin and cargo but no crew quarters
        if(GetCharacterShipCabin(pchar)!="Cabin_none" && GetCharacterShipCargoHoldCount(pchar) > 1 && GetCharacterShipCQuarters(pchar) =="");
        LAi_QuestDelay("tp_deck_bootstrap_cabin_cargo", 0.0);
        //Has no cabin and cargo, most likely only has deck
        if (GetCharacterShipCabin(pchar)=="Cabin_none" && GetCharacterShipCargoHoldCount(pchar) < 1);
        LAi_QuestDelay("tp_deck_bootstrap_deck_only", 0.0);
        break;

I have not tested it yet but in theory should be quite bulletproof :D

EDIT: Scrap this, see later posts.


So after getting to some testing i have a final working code for this problem:

C:
/All ships above rank 7 have crew qurters
        //Has all
        case "bootstrap_deck_check":        
        if(GetCharacterShipCabin(pchar)!="Cabin_none" && GetCharacterShipCargoHoldCount(pchar) >= 1 && GetCharacterShipCQuarters(pchar)!="")  {
            LAi_QuestDelay("tp_deck_bootstrap_cabin_quarters_cargo", 0.0);
        }
        //Else check for cargo and cabin
        else {
           LAi_QuestDelay("bootstrap_deck_check2", 0.0);
        }
        break;

        case "bootstrap_deck_check2":        
        //Has cabin and cargo but no crew quarters.
        if(GetCharacterShipCabin(pchar)!="Cabin_none" && GetCharacterShipCargoHoldCount(pchar) >= 1 && GetCharacterShipCQuarters(pchar) =="")  {
            LAi_QuestDelay("tp_deck_bootstrap_cabin_cargo", 0.0);
        }
        //Has no cabin OR cargo, most likely only has deck
        else {
           LAi_QuestDelay("tp_deck_bootstrap_deck_only", 0.0);
        }
        break;


Question: Sebrian, why is your code so stupid ? Answer: Because i'm stupid! and couldn't bother to figure else if statement inside of a switch case, which is the whole quest structure, so i just split it into two switch cases via quest delay.... is it the best way to do it ? Probably no... does it work tho ? Well yes, yes it does, as they say: "it ain't stupid if it works" :D

I have no problem with the default function. It works and I have used it. I'm just guessing
that the WORD default will mean a bug/crash.

I have not encountered any bugs or crashes using default either, maybe @Grey Roger has some more insight into why it's commented out.
 
Last edited:
First, I had no idea Default: worked.

Maybe the outcommenting started with switch cases like
// Default using generic soldier character
and continued for the
// default: cases
as well.
 
I have done most if not all of foolproofing, fixed some small dialogue bugs and other misc. stuff, i will update my first post soon with the new download. Adapting bootstrap's scene to all decks code has taken some time, but should be done today too ;)
 
No idea to be honest, my assumption would be that default is just applied to anything outside of the cases, so you don't really need to specify it, but this is how i'm used to doing it :D
That is correct. The comment "default" is just supposed to make this clear to anyone reading the code. So, in Ardent's "quests_reaction.c":
switch (GetCharacterShipCabin(PChar))
{
case "Cabin_none":
ChangeCharacterAddressGroup(romance, "Tutorial_Deck", "goto", "goto2");
break;
case "Tutorial_Deck":
ChangeCharacterAddressGroup(romance, "Tutorial_Deck", "goto", "goto2");
break;
// default
ChangeCharacterAddressGroup(romance, "Tutorial_Deck", "reload", "reload1");
}[/.code]That's an early attempt of mine to do something similar to what you're trying to do and will probably need to be rewritten. At that time I didn't have much of a clue about quest writing and was just copying anything I found that appeared to do what I was trying to do. Here I wanted to pick a suitable locator based on your cabin, so I copied it from the code in "PROGRAM\Storyline\standard\quests\both_reaction.c" which places Malcolm Hatcher in your cabin. It checks for a couple of specific cases, and if your cabin isn't either of them then it skips both the 'case' sections and drops through to the part inside the 'switch' but not in any 'case'. (I may adapt your code for Bootstrap Bill to replace it...)

You can put anything you like after "//". It's a comment and won't affect the running of the code. "// Wibble" is just as effective as "//Default". xD

is it the best way to do it ? Probably no... does it work tho ? Well yes, yes it does, as they say: "it ain't stupid if it works" :D
Exactly! A lot of code in the game, including some of mine, obeys this principle. In fact, there have been occasions when someone tried to change code just to make it look nicer, only the "nicer" version didn't work properly and created bugs.
 
Updated first post. New download link.

Done all the foolproofing i could imagine is needed, tried to break the quest in as many ways as i could, i bet there might be some ways still, but i couldn't find any myself. :)

1. I'm no longer using

C:
PChar.quest.KilledFighting.win_condition.l1 = "NPC_Death";
PChar.quest.KilledFighting.win_condition.l1.character = PChar.id;
PChar.quest.KilledFighting.win_condition = "KilledFighting";

As it did lead to some unneeded complications, pchar.quest.disable_rebirth = true; does the job just fine bug free.

2. And fixed up last few dialogue bugs and a few last typos.

I have not uploaded the next part of the quest yet, as i need to test it more, and it stops in a weird state right now.

3.I want to make it possibe for Tia Dalma to die or get killed by the player in the future, so quest fails and after some time kraken attacks player, but it's for the future, after DMC is finished. For now she is set to immortal.
 
Last edited:
Tia Dalma is a goddess. If there's one character in the entire game who is entitled to be permanently immortal, it's her!

Meanwhile, I've finished with the decks of the Flying Dutchman:
dutchman_cannon_deck.jpg dutchman_hold.jpg dutchman_crew_quarters.jpg

There's a pretty rug on the wall of one of the cabins in the normal crew quarters. It's not quite so pretty after it's been under the sea for a few decades:
dutchman_crew_quarters_wall.jpg

I'd also put a little surprise into one of the cabins, but unfortunately the door to the cabin is locked so you'll never see it. That is, unless you edit "InternalSettings.h" to allow sidestep. Then find your way to the crew quarters, use sidestep to get into the first cabin on the right, and see what the Flying Dutchman has for bedtime reading...

You can download the necessary files here:
https://piratesahoy.bowengames.com/potc/Grey Roger/FD_Deck.zip
 
Tia Dalma is a goddess. If there's one character in the entire game who is entitled to be permanently immortal, it's her!

Meanwhile, I've finished with the decks of the Flying Dutchman:
View attachment 40525 View attachment 40528 View attachment 40526

There's a pretty rug on the wall of one of the cabins in the normal crew quarters. It's not quite so pretty after it's been under the sea for a few decades:
View attachment 40527

I'd also put a little surprise into one of the cabins, but unfortunately the door to the cabin is locked so you'll never see it. That is, unless you edit "InternalSettings.h" to allow sidestep. Then find your way to the crew quarters, use sidestep to get into the first cabin on the right, and see what the Flying Dutchman has for bedtime reading...

You can download the necessary files here:
https://piratesahoy.bowengames.com/potc/Grey Roger/FD_Deck.zip

Tia Dalma is indeed a goddess, but she is imprisoned in a mortal body, so she is mortal for now, which is explained more in "At the world's end" ;)

Anyways, great work Roger! This looks awesome!

I see the textures are applied in a similar way to Black Pearl's decks, i use:

C:
Locations[FindLocation("Fake_Seadogs")].filespath.textures = "locations\decks\BlackPearl";//pearls texture path

To apply the textures if character has a black pearl for example, using Deck7 to confirm if it's the pearl.
 
Tia Dalma: whether to make her immortal is up to you, if you want the extra work of making things happen when she dies then go ahead. Otherwise it's perfectly acceptable for a quest character to be immortal precisely so that the quest can't break due to the character dying - other quests do it, even for characters with no supernatural background. ;)

Indeed, I saw how the decks of Black Pearl are textured and did the same for Flying Dutchman. So that command should work for "Fake_Seadogs" if you want the location to look like the Dutchman, except that, of course, you'd use "locations\decks\FlyingDutchman" instead.
 
Tia Dalma: whether to make her immortal is up to you, if you want the extra work of making things happen when she dies then go ahead.

I do intend to expand on the story and add side quests when it's finished, but i don't want to overpromise anything, all in due time.

Please try to test out my latest version when you have some free time, i think it's pretty much ready to go in for the next update, but it needs your input to decide what to change/fix.

Bootstrap's deck scene is almost finished, too bad the player will mostly just see few walking scenes and some dialogue, with gazillion lines of code "under the hood" to accomplish it all with any possible ship and deck/cabin, and now ill have to add a check for Dutchman's deck, as the player might as well try to do the whole story using it himself as you mentioned :D what was the qdeck's name for the Dutchman again ?
 
Last edited:
That zip file includes a new version of "Ships_init.c". That's where you'll find any ship's quarterdeck, e.g. for "CursedDutchman":
Code:
refShip.QDeck                = "ShipDeck2FDM";
The locators should be the same as the regular "ShipDeck2" as the locator file for "ShipDeck2FDM" is a straight copy of the one for "ShipDeck2". But the player can't do the whole story using the Flying Dutchman. This isn't FreePlay where you can choose your starting ship, the storyline locks your starting ship. You can't capture the Dutchman because it can't be boarded. So the only way the player can get it is by going to Isla de Muerte with a big purse of gold and buying it from Vanderdecken, and you don't get the Aztec compass which lets you go to Isla de Muerte until well into the story. The other problem with trying to do the whole story with the wrong ship is that the story replaces your ship several times. If you know what's about to happen then you can berth your ship and buy an expendable tartane, let the story replace that, then go and get your original ship. If you don't, you won't keep the Flying Dutchman for the whole story. (And if you do know the story inside out so that you know when to berth your ship, there's a far more amusing trick. No matter what your favourite ship is, there's definitely one thing better than the Black Pearl, and that's four Black Pearls. :g2)
 
That zip file includes a new version of "Ships_init.c". That's where you'll find any ship's quarterdeck, e.g. for "CursedDutchman":
Code:
refShip.QDeck                = "ShipDeck2FDM";
The locators should be the same as the regular "ShipDeck2" as the locator file for "ShipDeck2FDM" is a straight copy of the one for "ShipDeck2". But the player can't do the whole story using the Flying Dutchman. This isn't FreePlay where you can choose your starting ship, the storyline locks your starting ship. You can't capture the Dutchman because it can't be boarded. So the only way the player can get it is by going to Isla de Muerte with a big purse of gold and buying it from Vanderdecken, and you don't get the Aztec compass which lets you go to Isla de Muerte until well into the story. The other problem with trying to do the whole story with the wrong ship is that the story replaces your ship several times. If you know what's about to happen then you can berth your ship and buy an expendable tartane, let the story replace that, then go and get your original ship. If you don't, you won't keep the Flying Dutchman for the whole story. (And if you do know the story inside out so that you know when to berth your ship, there's a far more amusing trick. No matter what your favourite ship is, there's definitely one thing better than the Black Pearl, and that's four Black Pearls. :g2)

In this case it's realistic to say that player could have the Dutchman for this part of the story as before it i encourage the player to do some freeplay if he wants to, but it will get taken away soon after, if player will do what you desribed above he will have a fleet of pearls by the end of DMC :D
 
I don't know if it's applicable to what you have in mind, but there are a few places in other stories where you're supposed to have a particular type of ship and the story won't proceed unless you do. The first one I did was "Ardent", in which you con the governor of Willemstad into helping you steal a Heavy East Indiaman, allegedly in the name of the governor of Santiago. The governor of Santiago then has the idea to make a gift of this ship to the governor of Willemstad, so you need to have it - or any Heavy East Indiaman - when you talk to him. Later I added a check to "Tales of a Sea Hawk" to put a stop to people trying to keep the frigate which you have to take from Speightstown to Port Royale and hand over to Silehard. Have a look at "PROGRAM\Storyline\Ardent\DIALOGS\Javier Balboa_dialog.c", case "convoy_other_ships". Or at "PROGRAM\Storyline\standard\quests\quests_reaction.c", case "Story_BlazeWithRabelAndCounterspyReturn". Basically, check that the player has the right ship, or one of its repaintable variants, and if he doesn't, tell him to go and get it.
 
I don't know if it's applicable to what you have in mind, but there are a few places in other stories where you're supposed to have a particular type of ship and the story won't proceed unless you do. The first one I did was "Ardent", in which you con the governor of Willemstad into helping you steal a Heavy East Indiaman, allegedly in the name of the governor of Santiago. The governor of Santiago then has the idea to make a gift of this ship to the governor of Willemstad, so you need to have it - or any Heavy East Indiaman - when you talk to him. Later I added a check to "Tales of a Sea Hawk" to put a stop to people trying to keep the frigate which you have to take from Speightstown to Port Royale and hand over to Silehard. Have a look at "PROGRAM\Storyline\Ardent\DIALOGS\Javier Balboa_dialog.c", case "convoy_other_ships". Or at "PROGRAM\Storyline\standard\quests\quests_reaction.c", case "Story_BlazeWithRabelAndCounterspyReturn". Basically, check that the player has the right ship, or one of its repaintable variants, and if he doesn't, tell him to go and get it.

Thank you for the suggestion! I might use it at some point, right now i already have most of the code and scenes/quests planned out, it's just a matter of time till it's finished, if my wife doesn't beat me up for spending most evenings doing it.:p

Love the new bootstrap bill turner's model by the way, looks nice!
 
Back
Top