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

@Grey Roger and @Pieter Boelen

Pleace can you Check me Dialog files and tell me Which Code i need to use.
Pirate_dialog.h is a normal Info Talk Dialog.
 

Attachments

  • Dark_Assassin_dialog.h
    603 bytes · Views: 108
  • Pirate_dialog.h
    415 bytes · Views: 114
  • Trafalgar_allianz_dialog.h
    497 bytes · Views: 101
  • Shanks_allianz_dialog.h
    497 bytes · Views: 114
In all files, the top line is:
Code:
string DLG_TEXT[2] = {
That number 2 has to be changed. It should be the number of text lines. In "Dark_Assassin_dialog.h", it should be 10. In "Trafalgar_allianz_dialog.h", it should be 7. Don't count the initial "DLG_TEXT" line, the final "}" line, or any lines which are just comments such as "// Trafalgar D. Water Law Dialog 1". You should be able to work out what the number should be in the other files.

Beyond that:
"Dark_Assassin_dialog.h":
Code:
". Ok agree" //<--- Issho
"[fight]
Should be:
Code:
". Ok agree", //<--- Issho
"[fight]",
Don't forget to close the quote marks, and don't forget the comma at the end of each line.

"Pirate_dialog.h": looks fine.

"Trafalgar_allianz_dialog.h" and "Shanks_allianz_dialog.h" appear to be the same, and they both have the same mistake:
Code:
"Great, we'll see you at the port." //<- Answer1 Player
Should be:
Code:
"Great, we'll see you at the port.", //<- Answer1 Player
Again, remember the comma at the end. (Incidentally, although "Shanks_allianz_dialog.h" will work, you may want to change all the comments which refer to Trafalgar D. Water Law. This one is for Redhair Shanks, I believe.)
 
"Dark _Assassin_dialog.h": you have still not added the comma after ".Ok agree". "[fight], should be "[fight]",
Each text line should have a closing speech mark and comma.


"Pirate_dialog.h": the number is wrong. Remember, don't include the "DLG_TEXT" line itself or the final "}" when counting the lines.

"Shanks_allianz_dialog.h": the number is also wrong. And who is Shanks D. Water Law? ;)

"Trafalgar_allianz_dialog.h": the number is wrong.

We can deal with the code files when the text files are correct. Until the text files are complete, the code files can't be written as their entire purpose is to pick lines out of the text files and put them in sequence in dialogs.
 
Yes, those look correct now.

For the "dialog.c" files, you can start with "PROGRAM\Storyline\Ardent\DIALOGS\blank_dialog.c". Copy it to "PROGRAM\Storyline\NewPirateAge\DIALOGS" and rename it to match one of your "dialog.h" files.

Leave most of the file alone. The only bits you need to change or add are the "case" sections. Case "exit" is a special one which closes down the dialog and returns the game to normal play - leave that alone as well.

Case "First time" has a lot of lines whose purpose I'm not entirely sure about myself, so I generally leave them in there. The important ones are these:
dialog.text = DLG_TEXT[0]; This is what the character says to you. "DLG_TEXT" is a direct reference to the text in the "dialog.h" file. The code starts counting at 0, so "DLG_TEXT[0]" is the first line of text. If this is "Dark_Assassin_dialog.c" then "DLG_TEXT[0]" is the first text line of "Dark_Assassin_dialog.h", which is:
Code:
". What are you looking for here? You do not have nix here!",
The line starts with a ".", so I'm guessing you want Dark Assassin to call you by name. So, in "Dark_Assassin_dialog.c", replace that "dialog.text" line with this:
Code:
dialog.text = GetMySimpleName(PChar) + DLG_TEXT[0];
"GetMySimpleName" is a function which gives a character's name. "PChar" is you. So that line puts your name in front of the text from "Dark_Asssassin_dialog.h".

link.l1 = DLG_TEXT[1];
This is what you say back to the character. Remember, it's counting from 0, so "DLG_TEXT[1]" is the second line of text. In "Dark_Assassin_dialog.h", that's "I'm looking for the owner of the Black Katana sword!".

"link.l1.go = "Exit"; This is where the dialog goes next. At the moment, it's sending the dialog to case "Exit", which is the one that closes the dialog. But you probably want the dialog to continue for a few more lines. Change it to:
Code:
link.l1.go = "What_do_you_want";
Actually, you can call it anything you like. Some people just use basic names like "node1", "node2", etc. If you use a name which means something to the dialog, it will help you understand what is happening when you read the code again in a month's time. The important thing is that it must not be the same as any name which has already been used.


So now you need to add case "What_do_you_want" (or whatever you chose to call it). You don't need to copy all the odd stuff which is at the beginning of case "First time". All you need are the same basic lines:
Code:
case "What_do_you_want":
    dialog.text = GetMySimpleName(PChar) + DLG_TEXT[2];
    link.l1 = DLG_TEXT[3];
    link.l1.go = "Challenge_accepted";
break;

Again, I'm assuming that because the player's line starts with ".", you want Dark Assassin to call the player by name. If not, you can just removed the "." from the start of the text line and leave out the "GetMySimpleName(PChar) + " part.

It looks as though you want the player to have a choice at this point. He can either say "I will take you and take away the dark katana sword and give it to my best swordsman!" and go to the fight, or he can say "I've changed my mind." and back out. To give the player a choice, add this:
Code:
    link.l2 = DLG_TEXT[4];
    link.l2.go = "exit";

And so on. Always, dialog.text points to a line which the character says, link.l1 points to a line which you say back, and link.l1.go points to the next case which will control the next pair of lines - or, if the dialog is to finish, link.l1.go = "exit"; will close it. If you want to give the player a choice, add link.l2 and link.l2.go lines.
 
Last edited:
No problem. Leave out the "." from the "dialog.h" files and don't bother about "GetMySimpleName(PChar)".

Better yet, in at least one of them, keep it as it was. This is just one of all sorts of useful things you can do in a "dialog.c" file. So let the assassin call you by name at least once, and then next time you want someone to call you by name, you can look back at this dialog and remember how you did it.
 
Code:
        case "Dark_Assassin_dialog1":
            dialog.text = DLG_TEXT[5];
            link.l1 = DLG_TEXT[6];
            link.l1.go = "Dark_Assassin_dialog2";
        break;
DLG_TEXT[5] is just ".". The next line for the Dark Assassin is presumably "You want to defeat me! Hahaha No one ever defeated me. Well you'll experience your miracles just wait." which is DLG_TEXT[6], so that is where 'dialog.text' should point. The player's next line, "Let's start!", is DLG_TEXT[7]; that is where 'link.l1' should point.
Code:
        case "Dark_Assassin_dialog2":
            dialog.text = DLG_TEXT[7];
            link.l1 = DLG_TEXT[8];
            link.l1.go = "[Fight]";
        break;
Because of the mistake earlier, both the "DLG_TEXT" numbers are also one out. 'link.l1.go = "[Fight]";' will not work because you have no case "[Fight]". This is where the dialog will end, so change that to link.l1.go = "Exit";

The fight itself is started in your "quests_reaction.c" by case "Dark_Assassin_Quest". So you want the dialog to trigger that quest case. Here's how you do that:
Code:
AddDialogExitQuest("Dark_Assassin_Quest");
Put that somewhere inside dialog case "Dark_Assassin_dialog2". I usually put such lines just above the 'link.l1.go = "Exit";' line - it probably doesn't really matter where the 'AddDialogExitQuest' line goes, but putting it there makes it obvious that it's going to happen before the dialog exits.
 
Ah ok.

But what meed I for a Code if like to have dialog end without Fight.

Please check later the files.
I edit the Text file and the Code file.
 
Last edited:
You already have it.
Code:
        case "What_do_you_Want":
            dialog.text = DLG_TEXT[2];
            link.l1 = DLG_TEXT[3];
            link.l1.go = "Dark_Assassin_dialog1";
            link.l2 = DLG_TEXT[4];
            link.l2.go = "Exit";
        break;
He says: "He stands before you! What do you want from me?"
You can either say: "I will take you and take away the dark katana sword and give it to my best swordsman!" or "I've changed my mind." If you give the first answer, you've challenged the assassin to a fight and it's going to happen. If you give the second answer, the dialog goes to "Exit" and ends right there.

If you want a second chance to change your mind and leave without fighting, just do the same again. In case "Dark_Assassin_dialog1", add the same 'link.l2' and 'link.l2.go' lines. In general, if you want to offer the player a choice of answers, add 'link.l2' and 'link.l2.go' lines. You can offer even more, with 'link.l3' and 'link.l3.go', 'link.l4' and link.l4.go', and so on. Of course, the other answers need to be in the "dialog.h" file first!

Important note: I was looking at an out of date version of "Dark_Assassin_dialog.h". The extra "." is not in the current version. However, you seem to have two lines for the player: "Yes, I can defeat you!" and "Let's start!". So the "DLG_TEXT" numbers for case "Dark_Assassin_dialog1" are correct, but the numbers for case "Dark_Assassin_dialog2" are still wrong. Also, you forgot the commas on the end of "You want to defeat me! Hahaha No one ever defeated me. Well you'll experience your miracles just wait." and "Yes, I can defeat you!".
 
Hm if i chose "I have Change me mind" I like to end the Dialog with out Fight.

So the file are in current Version in the box.
 
In case "What_do_you_Want", if you answer "I've changed my mind" then it will indeed end without a fight. This is because 'link.l1' points at the answer challenging him and 'link.l1.go' points at the next dialog case; while 'link.l2' points at "I've changed my mind" and 'link.l2.go' points at "Exit", which ends the dialog.
 
Yes, both files look alright now. The commas are added, the extra line for the player has gone, so the lines in "Dark_Assassin_dialog.h" match the "DLG_TEXT" numbers in "Dark_Assassin_dialog.c". You just need to add the AddDialogExitQuest("Dark_Assassin_Quest"); line in case "Dark_Assassin_dialog2" to trigger the fight when the dialog ends after you have challenged him.

There's a little trick you can use to see what number you should use for "DLG_TEXT" to point to a line in a "dialog.h" file. In Notepad, if you press Ctrl G (or possibly Strg G if you're using a German keyboard), it gives you the line number to which you are pointing. Subtract 2 from that number, and the result is what you put in the 'dialog.text = DLG_TEXT[*]' or 'link.l1 = DLG_TEXT[*]' commands in the "dialog.c" file.

The reason is that Ctrl G (or Strg G) is telling you the line number in the file. But the first line in the "dialog.h" file is not part of the text. Also, Notepad starts counting from 1, but the "dialog.c" file starts counting from 0. So DLG_TEXT[0] is line number 2.

Note that this only works if all the lines in the "dialog.h" file are actual dialog text, apart from the "string DLG_TEXT[9] = {" line at the top and the "}" line at the bottom. If you have any additional comment lines, they will spoil the calculation. You'll know if you got the numbers wrong because when you play the game and see the dialog, you or the character will say the wrong thing.
 
You should not have changed case "Exit". In all files, put it back the way it is in "blank_dialog.c". That is not the way to trigger a quest case.

In "Dark_Assassin_dialog.c", as I said earlier, add this:
Code:
AddDialogExitQuest("Dark_Assassin_Quest");
inside case "Dark_Assassin_dialog2". It should perhaps go above the line 'link.l1.go = "Exit";'. It should not go into case "Exit".

Why is "pirate_dialog.c" trying to trigger quest case "Redhair_joins"? Apart from doing it wrong, that is - again, put case "Exit" back the way it is in "blank_dialog.c" and put an AddDialogExitQuest line inside case "Alliance_dialog1". But if "pirate_dialog.c" triggers quest case "Redhair_joins" then, when you've finished talking to the pirate, Redhair Shanks will suddenly join you. I suspect that this character seems only to be telling you where to find the Dark Assassin. If so, you don't need to trigger any quest case from this dialog. When you have finished talking to the character, you will walk to the canyon and talk to the Dark Assassin. That will then trigger his fight. (You may also want to change the case names. "pirate_dialog.c" is probably nothing to do with any alliance. Make the case names mean something relating to the pirate.)

Also in "pirate_dialog.c", check your line numbers. Case "First time" gives the player the choice of DLG_TEXT[1] and DLG_TEXT[2]. Remember, there is 2 difference between a DLG_TEXT number in the "dialog.c" file and the actual line number in the "dialog.h" file, which means those correspond to lines 3 and 4 in "pirate_dialog.h". You've given the player the choice of saying "I'm looking for the owner of the Dark Katana sword that my swordsman needs." and ". My Capitan went down here alone to defeat the Dark Assassin. But he did not come back. I just heard a scream." You probably want the alternative answer to be "I just got lost!." See if you can work out the correct DLG_TEXT number for that.

"Trafalgar_allianz_dialog.c" looks as though it will be fine if you put case "Exit" back the way it was and add an AddDialogExitQuest line in case "Alliance_dialog1".

I can not read "Shanks_allianz_dialog.c" or "Shanks_allianz_dialog.h". Dropbox thinks I am not allowed to read them. The last version of "Shanks_allianz_dialog.h" which I could read was the same as the version of "Trafalgar_allianz_dialog.h" at that time. If the "Shanks_allianz" files are the same as the "Trafalgar_allianz" files then the same applies - put case "Exit" back to how it should be and use AddDialogExitQuest to trigger quest case "Redhair_joins".
 
Almost there. You need both the AddDialogExitQuest and the link.l1.go = "Exit"; lines. Leave the AddDialogExitQuest lines where they are and put the link.l1.go lines back. For example, here's "Dark_Assassin_dialog.c". You need to change "Shanks_allianz_dialog.c" and "Trafalgar_allianz_dialog.c" the same way.

"Trafalgar_allianz_dialog.h" has comments referring to Shanks. They won't prevent the dialog from working because the game ignores comments. But if you're going to add comments, you may as well make them correct - this file is for Trafalgar D. Law, not Redhair Shanks!

"Pirate_dialog.c" has no AddDialogExitQuest line, which is fine as it does not need one. Leave this file alone, it should work as it is.
 

Attachments

  • Dark_Assassin_dialog.c
    1.7 KB · Views: 84
Back
Top