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

Generally, sidequests go into "PROGRAM\QUESTS\quests_side.c". That way, they're available to all storylines including FreePlay.

The ones in "both_reaction.c" are specific to "Hoist the Colours". That's because a long time ago, all the regular sidequests were in the code for "Tales of a Sea Hawk", and before that, in the code for the only storyline in the stock game. Some of them were copied, given a Jack Sparrow themed makeover, and put into "PROGRAM\Storyline\JackSparrow\quests\both_reaction.c". When the regular sidequests were moved into "quests_side.c", those which had been Sparrowfied had to be disabled. That, for example, is why you'll never see the women outside Kralendijk town hall in "Hoist the Colours" - they've been removed so you can't play "Strange Things Going on in the Caribbean" because you'll be playing "Sao Feng's Lost His Bodyguards" instead.
 
Generally, sidequests go into "PROGRAM\QUESTS\quests_side.c". That way, they're available to all storylines including FreePlay.

The ones in "both_reaction.c" are specific to "Hoist the Colours". That's because a long time ago, all the regular sidequests were in the code for "Tales of a Sea Hawk", and before that, in the code for the only storyline in the stock game. Some of them were copied, given a Jack Sparrow themed makeover, and put into "PROGRAM\Storyline\JackSparrow\quests\both_reaction.c". When the regular sidequests were moved into "quests_side.c", those which had been Sparrowfied had to be disabled. That, for example, is why you'll never see the women outside Kralendijk town hall in "Hoist the Colours" - they've been removed so you can't play "Strange Things Going on in the Caribbean" because you'll be playing "Sao Feng's Lost His Bodyguards" instead.

Okay, this makes complete sense now!
 
Another question that just came up for me, should we make Flying Dutchman indestructible when player first enconters it ? And maybe give it the CANNON_TYPE_CARRONADE_DUTCHMAN cannons by default ? As it would make sence to have really op cannons even for the freeplay mode, as player can't go ashore to ever upgrade them. And it would kinda break the immersion if player could just sink the Dutchman as it will appear again several times later down the questline... :pirate41:

Not that we will have DMC questline done in a week, and it will need some community input and testing for sure when i'm done with it, just an idea for the future, but maybe some players wouldn't like this idea...

Also maybe there is a function to change the music playing somehow ? For example have the storm music when you encounter the Dutchman, as i will change the weather to stormy one for the first encounter most likely... i noticed that @Pieter Boelen added a brief piece of soundtack playing when Dutchman reemerges.

I could probably find/figure it out myself but i'm quite busy with turks prison right now, sorry for being lazy :D
 
Sorry for a wall of posts, but i can't for the life of me understand how to view locations and locators using TOOL, for example how to view locators for Turks port ? When i open the gm files they are white with no textures and all the locators in the view tab say null, i have set the textures file path correclty, any help would be much appriciated! :(
 
Another question that just came up for me, should we make Flying Dutchman indestructible when player first enconters it ? And maybe give it the CANNON_TYPE_CARRONADE_DUTCHMAN cannons by default ? As it would make sence to have really op cannons even for the freeplay mode, as player can't go ashore to ever upgrade them. And it would kinda break the immersion if player could just sink the Dutchman as it will appear again several times later down the questline... :pirate41:
Possibly make the Flying Dutchman indestructible in the storyline, though I'm not entirely happy with that. Perhaps it repairs itself, the way you see the skeletal crew of Black Pearl repairing the sunken ship in the end video of "Tales of a Sea Hawk". Or maybe, when you think you sink it, it's really just submerging.

Certainly in storylines other than "Hoist the Colours", the only reason I ever take the sidequest which leads to fighting the Flying Dutchman is for the challenge of sinking it.

The danger of giving the ship CANNON_TYPE_CARRONADE_DUTCHMAN, which is 128lb carronades, is that not everyone plays the sidequest while in command of a 1st rate ship of the line. If you're in something smaller and the Flying Dutchman has super cannons, you might be sunk before you have a chance to run away. Since it's your idea, you're welcome to try it - change "Ships_init.c" to give CANNON_TYPE_CARRONADE_DUTCHMAN to "CursedDutchman", start a FreePlay game with something like a schooner, visit Cayman's governor to trigger the quest, and see if you can survive to complete the quest...

Also maybe there is a function to change the music playing somehow ? For example have the storm music when you encounter the Dutchman, as i will change the weather to stormy one for the first encounter most likely... i noticed that @Pieter Boelen added a brief piece of soundtack playing when Dutchman reemerges.

I could probably find/figure it out myself but i'm quite busy with turks prison right now, sorry for being lazy :D
Have a look at case "insertforchase2". The line:
Code:
PChar.seamusic = "Black_Pearl";
sets custom music for the battle between Black Pearl and Interceptor. Then, at case "InterceptorDestroyed":
Code:
DeleteAttribute(PChar, "seamusic");
restores music to normal.
 
Possibly make the Flying Dutchman indestructible in the storyline, though I'm not entirely happy with that. Perhaps it repairs itself, the way you see the skeletal crew of Black Pearl repairing the sunken ship in the end video of "Tales of a Sea Hawk". Or maybe, when you think you sink it, it's really just submerging.

Certainly in storylines other than "Hoist the Colours", the only reason I ever take the sidequest which leads to fighting the Flying Dutchman is for the challenge of sinking it.

The danger of giving the ship CANNON_TYPE_CARRONADE_DUTCHMAN, which is 128lb carronades, is that not everyone plays the sidequest while in command of a 1st rate ship of the line. If you're in something smaller and the Flying Dutchman has super cannons, you might be sunk before you have a chance to run away. Since it's your idea, you're welcome to try it - change "Ships_init.c" to give CANNON_TYPE_CARRONADE_DUTCHMAN to "CursedDutchman", start a FreePlay game with something like a schooner, visit Cayman's governor to trigger the quest, and see if you can survive to complete the quest...


Have a look at case "insertforchase2". The line:
Code:
PChar.seamusic = "Black_Pearl";
sets custom music for the battle between Black Pearl and Interceptor. Then, at case "InterceptorDestroyed":
Code:
DeleteAttribute(PChar, "seamusic");
restores music to normal.

I'm not certain on how good making Dutchman indestructible would be myself :D it was never mentioned in the films either if you can actually sink it or not... anyways it's not a priority just an idea, maybe it could submerge when reaching close to 10% hp, but just for the storyline. Ill try out the cannons later on when i have time, they would make more sense just for the player during freeplay as Davey.
 
I wouldn't bother too much about FreePlaying as Davy Jones. Hardly anyone does it because it's boring not being able to go on land. Being unable to buy cannons is the least of your problems - you can't do much of anything, including any sidequests. All you can do is sail around sinking things.

The other problem with giving the ship 128lb carronades is that you can't replace them if they're destroyed. At least if you're carrying 32lb long guns, you can try to capture a big warship which is carrying the same and take its guns to replace your losses.
 
Last edited:
I wouldn't bother too much about FreePlaying as Davy Jones. Hardly anyone does it because it's boring not being able to go on land. Being unable to buy cannons is the least of your problems - you can't do much of anything, including any sidequests. All you can do is sail around sinking things.

The other problem with giving the ship 128lb carronades is that you can't replace them if they're destroyed. At least if you're carrying 32lb long guns, you can try to capture a big warship which is carrying the same and take its guns to replace your losses.

Oh i almost forgot that now cannons can get knocked out :shock Scrap that idea then, you are right.

I'm still trying to figure out locators, still no idea what i'm doing wrong :modding (pic attached this time for clarity)

Can we see where the locator is placed ? Overall maybe a small tutorial would be amazing!


Untitled.png
 
Ah yes, locators. They're in a separate file. Turks Island port is "RESOURCE\MODELS\Locations\Town_GrandTurk\Port\Margarita.gm". (Why "Margarita"? Because the model is imported from a different game, in which it is used for Margarita.) The locators are in "Margarita_locators.gm". There are some other locator files which are used for special purposes but you can find out which one is used normally by looking in "PROGRAM\Locations\init\Turks.c", specifically the part about "Turks_port", most specifically this line:
Code:
Locations[n].models.always.locators = "Margarita_locators";
Now look at "PROGRAM\Storyline\FreePlay\quests\quests_reaction.c", case "arrived_turks":
Code:
Locations[FindLocation("Turks_port")].models.always.locators = "Margarita_locators_quest";
This is part of @Bartolomeu o Portugues' special quest for José Joaquím Almeida, "A French Companion". Turks_port is set here to use his special locator file for this quest. Later, at case "return_to_eleuthera":
Code:
Locations[FindLocation("Turks_port")].models.always.locators = "Margarita_locators";
puts the locators back to normal.

Back to TOOL. The reason you can only see white is that TOOL wants to use .tga files while the game uses .tga.tx files. You can use TX Convertor to convert between them, and GM Viewer to see which files the model uses. Or just use GM Viewer to look at the model without needing to convert any texture files because GM Viewer uses the same .tga.tx files as the game.

Now, look at that "Locators" tab at the top of TOOL - not "View -> Locators" which is how you look at locators, but "Locators" on the main toolbar. That allows you to write the locators from a .gm file into a text file, or to read the text file into a .gm model file. A neat trick is to load "Margarita_locators.gm", click that "Locators" tab, then write the locators to a file, e.g. "Margarita_locators.txt". Then open "Margarita.gm", use the "Locators" tab to read the text file, and save the result to a new file, e.g. "Margarita_with_locators.gm". Make sure you save it to a new file because this file won't be any use in the game. But it's very useful in GM Viewer because you can then see the model in full colour with all the locators.
 
Ah yes, locators. They're in a separate file. Turks Island port is "RESOURCE\MODELS\Locations\Town_GrandTurk\Port\Margarita.gm". (Why "Margarita"? Because the model is imported from a different game, in which it is used for Margarita.) The locators are in "Margarita_locators.gm". There are some other locator files which are used for special purposes but you can find out which one is used normally by looking in "PROGRAM\Locations\init\Turks.c", specifically the part about "Turks_port", most specifically this line:
Code:
Locations[n].models.always.locators = "Margarita_locators";
Now look at "PROGRAM\Storyline\FreePlay\quests\quests_reaction.c", case "arrived_turks":
Code:
Locations[FindLocation("Turks_port")].models.always.locators = "Margarita_locators_quest";
This is part of @Bartolomeu o Portugues' special quest for José Joaquím Almeida, "A French Companion". Turks_port is set here to use his special locator file for this quest. Later, at case "return_to_eleuthera":
Code:
Locations[FindLocation("Turks_port")].models.always.locators = "Margarita_locators";
puts the locators back to normal.

Back to TOOL. The reason you can only see white is that TOOL wants to use .tga files while the game uses .tga.tx files. You can use TX Convertor to convert between them, and GM Viewer to see which files the model uses. Or just use GM Viewer to look at the model without needing to convert any texture files because GM Viewer uses the same .tga.tx files as the game.

Now, look at that "Locators" tab at the top of TOOL - not "View -> Locators" which is how you look at locators, but "Locators" on the main toolbar. That allows you to write the locators from a .gm file into a text file, or to read the text file into a .gm model file. A neat trick is to load "Margarita_locators.gm", click that "Locators" tab, then write the locators to a file, e.g. "Margarita_locators.txt". Then open "Margarita.gm", use the "Locators" tab to read the text file, and save the result to a new file, e.g. "Margarita_with_locators.gm". Make sure you save it to a new file because this file won't be any use in the game. But it's very useful in GM Viewer because you can then see the model in full colour with all the locators.

Thank you very much for your explanation!

Sorry to bother you again with locators but i'm having a problem with this step:

Now, look at that "Locators" tab at the top of TOOL - not "View -> Locators" which is how you look at locators, but "Locators" on the main toolbar. That allows you to write the locators from a .gm file into a text file, or to read the text file into a .gm model file. A neat trick is to load "Margarita_locators.gm", click that "Locators" tab, then write the locators to a file, e.g. "Margarita_locators.txt". Then open "Margarita.gm", use the "Locators" tab to read the text file, and save the result to a new file, e.g. "Margarita_with_locators.gm". Make sure you save it to a new file because this file won't be any use in the game. But it's very useful in GM Viewer because you can then see the model in full colour with all the locators.

I have done just like you wrote, opened margarita_locators.gm using TOOL, wrote them into a file, then loaded up margarita.gm and imported/read the locators into it, and saved it as margarita_locators2.gm,
the only issue is that for some reason GM viewer dosn't want to display it, other files can be opened jus fine. (Screenshots from gm viewer attached) :drunk
 

Attachments

  • Untitled12.png
    Untitled12.png
    36.3 KB · Views: 87
  • Untitled11.png
    Untitled11.png
    1.2 MB · Views: 107
Can we see where the locator is placed ? Overall maybe a small tutorial would be amazing!
InternalSettings at the very end: turn locators on. Possible "with bright colors" too.
Teleport yourself to the location by using console.
Then you'll see all.
 
I have done just like you wrote, opened margarita_locators.gm using TOOL, wrote them into a file, then loaded up margarita.gm and imported/read the locators into it, and saved it as margarita_locators2.gm,
the only issue is that for some reason GM viewer dosn't want to display it, other files can be opened jus fine. (Screenshots from gm viewer attached) :drunk
I've sometimes found that GM Viewer refuses to open a file which TOOL already has open. Close both GM Viewer and TOOL, open GM Viewer and try again.

Meanwhile:
dutchman_deck.jpg

The cursed Flying Dutchman has a new deck. It's named "ShipDeck2FDM" and defined in "PROGRAM\Locations\init\Ship.c". It's a retextured version of "ShipDeck2", alias "RESOURCE\MODELS\Locations\decks\Udeck1\udeck.gm"; the new version is in the same folder and named "FDdeck". (Putting it in the same folder meant I could simply copy and rename all the ".col" lighting files.)
 

Attachments

  • FD_Deck.zip
    4.3 MB · Views: 76
I've sometimes found that GM Viewer refuses to open a file which TOOL already has open. Close both GM Viewer and TOOL, open GM Viewer and try again.

Meanwhile:
View attachment 40489

The cursed Flying Dutchman has a new deck. It's named "ShipDeck2FDM" and defined in "PROGRAM\Locations\init\Ship.c". It's a retextured version of "ShipDeck2", alias "RESOURCE\MODELS\Locations\decks\Udeck1\udeck.gm"; the new version is in the same folder and named "FDdeck". (Putting it in the same folder meant I could simply copy and rename all the ".col" lighting files.)

This is epic! I have no idea how difficult retexturing is for this game , but maybe you could do the lower decks as well ? Anyways awesome work! :pflag

I have made some more progress on DMC yesterday, i'm using @Jack Rackham 's suggestion for locators for now which does help a lot to be honest. :D

I will update my first post when i finish some dialogue's and test it all, i have merged with the latest update as well (finally!).
 
Another not-so-stupid questin arose :D What is the best/correct way to kill npcs and revive them, and why/when to use fantom characters ?

For example in my quest you can kill these pirates here depending on players choice:

C:
//spawn npcs
        ChangeCharacterAddressGroup(CharacterFromID("prison_guard_captain"),"Fake_Turks_prison","officers","reload1_1");
        ChangeCharacterAddressGroup(CharacterFromID("turks_prison_guard1"),"Fake_Turks_prison","goto","goto14");    
        ChangeCharacterAddressGroup(CharacterFromID("Atwood Paddley"),"Fake_Turks_prison","goto","goto9");
        ChangeCharacterAddressGroup(CharacterFromID("Pirates_1"),"Fake_Turks_prison","officers","reload1_2");
        ChangeCharacterAddressGroup(CharacterFromID("Pirates_2"),"Fake_Turks_prison","goto","goto13");
        ChangeCharacterAddressGroup(CharacterFromID("Pirates_3"),"Fake_Turks_prison","goto","goto18");
        ChangeCharacterAddressGroup(CharacterFromID("Pirates_4"),"Fake_Turks_prison","goto","goto21");

Now when i try to "revive" Pirates_1 to reuse him in another scene i have no luck, tried many things, reloading him in, removing corpse, setting his location to none and then loading in again, for some reason he just refuses to spawn and go to the locator, i ended up creating another 2 npcs just for the scene and left the others dead and set loc to none later...

ch.old.name = "Pirate";
ch.old.lastname = "";
ch.name = TranslateString("", "Pirate");
ch.lastname = TranslateString("", "");
ch.id = "Pirates_1";
ch.model = "korsar";
ch.sound_type = "pirate";
//LAi_NoRebirthEnable(ch);
ch.sex = "man";
GiveItem2Character(ch, "blade4");
ch.equip.blade = "blade4";
ch.nodisarm = 1; // PB: Disable disarming
ch.location = "";
ch.location.group = "goto";
ch.location.locator = "character7";
ch.Dialog.Filename = "";
ch.nation = PIRATE;
ch.rank = 1;
ch.reputation = "None";
ch.experience = "0";
ch.skill.Leadership = "1";
ch.skill.Fencing = "1";
ch.skill.Sailing = "1";
ch.skill.Accuracy = "1";
ch.skill.Cannons = "1";
ch.skill.Grappling = "1";
ch.skill.Repair = "1";
ch.skill.Defence = "1";
ch.skill.Commerce = "1";
ch.skill.Sneak = "1";
ch.money = "10";
ch.questchar = true;//MAXIMUS: identifier for captives
LAi_SetActorType(ch);
LAi_SetLoginTime(ch, 0.0, 24.0);
LAi_SetHP(ch, 80.0, 80.0);
AddGameCharacter(n, ch);
 
Last edited:
Another not-so-stupid questin arose :D What is the best/correct way to kill npcs and revive them, and why/when to use fantom characters ?
I'm not sure why reviving "Pirates_1" isn't working. Both the "Bartolomeu" and "Hornblower" storylines require you to kill a character who then respawns, and neither of them do anything special, they just use 'ChangeCharacterAddressGroup' to put the ex-dead character where he's supposed to be for his next appearance. You've commented out the line 'LAi_NoRebirthEnable(ch);' in his definition; the "Bartolomeu" and "Hornblower" characters don't have that line at all, but if it's commented out then it won't do anything. (If it were not commented out, that's the line which would stop the character from respawning, and is useful for characters which you want to stay dead after they've been killed and not automatically respawn to their starting locations.) Could you show the code for when "Pirates_1" is supposed to reappear?

Fantom characters are temporary. They spawn where you are now and disappear when you leave the area. They're useful for characters who only appear briefly in one scene, saving you the effort of writing a full character definition. A squad of soldiers for a battle scene can be represented by fantoms, for example.
 
I'm not sure why reviving "Pirates_1" isn't working. Both the "Bartolomeu" and "Hornblower" storylines require you to kill a character who then respawns, and neither of them do anything special, they just use 'ChangeCharacterAddressGroup' to put the ex-dead character where he's supposed to be for his next appearance. You've commented out the line 'LAi_NoRebirthEnable(ch);' in his definition; the "Bartolomeu" and "Hornblower" characters don't have that line at all, but if it's commented out then it won't do anything. (If it were not commented out, that's the line which would stop the character from respawning, and is useful for characters which you want to stay dead after they've been killed and not automatically respawn to their starting locations.) Could you show the code for when "Pirates_1" is supposed to reappear?

Fantom characters are temporary. They spawn where you are now and disappear when you leave the area. They're useful for characters who only appear briefly in one scene, saving you the effort of writing a full character definition. A squad of soldiers for a battle scene can be represented by fantoms, for example.

Hey Grey Roger!

Yes i have commented the line out, which was there before, those characters are used previously in the Black pearl quest:

case "Beckett_Save_Slaves_Africa_2":
// ChangeCharacterAddressGroup(characterFromID("Cutler Beckett"), "redmond_residence", "goto", "goto8");
pchar.quest.Tia_Dalma = "start";
ChangeCharacterAddress(CharacterFromID("Pirates_1"), "Antigua_shore", "locator26");
ChangeCharacterAddress(CharacterFromID("Pirates_2"), "Antigua_shore", "reload2_1");
ChangeCharacterAddress(CharacterFromID("Pirates_3"), "Antigua_shore", "reload2_2");
LAi_SetActorType(characterFromID("Tia Dalma"));
LAi_SetImmortal(characterFromID("Tia Dalma"), true);
LAi_ActorWaitDialog(PChar,characterFromID("Tia Dalma"));
LAi_ActorDialog(characterFromID("Tia Dalma"),PChar,"",10.0,1.0);
ChangeCharacterAddress(characterFromID("Tia Dalma"), "Antigua_shore", "citizen08");
characters[GetCharacterIndex("Tia Dalma")].Dialog.Filename = "Tia Dalma_dialog.c";
break;

case "go_to_fight_Slave_Traders":
Pchar.quest.back_to_Tia_Dalma.win_condition.l1 = "NPC_Death";
Pchar.quest.back_to_Tia_Dalma.win_condition.l1.character = "Pirates_1";
Pchar.quest.back_to_Tia_Dalma.win_condition.l2 = "NPC_Death";
Pchar.quest.back_to_Tia_Dalma.win_condition.l2.character = "Pirates_2";
Pchar.quest.back_to_Tia_Dalma.win_condition.l3 = "NPC_Death";
Pchar.quest.back_to_Tia_Dalma.win_condition.l3.character = "Pirates_3";
PChar.quest.back_to_Tia_Dalma.win_condition = "back_to_Tia_Dalma";

pchar.quest.back_to_Tia_Dalma_failed.win_condition.l1 = "NPC_Death";
pchar.quest.back_to_Tia_Dalma_failed.win_condition.l1.character = PChar.id;
pchar.quest.back_to_Tia_Dalma_failed.win_condition = "back_to_Tia_Dalma_failed";
break;

but ill fix it by moving them to "none" loc after they are killed.

Here is the whole code for the prison scene, with only the kill guards option, i think it will be easier if you go trough the whole thing.

C:
//Load into prison
        case "to_turks_prison_load":
        Locations[FindLocation("Fake_Turks_prison")].vcskip = true;
        DoQuestReloadToLocation("Fake_Turks_prison", "goto", "goto16" ,"_");
        DisableFastTravel(true);
        
        //spawn npcs
        ChangeCharacterAddressGroup(CharacterFromID("prison_guard_captain"),"Fake_Turks_prison","officers","reload1_1");
        ChangeCharacterAddressGroup(CharacterFromID("turks_prison_guard1"),"Fake_Turks_prison","goto","goto14");       
        ChangeCharacterAddressGroup(CharacterFromID("Atwood Paddley"),"Fake_Turks_prison","goto","goto9");
        ChangeCharacterAddressGroup(CharacterFromID("Pirates_1"),"Fake_Turks_prison","officers","reload1_2");
        ChangeCharacterAddressGroup(CharacterFromID("Pirates_2"),"Fake_Turks_prison","goto","goto13");
        ChangeCharacterAddressGroup(CharacterFromID("Pirates_3"),"Fake_Turks_prison","goto","goto18");
        ChangeCharacterAddressGroup(CharacterFromID("Pirates_4"),"Fake_Turks_prison","goto","goto21");

        //Talk to captain again in prison
        LAi_SetActorType(characterfromID("prison_guard_captain"));
        LAi_ActorDialog(characterFromID("prison_guard_captain"),PChar,"",1.0,1.0);
        Characters[GetCharacterIndex("prison_guard_captain")].dialog.currentnode = "turks_prison_inside";
        Characters[GetCharacterIndex("Atwood Paddley")].dialog.currentnode = "turks_prison";       
        break;
        
        //Player Choise 1 - surrender
        //Walk me to cell
        case "turks_prison_captured_walk":       
        //Disable always run switch
        AlwaysRunToggle = false;       
        //Here goes walk to Atwood cell locators and fade pchar into cell locator   
        break;
                
        //Player Choise 2 - fight
        //Shoot captain kill him
        case "turks_prison_figh_guards":               
        LAi_SetActorType(pchar);       
        LAi_ActorAttack(pchar,characterfromID("prison_guard_captain"), "");
        LAi_QuestDelay("kill_prioson_captain", 2.7);
        break;
        
        case "kill_prioson_captain":
            LAi_SetStayType(pchar);
            Lai_KillCharacter(characterfromID("prison_guard_captain"));
            LAi_QuestDelay("fight_prepare", 2.0);
        break;
        
        //Draw sword again TODO: Maake player keep the blade drawn
        case "fight_prepare":
            LAi_SetPlayerType(pchar);
            LAi_SetFightMode(pchar, true);
            LAi_SetImmortal(pchar, true); //REMOVE LATER WHEN QUEST DONE!!
            LAi_QuestDelay("prison_guards_attack1", 0.2);
        break;
        
        //First 3 Guards attack player
        case "prison_guards_attack1":
        LAi_SetActorType(characterfromID("Pirates_1"));
        LAi_SetActorType(characterfromID("Pirates_3"));
        LAi_SetActorType(characterfromID("turks_prison_guard1"));
        LAi_ActorAttack(characterfromID("turks_prison_guard1"),pchar, "");
        LAi_ActorAttack(characterfromID("Pirates_1"),pchar, "");
        LAi_ActorAttack(characterfromID("Pirates_3"),pchar, "");
        
                
        PChar.quest.KilledFighting.win_condition.l1 = "NPC_Death";
        PChar.quest.KilledFighting.win_condition.l1.character = PChar.id;
        PChar.quest.KilledFighting.win_condition = "KilledFighting";
        
        pchar.quest.prison_guards_attack2_self.win_condition.l1 = "locator";
        pchar.quest.prison_guards_attack2_self.win_condition.l1.location = "Fake_Turks_prison";
        pchar.quest.prison_guards_attack2_self.win_condition.l1.locator_group = "merchant";
        pchar.quest.prison_guards_attack2_self.win_condition.l1.locator = "reload13";
        pchar.quest.prison_guards_attack2_self.win_condition = "prison_guards_attack2_self";       
        break;

        //Talk to self when reaching locator, think where to find Atwood
        case "prison_guards_attack2_self":
        LAi_SetActorType(Pchar);
        Pchar.Temp.self.dialog = Pchar.dialog.currentnode;
        Pchar.dialog.currentnode = "At_turks_talk_self1";
        LAi_ActorSelfDialog(Pchar, "player_back");           
        break;

        //Set other 2 guards to attack pchar
        case "prison_guards_attack2":
        LAi_SetPlayerType(pchar);
        LAi_SetActorType(characterfromID("Pirates_2"));
        LAi_SetActorType(characterfromID("Pirates_4"));
        LAi_ActorAttack(characterfromID("Pirates_2"),pchar, "");
        LAi_ActorAttack(characterfromID("Pirates_4"),pchar, "");
                        
        PChar.quest.KilledFighting.win_condition.l1 = "NPC_Death";
        PChar.quest.KilledFighting.win_condition.l1.character = PChar.id;
        PChar.quest.KilledFighting.win_condition = "KilledFighting";   
        break;
            
        //Talk to self after meeting Atwood (hear guards coming!)
        case "after_atwood_talk_self":
        LAi_SetActorType(Pchar);
        Pchar.Temp.self.dialog = Pchar.dialog.currentnode;
        Pchar.dialog.currentnode = "Turks_talk_self1_after_atwood";
        LAi_ActorSelfDialog(Pchar, "player_back");           
        break;
        
        //After talk self auto run to coffin's room
        case "after_atwood_coffin":
        AlwaysRunToggle = true;
        LAi_SetActorType(pchar);
        Lai_ActorGoToLocator(pchar, "reload", "reload10", "prepare_guards_move", -1);       
        
        //pchar.quest.prepare_guards_move.win_condition.l1 = "locator";
        //pchar.quest.prepare_guards_move.win_condition.l1.location = "Fake_Turks_prison";
        //pchar.quest.prepare_guards_move.win_condition.l1.locator_group = "reload";
        //pchar.quest.prepare_guards_move.win_condition.l1.locator = "reload10";
        //pchar.quest.prepare_guards_move.win_condition = "prepare_guards_move";    //Make this prepare_loc_coffin_self_dia
        
        break;
        
        //TODO add this and  move resert guard functions here
        //Next to coffin room talk self, explain to self coffins in room so player understands
        case "prepare_loc_coffin_self_dia":
        LAi_SetActorType(Pchar);
        Pchar.Temp.self.dialog = Pchar.dialog.currentnode;
        Pchar.dialog.currentnode = "Turks_talk_self1_after_atwood";
        LAi_ActorSelfDialog(Pchar, "player_back");           
        break;
        
        //Reset the guards here for now // later move to locators goes here
        case "prepare_guards_move":
        LAi_type_actor_Reset(characterFromID("Pirates_1"));
        LAi_type_actor_Reset(characterFromID("Pirates_4"));
        ChangeCharacterAddress(characterFromID("Pirates_1"), "none", "");
        ChangeCharacterAddress(characterFromID("Pirates_4"), "none", "");   
        //Fade screen next quest / get in coffin
        LAi_Fade("escape_in_coffin", "");
        break;
        
        //Set the camera outside cell to emulate player in coffin, move guards into scene for last dialogue
        //Less visible jus in case
        case "escape_in_coffin":           
        //Set camera pos to locator
        LAi_ActorSetSitMode(pchar);
        locx = stf(loadedLocation.locators.camera.camera12.x);
        locy = stf(loadedLocation.locators.camera.camera12.y);
        locz = stf(loadedLocation.locators.camera.camera12.z);
        locCameraToPos(locx, locy, locz, false);   
        //Guards spawn and go to scene/dialog prep
        LAi_SetActorType(characterfromID("Pirates_1"));
        LAi_SetActorType(characterfromID("Pirates_4"));
        LAi_ActorGoToLocator(characterFromID("Pirates_1"), "reload", "reload10", "", 1);
        LAi_ActorGoToLocator(characterFromID("Pirates_4"), "Goto", "Goto13", "", 1);
        LAi_ActorTurnToCharacter(characterFromID("Pirates_1"), characterFromID("Pirates_4"));
        LAi_ActorWaitDialog(characterFromID("Pirates_1"), characterFromID("Pirates_4"));
        LAi_ActorDialog(characterFromID("Pirates_1"), characterFromID("Pirates_4"), "", 5.0, 5.0);
        break;
 
Hey Grey Roger!

Yes i have commented the line out, which was there before, those characters are used previously in the Black pearl quest:

case "Beckett_Save_Slaves_Africa_2":
// ChangeCharacterAddressGroup(characterFromID("Cutler Beckett"), "redmond_residence", "goto", "goto8");
pchar.quest.Tia_Dalma = "start";
ChangeCharacterAddress(CharacterFromID("Pirates_1"), "Antigua_shore", "locator26");
ChangeCharacterAddress(CharacterFromID("Pirates_2"), "Antigua_shore", "reload2_1");
ChangeCharacterAddress(CharacterFromID("Pirates_3"), "Antigua_shore", "reload2_2");
LAi_SetActorType(characterFromID("Tia Dalma"));
LAi_SetImmortal(characterFromID("Tia Dalma"), true);
LAi_ActorWaitDialog(PChar,characterFromID("Tia Dalma"));
LAi_ActorDialog(characterFromID("Tia Dalma"),PChar,"",10.0,1.0);
ChangeCharacterAddress(characterFromID("Tia Dalma"), "Antigua_shore", "citizen08");
characters[GetCharacterIndex("Tia Dalma")].Dialog.Filename = "Tia Dalma_dialog.c";
break;

case "go_to_fight_Slave_Traders":
Pchar.quest.back_to_Tia_Dalma.win_condition.l1 = "NPC_Death";
Pchar.quest.back_to_Tia_Dalma.win_condition.l1.character = "Pirates_1";
Pchar.quest.back_to_Tia_Dalma.win_condition.l2 = "NPC_Death";
Pchar.quest.back_to_Tia_Dalma.win_condition.l2.character = "Pirates_2";
Pchar.quest.back_to_Tia_Dalma.win_condition.l3 = "NPC_Death";
Pchar.quest.back_to_Tia_Dalma.win_condition.l3.character = "Pirates_3";
PChar.quest.back_to_Tia_Dalma.win_condition = "back_to_Tia_Dalma";

pchar.quest.back_to_Tia_Dalma_failed.win_condition.l1 = "NPC_Death";
pchar.quest.back_to_Tia_Dalma_failed.win_condition.l1.character = PChar.id;
pchar.quest.back_to_Tia_Dalma_failed.win_condition = "back_to_Tia_Dalma_failed";
break;

but ill fix it by moving them to "none" loc after they are killed.

Here is the whole code for the prison scene, with only the kill guards option, i think it will be easier if you go trough the whole thing.

C:
//Load into prison
        case "to_turks_prison_load":
        Locations[FindLocation("Fake_Turks_prison")].vcskip = true;
        DoQuestReloadToLocation("Fake_Turks_prison", "goto", "goto16" ,"_");
        DisableFastTravel(true);
       
        //spawn npcs
        ChangeCharacterAddressGroup(CharacterFromID("prison_guard_captain"),"Fake_Turks_prison","officers","reload1_1");
        ChangeCharacterAddressGroup(CharacterFromID("turks_prison_guard1"),"Fake_Turks_prison","goto","goto14");      
        ChangeCharacterAddressGroup(CharacterFromID("Atwood Paddley"),"Fake_Turks_prison","goto","goto9");
        ChangeCharacterAddressGroup(CharacterFromID("Pirates_1"),"Fake_Turks_prison","officers","reload1_2");
        ChangeCharacterAddressGroup(CharacterFromID("Pirates_2"),"Fake_Turks_prison","goto","goto13");
        ChangeCharacterAddressGroup(CharacterFromID("Pirates_3"),"Fake_Turks_prison","goto","goto18");
        ChangeCharacterAddressGroup(CharacterFromID("Pirates_4"),"Fake_Turks_prison","goto","goto21");

        //Talk to captain again in prison
        LAi_SetActorType(characterfromID("prison_guard_captain"));
        LAi_ActorDialog(characterFromID("prison_guard_captain"),PChar,"",1.0,1.0);
        Characters[GetCharacterIndex("prison_guard_captain")].dialog.currentnode = "turks_prison_inside";
        Characters[GetCharacterIndex("Atwood Paddley")].dialog.currentnode = "turks_prison";      
        break;
       
        //Player Choise 1 - surrender
        //Walk me to cell
        case "turks_prison_captured_walk":      
        //Disable always run switch
        AlwaysRunToggle = false;      
        //Here goes walk to Atwood cell locators and fade pchar into cell locator  
        break;
               
        //Player Choise 2 - fight
        //Shoot captain kill him
        case "turks_prison_figh_guards":              
        LAi_SetActorType(pchar);      
        LAi_ActorAttack(pchar,characterfromID("prison_guard_captain"), "");
        LAi_QuestDelay("kill_prioson_captain", 2.7);
        break;
       
        case "kill_prioson_captain":
            LAi_SetStayType(pchar);
            Lai_KillCharacter(characterfromID("prison_guard_captain"));
            LAi_QuestDelay("fight_prepare", 2.0);
        break;
       
        //Draw sword again TODO: Maake player keep the blade drawn
        case "fight_prepare":
            LAi_SetPlayerType(pchar);
            LAi_SetFightMode(pchar, true);
            LAi_SetImmortal(pchar, true); //REMOVE LATER WHEN QUEST DONE!!
            LAi_QuestDelay("prison_guards_attack1", 0.2);
        break;
       
        //First 3 Guards attack player
        case "prison_guards_attack1":
        LAi_SetActorType(characterfromID("Pirates_1"));
        LAi_SetActorType(characterfromID("Pirates_3"));
        LAi_SetActorType(characterfromID("turks_prison_guard1"));
        LAi_ActorAttack(characterfromID("turks_prison_guard1"),pchar, "");
        LAi_ActorAttack(characterfromID("Pirates_1"),pchar, "");
        LAi_ActorAttack(characterfromID("Pirates_3"),pchar, "");
       
               
        PChar.quest.KilledFighting.win_condition.l1 = "NPC_Death";
        PChar.quest.KilledFighting.win_condition.l1.character = PChar.id;
        PChar.quest.KilledFighting.win_condition = "KilledFighting";
       
        pchar.quest.prison_guards_attack2_self.win_condition.l1 = "locator";
        pchar.quest.prison_guards_attack2_self.win_condition.l1.location = "Fake_Turks_prison";
        pchar.quest.prison_guards_attack2_self.win_condition.l1.locator_group = "merchant";
        pchar.quest.prison_guards_attack2_self.win_condition.l1.locator = "reload13";
        pchar.quest.prison_guards_attack2_self.win_condition = "prison_guards_attack2_self";      
        break;

        //Talk to self when reaching locator, think where to find Atwood
        case "prison_guards_attack2_self":
        LAi_SetActorType(Pchar);
        Pchar.Temp.self.dialog = Pchar.dialog.currentnode;
        Pchar.dialog.currentnode = "At_turks_talk_self1";
        LAi_ActorSelfDialog(Pchar, "player_back");          
        break;

        //Set other 2 guards to attack pchar
        case "prison_guards_attack2":
        LAi_SetPlayerType(pchar);
        LAi_SetActorType(characterfromID("Pirates_2"));
        LAi_SetActorType(characterfromID("Pirates_4"));
        LAi_ActorAttack(characterfromID("Pirates_2"),pchar, "");
        LAi_ActorAttack(characterfromID("Pirates_4"),pchar, "");
                       
        PChar.quest.KilledFighting.win_condition.l1 = "NPC_Death";
        PChar.quest.KilledFighting.win_condition.l1.character = PChar.id;
        PChar.quest.KilledFighting.win_condition = "KilledFighting";  
        break;
           
        //Talk to self after meeting Atwood (hear guards coming!)
        case "after_atwood_talk_self":
        LAi_SetActorType(Pchar);
        Pchar.Temp.self.dialog = Pchar.dialog.currentnode;
        Pchar.dialog.currentnode = "Turks_talk_self1_after_atwood";
        LAi_ActorSelfDialog(Pchar, "player_back");          
        break;
       
        //After talk self auto run to coffin's room
        case "after_atwood_coffin":
        AlwaysRunToggle = true;
        LAi_SetActorType(pchar);
        Lai_ActorGoToLocator(pchar, "reload", "reload10", "prepare_guards_move", -1);      
       
        //pchar.quest.prepare_guards_move.win_condition.l1 = "locator";
        //pchar.quest.prepare_guards_move.win_condition.l1.location = "Fake_Turks_prison";
        //pchar.quest.prepare_guards_move.win_condition.l1.locator_group = "reload";
        //pchar.quest.prepare_guards_move.win_condition.l1.locator = "reload10";
        //pchar.quest.prepare_guards_move.win_condition = "prepare_guards_move";    //Make this prepare_loc_coffin_self_dia
       
        break;
       
        //TODO add this and  move resert guard functions here
        //Next to coffin room talk self, explain to self coffins in room so player understands
        case "prepare_loc_coffin_self_dia":
        LAi_SetActorType(Pchar);
        Pchar.Temp.self.dialog = Pchar.dialog.currentnode;
        Pchar.dialog.currentnode = "Turks_talk_self1_after_atwood";
        LAi_ActorSelfDialog(Pchar, "player_back");          
        break;
       
        //Reset the guards here for now // later move to locators goes here
        case "prepare_guards_move":
        LAi_type_actor_Reset(characterFromID("Pirates_1"));
        LAi_type_actor_Reset(characterFromID("Pirates_4"));
        ChangeCharacterAddress(characterFromID("Pirates_1"), "none", "");
        ChangeCharacterAddress(characterFromID("Pirates_4"), "none", "");  
        //Fade screen next quest / get in coffin
        LAi_Fade("escape_in_coffin", "");
        break;
       
        //Set the camera outside cell to emulate player in coffin, move guards into scene for last dialogue
        //Less visible jus in case
        case "escape_in_coffin":          
        //Set camera pos to locator
        LAi_ActorSetSitMode(pchar);
        locx = stf(loadedLocation.locators.camera.camera12.x);
        locy = stf(loadedLocation.locators.camera.camera12.y);
        locz = stf(loadedLocation.locators.camera.camera12.z);
        locCameraToPos(locx, locy, locz, false);  
        //Guards spawn and go to scene/dialog prep
        LAi_SetActorType(characterfromID("Pirates_1"));
        LAi_SetActorType(characterfromID("Pirates_4"));
        LAi_ActorGoToLocator(characterFromID("Pirates_1"), "reload", "reload10", "", 1);
        LAi_ActorGoToLocator(characterFromID("Pirates_4"), "Goto", "Goto13", "", 1);
        LAi_ActorTurnToCharacter(characterFromID("Pirates_1"), characterFromID("Pirates_4"));
        LAi_ActorWaitDialog(characterFromID("Pirates_1"), characterFromID("Pirates_4"));
        LAi_ActorDialog(characterFromID("Pirates_1"), characterFromID("Pirates_4"), "", 5.0, 5.0);
        break;
Sorry the last part was incorrect from me fidling with it here is what i have now

C:
//Set the camera outside cell to emulate player in coffin, move guards into scene for last dialogue
        //Less visible jus in case
        case "escape_in_coffin":           
        //Set camera pos to locator
        LAi_ActorSetSitMode(pchar);
        locx = stf(loadedLocation.locators.camera.camera12.x);
        locy = stf(loadedLocation.locators.camera.camera12.y);
        locz = stf(loadedLocation.locators.camera.camera12.z);
        locCameraToPos(locx, locy, locz, false);   
        //Guards spawn and go to scene/dialog prep
        ChangeCharacterAddressGroup(CharacterFromID("Pirates_1"),"Fake_Turks_prison","goto","goto21");
        ChangeCharacterAddressGroup(CharacterFromID("Pirates_4"),"Fake_Turks_prison","goto","goto18");       
        LAi_SetActorType(characterfromID("Pirates_1"));
        LAi_SetActorType(characterfromID("Pirates_4"));
        LAi_ActorGoToLocator(characterFromID("Pirates_1"), "reload", "reload10", "", 1);
        LAi_ActorGoToLocator(characterFromID("Pirates_4"), "Goto", "Goto13", "", 1);
        LAi_ActorTurnToCharacter(characterFromID("Pirates_1"), characterFromID("Pirates_4"));
        LAi_ActorWaitDialog(characterFromID("Pirates_1"), characterFromID("Pirates_4"));
        LAi_ActorDialog(characterFromID("Pirates_1"), characterFromID("Pirates_4"), "", 5.0, 5.0);
        break;
 
Did "Pirates_1" appear in the prison for the fight scene at all? He's not still dead after being killed in the earlier scene on Antigua with Tia Dalma?

I wonder if the problem may be that you're still in "Fake_Turks_prison" when "Pirates_1" is supposed to respawn. By comparison, in "Bartolomeu", you kill a character in Charlestown port, then he respawns when you are relocated to a jungle. In "Hornblower" you kill a character on board his ship, then he respawns when you go to Bridgetown prison. Might it be possible as an experiment to teleport to somewhere else after the fight and try to respawn "Pirates_1" there?

I'm also not sure why "Hoist the Colours" repeatedly does this:
Code:
        PChar.quest.KilledFighting.win_condition.l1 = "NPC_Death";
        PChar.quest.KilledFighting.win_condition.l1.character = PChar.id;
        PChar.quest.KilledFighting.win_condition = "KilledFighting";
There shouldn't be any need, if you die then the game should end automatically unless you resurrect in a tavern. Possibly to make sure the game does end and you can't resurrect even if the "Options" settings still permit it. But then, simply setting 'pchar.quest.disable_rebirth' to true should prevent resurrection, and is used in a couple of other storylines to temporarily disable resurrection where it would either be inappropriate or would cause a serious bug.

In any case, you shouldn't need it at cases "prison_guards_attack1" and "prison_guards_attack2" because you're made immortal at case "fight_prepare".
 
Did "Pirates_1" appear in the prison for the fight scene at all? He's not still dead after being killed in the earlier scene on Antigua with Tia Dalma?
I use

Code:
Pchar.quest.at_turks_port_talk.win_condition.l1 = "location";
Pchar.quest.at_turks_port_talk.win_condition.l1.location = "Turks_port";
Pchar.quest.at_turks_port_talk.win_condition = "at_turks_port_talk";

For testing purposes, i go straight to my quest in turks after i recieve control of Jack in new game.

So Pirates_1 has never died before, and yes all the characters do appear in the turks_prison location as they should

In any case, you shouldn't need it at cases "prison_guards_attack1" and "prison_guards_attack2" because you're made immortal at case "fight_prepare".

It won't be so when i'm done testing/coding, it's just for ease of testing for now :)

I'm also not sure why "Hoist the Colours" repeatedly does this:
Code:
        PChar.quest.KilledFighting.win_condition.l1 = "NPC_Death";
        PChar.quest.KilledFighting.win_condition.l1.character = PChar.id;
        PChar.quest.KilledFighting.win_condition = "KilledFighting";
There shouldn't be any need, if you die then the game should end automatically unless you resurrect in a tavern. Possibly to make sure the game does end and you can't resurrect even if the "Options" settings still permit it. But then, simply setting 'pchar.quest.disable_rebirth' to true should prevent resurrection, and is used in a couple of other storylines to temporarily disable resurrection where it would either be inappropriate or would cause a serious bug.

I thought it's to always play the land game over scene, even when at sea, but no idea why to be honest, but i used it to just keep to the previous code :D

And case "KilledFighting": uses pchar.quest.disable_rebirth = true; anyways

Code:
case "KilledFighting":
            pchar.quest.disable_rebirth = true;
            PostEvent("LAi_event_GameOver", 0, "s", "land");
  break;

I did test it with reloading myself into location again yesterday, for the same result, killed guards didn't spawn.

Anyways after reorganizing my last chunk of code into seperate cases the previously killed guards do spawn correctly, but they DO NOT spawn without doing this dance of
resetting characters, then removing them into a different locaton, then respawning them in again (maybe this info will be useful to someone in the future)

C:
LAi_type_actor_Reset(characterFromID("Pirates_1"));
LAi_type_actor_Reset(characterFromID("Pirates_4"));
ChangeCharacterAddress(characterFromID("Pirates_1"), "none", "");
ChangeCharacterAddress(characterFromID("Pirates_4"), "none", "");

ChangeCharacterAddressGroup(CharacterFromID("Pirates_1"),"Fake_Turks_prison","goto","goto21");
ChangeCharacterAddressGroup(CharacterFromID("Pirates_4"),"Fake_Turks_prison","reload","reload6");


Code:
//Reset the guards here for now // later move to locators goes here // Move player to coffin cell
        case "prepare_guards_move":
            LAi_type_actor_Reset(characterFromID("Pirates_1"));
            LAi_type_actor_Reset(characterFromID("Pirates_4"));
            ChangeCharacterAddress(characterFromID("Pirates_1"), "none", "");
            ChangeCharacterAddress(characterFromID("Pirates_4"), "none", "");
            ChangeCharacterAddressGroup(pchar,"Fake_Turks_prison","goto","goto11");
            LAi_ActorSetSitMode(pchar);        
            //Fade screen next quest / get in coffin
            LAi_Fade("escape_in_coffin", "");
        break;
     
        //Set the camera outside cell to emulate player in coffin, move guards into scene for last dialogue
        //Less visible jus in case
        case "escape_in_coffin":        
        //Set camera pos to locator
            locx = stf(loadedLocation.locators.camera.camera12.x);
            locy = stf(loadedLocation.locators.camera.camera12.y);
            locz = stf(loadedLocation.locators.camera.camera12.z);
            locCameraToPos(locx, locy, locz, false);
                 
            //Guards spawn and go to scene/dialog prep
            ChangeCharacterAddressGroup(CharacterFromID("Pirates_1"),"Fake_Turks_prison","goto","goto21");
            ChangeCharacterAddressGroup(CharacterFromID("Pirates_4"),"Fake_Turks_prison","reload","reload6");    
            LAi_QuestDelay("escape_in_coffin2", 1.0);
        break;
     
        //Run npc guards to locators
        case "escape_in_coffin2":
            LAi_SetActorType(characterfromID("Pirates_1"));
            LAi_SetActorType(characterfromID("Pirates_4"));
            LAi_ActorRunToLocator(characterFromID("Pirates_1"), "reload", "reload10", "", 1);
            LAi_ActorRunToLocator(characterFromID("Pirates_4"), "Goto", "Goto13", "", 1);
            //LAi_ActorTurnToCharacter(characterFromID("Pirates_1"), characterFromID("Pirates_4"));
            //LAi_ActorWaitDialog(characterFromID("Pirates_1"), characterFromID("Pirates_4"));
            //LAi_ActorDialog(characterFromID("Pirates_1"), characterFromID("Pirates_4"), "", 5.0, 5.0);
        break;

Now the only problem is that gurds don't run to the locators as intended, they spawn right on top of them after some time :modding
this one is a doozie for sure :shrug
 
Last edited:
Back
Top