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

Information aboute The New Pirate Age - Update! [WIP]

Something odd in that "compile.log":
Code:
Gauging: start NPC init
ERROR - Missing Character ID: Trafalgar_Law
WARNING!!! Item id = Pistol202 not implemented
WARNING!!! Item id = Pistol202 not implemented
WARNING!!! Item id = Pistol202 not implemented
ERROR - Missing Character ID: Dark_Assassin
Gauging: done NPC init
Have you added anything about "Trafalgar_Law" or "Dark_Assassin" in any files outside your storyline folder?

In "quests_reaction.c", delete this bit:
Code:
            Pchar.quest.Dark_Assassin_Quest.win_condition.l1 = "location";
            Pchar.quest.Dark_Assassin_Quest.win_condition.l1.location = "Oxbay_Canyon";
            Pchar.quest.Dark_Assassin_Quest.win_condition = "Dark_Assassin_Quest";
That triggers quest case "Dark_Assassin_Quest" as soon as you enter the canyon. But you only want it to trigger after you have talked to him.

Can you run the game again, try to talk to him, and then upload "compile.log", "error.log" if it exists, and "system.log"? Also upload your latest version of "TempQuestEnemy.c".

The only odd thing I can see in the dialog files themselves is that, in "Dark_Assassin_dialog.h", the last line of dialog does not have the comma at the end. It should be:
Code:
" Let us Fight!!",  //<- Answer1 Player (And the Fight Starts)
 
Last edited:
Aha! In "TempQuestEnemy.c", in the definition for "Dark_Assassin", you have added this line:
Code:
ch.dialog.CurrentNode = "Node_1";
Delete it.

'dialog.CurrentNode' is how you tell a character to start a dialog using a specific part of his "dialog.c" file. It is useful for characters who will talk to you more than once, so you can set up the character to start at the correct place. Without such a line, dialog will start at case "First Time".

"Dark_Assassin_dialog.c" does not have case "Node_1". So when you try to talk to him, the dialog can not work because you've told it to start with something that does not exist. If you delete that line from "TempQuestEnemy.c", his dialog will start at the usual case "First Time". And that is where you want it to start because that is where he uses the first two lines of "Dark_Assassin_dialog.h", which are the lines you have written for him to start the conversation.

You have added 'ch.dialog.CurrentNode = "Node_1";' to other character definitions as well. It is probably best to delete those lines too. Then the characters' dialogs will all start at case "First Time".

One thing you can do is make the first two lines of the "dialog.h" file be a simple exchange of greetings. Case "First Time" will then make the character greet you and you greet him back, which is suitable if the character has nothing to say about a quest. Then, in "quests_reaction.c", you can have something like this:
Code:
characters[GetCharacterIndex("Dark_Assassin")].Dialog.CurrentNode = "Node_1";
Replace "Dark_Assassin" with the ID of the character you're using for that scene. You don't have to use the dialog case name "Node_1", you can call it anything you like, but whatever name you use must also appear in the character's "dialog.c" file. So the character will normally just exchange greetings with you, but when the time is right, he'll say what you want about the quest. As an example, here's what I have in a sidequest which I'm working on:
Code:
       case "Hornblower_supplies_from_Hernandez":
           LAi_SetActorType(characterFromID("Jose Hernandez"));
           Characters[GetCharacterIndex("Jose Hernandez")].dialog.CurrentNode = "Supply_order";
           LAi_ActorDialog(characterFromID("Jose Hernandez"), PChar, "hornblower_supremo_burning_city",5.0,5.0);
       break;
'LAi_SetActorType' puts the character into actor mode - he just stands there like a statue unless you tell him to do something in the quest code.
'Characters[GetCharacterIndex("Jose Hernandez")].dialog.CurrentNode = "Supply_order";' sets him to start the next dialog at case "Supply_order". This is defined in his "dialog.c" file. It points at the lines in his "dialog.h" file which he needs to say at this point in the quest.
'LAi_ActorDialog(characterFromID("Jose Hernandez"), PChar, "hornblower_supremo_burning_city",5.0,5.0);' makes him talk to you. When the dialog ends, quest case "hornblower_supremo_burning_city" is triggered. You can do something similar; you just need to change all the quest case, dialog case and character names to suit your own story, and you need to decide how to trigger this quest case.
 
@Grey Roger
Ok i have it done.
I uploaded the Quests_reaction.c file in to my Dropbox!

Please can you check?
Doflamingo is the same atkion as we Salazar only a ather place.
 
"quests_reaction.c": as previously stated, delete this bit:
Code:
            Pchar.quest.Dark_Assassin_Quest.win_condition.l1 = "location";
            Pchar.quest.Dark_Assassin_Quest.win_condition.l1.location = "Oxbay_Canyon";
            Pchar.quest.Dark_Assassin_Quest.win_condition = "Dark_Assassin_Quest";
That triggers "Dark_Assassin_Quest" as soon as you enter the canyon. You do not want that because you want to talk to the assassin first. Also, in case "Dark_Assassin_Quest", you may need to add this:
Code:
LAi_group_MoveCharacter(CharacterFromID("Dark_Assassin"), LAi_monsters_group);
Remember how the lighthouse pirates did not attack you until you added similar lines to make sure they were in the "monsters" group? If you do not have this line, the assassin will probably not attack either.

"TempQuestEnemy.c": as previously stated, delete this line from all character definitions:
Code:
ch.dialog.CurrentNode = "Node_1";
That tells the character to start from dialog case "Node_1" in his "dialog.c" file. "Node_1" does not exist, which is why you get no text when you talk to the assassin.

"Salazar_dialog.c": at case "Salazar_dialog2", both the second and third choices lead to case "Salazar_dialog3". The third choice is if you say "Of course I'm not alone!" So, replace this:
Code:
            link.l3 = DLG_TEXT[8];
            link.l3.go = "Salazar_dialog3";
with this:
Code:
            if (GetCompanionQuantity(PChar) > 1)
            {
                link.l3 = DLG_TEXT[8];
                link.l3.go = "Salazar_dialog3";
            }
That should only allow you to claim that you are not alone if you really are not alone. 'GetCompanionQuantity' tells you how many ships a character has. If it's 1, the character only has his own ship. If it's more, the character has more ships. 'PChar' is you. So if 'GetCompanionQuantity(PChar)' is more than 1, you have more than 1 ship.

In both "Salazar_dialog.c" and "quests_reaction.c", change "payroll_ship_setup" to something else. You can call it whatever you like, provided the name in "quests_reaction.c" matches the name in the 'AddDialogExitQuest' line in "Salazar_dialog.c". Also change all the 'pchar.quest.payroll_ship_taken' lines - again, you're not attacking a payroll ship, you're attacking something else, so change the names to match.

The same for "quests_reaction.c, case "DoFlamingo_Attack1", and probably in "Doflamingo_dialog.c". Change the names to something more suitable. Don't use the same names as you used for Salazar, or the game will probably get confused and set you against the wrong enemy.
 
"quests_reaction.c": you have removed these lines from case "Dark_Assassin_Quest":
Code:
            LAi_group_SetRelation(LAi_monsters_group, LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
            LAi_group_FightGroups(LAi_monsters_group, LAI_GROUP_PLAYER, true);
Put them back. The 'LAi_group_MoveCharacter' command tells the assassin that he is in the "monsters" group, but it is those two lines which then tell the "monsters" group to attack the player. You should also add those two lines to case "Lighthouse_Pirates_Boss".

case "Lighthouse_Pirates": perfect. They are assigned to the "monsters" group and then the "monsters" group is told to attack the player. This is how it should be done in both "Dark_Assassin_Quest" and "Lighthouse_Pirates_Boss".

case "Salazar_2nd_arrives": remove the first set of four lines:
Code:
            pchar.quest.payroll_ship_taken.win_condition.l1 = "Armando Salazar";
            pchar.quest.payroll_ship_taken.win_condition.l1.character = "Armando Salazar";
            pchar.quest.payroll_ship_taken.win_condition.l2 = "SeaEnter";
            pchar.quest.payroll_ship_taken.win_condition = "payroll_ship_taken";
The first line is nonsense - it tells the game what sort of condition will trigger the next quest case, and "Armando Salazar" is not a condition! The next four lines are fine:
Code:
            pchar.quest.payroll_ship_taken1.win_condition.l1 = "NPC_Death";
            pchar.quest.payroll_ship_taken1.win_condition.l1.character = "Armando Salazar";
            pchar.quest.payroll_ship_taken1.win_condition.l2 = "SeaEnter";
            pchar.quest.payroll_ship_taken1.win_condition = "payroll_ship_taken";
The first line says this is a condition "NPC_Death" - someone has to die. The second line says that the character to die is "Armando Salazar". The third line says that as well as him being dead, you have to be back at sea, so that it does not trigger if you boarded his ship and are still in his cabin. All you need to do in these lines is change "payroll_ship_taken" to something else.
Change "payroll_ship" in all the 'Group' commands to something else. You are not attacking a payroll ship!
Change the line 'characters[GetCharacterIndex("Spanish_Captain2")].nosurrender = 2;'. You do not have "Spanish_Captain2". He's the captain of my payroll ship. You probably don't want Salazar to surrender, so change that to "Armando Salazar".

case "DoFlamingo_Attack1": again, delete the first four 'pchar.quest.payroll_ship_taken.win_condition' lines entirely, and change "payroll_ship" to something else in the rest. It should be different to whatever you use in "Salazar_2nd_arrives". You do not want DoFlamingo to appear when you're supposed to be attacking Salazar!
Again, in the line 'characters[GetCharacterIndex("Pirate_Captain2")].nosurrender = 2;', change "Pirate_Captain2" to "Doflamingo". Anywhere you have "Doflamingo Donquixote", change it to "DoFlamingo". This is because, in "TempQuestEnemy.c", his name is "Doflamingo Donquixote" but his ID is just "DoFlamingo", so that is what you should use in any commands about him.
 
You're almost there.

case: "Lighthouse_Pirates_Boss": after this, you have two 'break;' lines. Delete one of them, otherwise the whole "quests_reaction.c" will probably not work.

case "Salazar_2nd_arrives": change this line:
Code:
Group_CreateGroup("payroll_ship");
Replace "payroll_ship". It doesn't really matter what you use, but make it something suitable for Salazar. Do the same for all the other "Group" command lines in the "Salazar_2nd_arrives" block.
Code:
           pchar.quest.payroll_ship_taken1.win_condition.l1 = "NPC_Death";
           pchar.quest.payroll_ship_taken1.win_condition.l1.character = "Armando Salazar";
           pchar.quest.payroll_ship_taken1.win_condition.l2 = "SeaEnter";
           pchar.quest.payroll_ship_taken1.win_condition = "payroll_ship_taken";
Change "payroll_ship_taken1" to something else. Most important, change that last line. It's going to trigger case "payroll_ship_taken", which hasn't been written yet, but it should be a more suitable name and it must be different to the one in case "DoFlamingo_Attack1".

case "DoFlamingo_Attack1": again, change this:
Code:
Group_CreateGroup("payroll_ship");
Replace "payroll_ship". Again, it doesn't really matter what you use, except that it must not be the same as the name you used for Salazar's group. Make it something suitable for DoFlamingo.

Code:
Group_AddCharacter("payroll_ship", "Doflamingo Donquixote");
Group_SetGroupCommander("payroll_ship", "Doflamingo Donquixote");
These will not work. "DoFlamingo DonQuixote" is his name but "DoFlamingo" is his ID. Commands like this work with character ID, not name. Also, change "payroll_ship" to whatever you use in the "Group_CreateGroup" line.
Code:
           pchar.quest.payroll_ship_taken1.win_condition.l1 = "NPC_Death";
           pchar.quest.payroll_ship_taken1.win_condition.l1.character = "Doflamingo Donquixote";
           pchar.quest.payroll_ship_taken1.win_condition.l2 = "SeaEnter";
           pchar.quest.payroll_ship_taken1.win_condition = "payroll_ship_taken";
Again, change "payroll_ship_taken1" to something else. In particular, in the last line, change "payroll_ship_taken" to something else. It must not be the same as the one in "Salazar_2nd_arrives". If they are the same, then defeating Salazar will trigger the same quest case as defeating DoFlamingo, which will not be what you want.

Then try playing it, and see what happens. In particular, the scene with the Dark Assassin should now work - you should be able to talk to him, then fight him.
 
Yes, those names would be fine.

Don't forget to delete the extra 'break' line after case "Lighthouse_Pirates_Boss".
 
That looks alright. Have you tried playing it?

Sometimes I've thought my own code looked alright, then found that there was a mistake when I tried playing a scene and it didn't work. The only real test is to try it and see what happens...
 
No I have only Change the Code.
I have uploaded in the Dropbox the Zip file with Project Files.
 
Last edited:
Try playing the scene with the Dark Assassin, then.

Just because I say the code looks alright doesn't mean it really is alright. Sometimes I've thought my own code looked alright, then tried playing the scene I was working on, and either I got an error message or the scene did not work the way I wanted. Playing the scene to see what happens is the only way to be sure!

Play it, check that it works the way you want. If not, find out what is wrong, fix it. Repeat until the scene works properly.
 
@Grey Roger
Which Code did I need that after a dialog a Character gives me a Item(Book)? Without a fight.

So then I can create the skullface Quest
In the Quests_reaction.c

Cu
 
Back
Top