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

WIP Dialogs: Spelling Errors

Questbook entries are here:
..\RESOURCE\INI\TEXTS\ENGLISH\QUESTBOOK

About dialog files. You are correct, to add dialog options you need to add them in the .c files.
Here you see an piece of code from a dialog file:
Code:
        case "Meeting_4":
            d.Text = DLG_TEXT[37];
            Link.l1 = DLG_TEXT[38];
            Link.l1.go = "Meeting_5";
        break;

        case "Meeting_5":
            d.Text = DLG_TEXT[39];
            Link.l1 = DLG_TEXT[40];
            Link.l1.go = "Meeting_6";
        break;

Everythin in switch(Dialog.CurrentNode) will be called if the "node" is there.
These nodes are listed in the case.
So say the dialog node was "Meeting_4" then the first block of code is executed.

d.Text is the dialog text which is shown in the dialog box. DLG_TEXT[37] is an array call. All dialog lines (for this character are stored in DLG_TEXT and it now takes number 37 and shows it. Note that an array starts at 0. so the first line in a dialog .h file is DLG_TEXT[0].
The Link.l1 is the text which is shown. if you want to add a second line make sure you make the number higher. so for example Link.l2. The dialog lines will always be sorted based on the numbers.
the Link.l1.go is the node which has to be called next. So in this case it calls "Meeting_5". So if you select this dialog line the next dialog will show the second block of code.
I hope this is clear?
1 more thing to note. At the top of the .h file you'll see a number also. This is the amount of dialog lines stored in the Array. Make sure if you add lines you also change this number. It's no problem if its a bit to large, but the higher it is the more memory it will use. So please try to have it as close to the amount of lines as possible.

I sugest you edit your code with a program like Notepad++ because it will show the syntax nicely colored and helps you write your code easier with sugestions.

This reminds me I should really start working on a potc coding tutorial again...
 
@Grey Roger so far i am only fixing errors as i encounter them ingame so i was not always fixing the full file or checking for the same in others even though i suspected most are copy-paste from the same origin.
Same here, which is why you still found errors in "SantoDomingo citizen_dialog.h". I didn't go through the whole thing at the time, just concentrated on the bits I was working on, which at that time were rumours and dialogs (the bit about the church in the village is mine ;)).
i have started making a few changes to jack sparrow dialogues while playing and now i reached the part with Couch Captain Charles. Ok by the name alone i figured jack would have a comment or two about this so i need to know how to add dialogue lines. i guess i should also change something in the '.c' files or something?
Yes, and here's where it can get a little complicated because they're scattered around. Dialog.c files can be either in "PROGRAM\DIALOGS" or in "PROGRAM\Storyline\<name of story>\dialogs", with the corresponding dialog.h in subdirectory "ENGLISH". The one you're after is "PROGRAM\Storyline\JackSparrow\dialogs\Couch Captain Charles_dialog.c" and its corresponding text file is "PROGRAM\Storyline\JackSparrow\dialogs\ENGLISH\Couch Captain Charles_dialog.h". In the dialog.c file you'll find things like this:
Code:
    case "Get_me_Out_of_here":
       dialog.text = DLG_TEXT[2];
       link.l1 = DLG_TEXT[3];       
       link.l1.go = "Get_me_Out_of_here2";
     break;   

     case "Get_me_Out_of_here2":
       dialog.text = DLG_TEXT[4];
       link.l1 = DLG_TEXT[5];       
       link.l1.go = "Get_me_Out_of_here3";
     break;

The "dialog.text" line is what the other person says, the "link.l1" line is what you say in response, and the "link.l1.go" line is where program execution goes next - in this instance, straight to the next case section. "DLG_TEXT[x]" refers to line x within the dialog.h file, so in "Get_me_Out_of_here", he says "Who are you?" and you answer "A friend of Captain Petros and Sir Christopher Mings.". It then proceeds to "Get_me_Out_of_here2", in which he says line 4 ("And who are they?") and you answer line 5 ("Members of the Brotherhood."). And so on. You can change what they say by editing the dialog.h file, but if you want to add an extra line then you'll need to insert a case section into the dialog.c file. Suppose, for instance, you wanted to insert a bit to make Jack seem drunk. So you'd add a new case section:
Code:
  case "Get_me_Out_of_here_new":
    dialog.text = DLG_TEXT[28];
       link.l1 = DLG_TEXT[29];       
       link.l1.go = "Get_me_Out_of_here2";
  break;
And then you'd need to change the "link.l1.go" line in "Get_me_Out_of_here" to point at your new section by making it 'link.l1.go = "Get_me_Out_of_here_new";' The reason for picking lines 28 and 29 is that there are 28 lines of text in "Couch Captain Charles_dialog.h", but dialog.c files count from 0, so you'll be adding lines 29 and 30. Either that or you'll need to insert two new lines in the middle of the file, renumber everything which comes after, and then change all the "DLG_TEXT" lines which refer to the renumbered text. Adding your new stuff to the end is much easier. :)

And now you need to add those two new lines. You'll also need to change the line at the top of "Couch Captain Charles_dialog.h", which currently says 'string DLG_TEXT[28] = {' because there are currently 28 lines. So you'd change the 28 to 30, and then add your two new lines before the '};' which ends the file.

also i need to know the location of the quest book updates file, i have some ideas on gradually adding some comments in the updates without changing the already existing intsructions.
"RESOURCE\INI\TEXTS\ENGLISH\Storyline\JackSparrow\QUESTBOOK". The only way you'll add comments without changing existing instructions is to extend some of the existing lines. Note that this won't have any effect unless you reload a savegame from before the quest started because that's when the questbook file seems to be read.
 
To explain the storyline and normal dialogs.

A character normally always gets his dialog from the DIALOG folder in PROGRAM.
But some storylines require to add stuff to the dialog. They can do this in 2 ways. They can replace the dialog file with theire own. This is done by adding a dialog file of the same name in the storyline/dialog folder. Now only this one is used.

We also have a system in place where multiple dialog files are used. You will mostly see this used for store owners and taverns etc, to have a shared part only appear once in a file so its easier to edit. Storylines can use this too. but this is a fairly new addition to the dialog system so don't expect to find that yet.
 
OK, so @Levis finished his explanation first. :D

So now some more experienced coders are here, perhaps one of you can look at "Couch Captain Charles_dialog.c" because either I've got a duff copy, I'm missing something, or it's missing something. "Couch Captain Charles_dialog.h" has 28 lines of text but "Couch Captain Charles_dialog.c" doesn't seem to reference the last two - I see no 'DLG_TEXT[26]' and 'DLG_TEXT[27]'. Moreover, case "Arrival_at_Jamaica2" wants to exit via "ExitJamaicaArrival" and I can't see that either.
 
This is an example of what I warned for already. The array has 28 slots, but beware. I've added some numbering in the code file to explain

Code:
string DLG_TEXT[28] = {
"We are sailing... We are saaaailing...",   --------- 0
"You really like that song don't you!",    --------- 1
"Who are you?",
"A friend of Captain Petros and Sir Christopher Mings.",
"And who are they?",
"Members of the Brotherhood.",           --------- 5
"Ah! So at least you are friends. What are you doing here?",
"Captain Petros told us to come and find you.",
"Well I must say, that was rather splendid of him. Can you get me away from here?",
"That is the general idea. By the way, do you have part of an old map on you?",
"I did have, but they took it off me when I was captured.",   ----------- 10
"Blast! Well it can't be helped, I suppose.",
"Yes, some Captain by the name of Barbossa bought it off the guards. He has it now, and must know something about where it leads.",
"Barbossa! Well, well. I have had the pleasure of meeting him.",
"What should we do about it then?",
"Nothing for now. Let's get you back to Petros first. I have have a plan for Barbossa which I will implement later.",   --------- 15
"The last I heard she was in Jamaica. The problem with that is that it is an English Island, and there is no way we could just sail in there under the pirate flag, unless we had some help.",
"What help is that then?",
"I will ask some other members of the brotherhood to join us. That way we will have a fleet of our own. We can either try to take the town, or land on a deserted beach. All we need to do after that is find your sister. Do what you need now, we will meet you at the dock.",
"That sounds quite logical. I will make ready to sail.",
"Are you ready to sail then?",  ------------- 20
"Yes, We're ready. Let's go.",
"Well I must say that was quite a trip. We'd better get on with the matter at hand though. We cannot stay here long, the King's ships will soon be upon us. You are on your own now. Good luck!",
"Oh! Yes, I understand. I suppose we should go to the Tavern to see what we can find out?",
"No, no! I have contacts here you know. We are part of the same band of brothers, so to speak. You need to find XXXXXXXXXXX and mention my name.",
"Oh! I see. Well, I hope you all get back safely.",   --------- 25
"We will.",
"Goodbye, and thanks.",   --------- 27
};

And checking the dialog file itself the last two indeed aren't used.
They might have been in the past, but they aren't anymore now.
This could very well be because a lot of modding is done by inexperienced people so they try to copy paste as much as possible. So they just left this in because they where afraid removing it had unforseen concequenses.

And your right about the exit not existing. but it seems the "Arrival_at_Jamaica" case isn't called either. I can't find a reference in the dialog file or in the questfiles (where the node could also be set).
 
And checking the dialog file itself the last two indeed aren't used.
They might have been in the past, but they aren't anymore now.
This could very well be because a lot of modding is done by inexperienced people so they try to copy paste as much as possible. So they just left this in because they where afraid removing it had unforseen concequenses.

And your right about the exit not existing. but it seems the "Arrival_at_Jamaica" case isn't called either. I can't find a reference in the dialog file or in the questfiles (where the node could also be set).
Indexing is wonderful. It means I don't need to search the entire PoTC folder, I can get Windows to do the search for me. :D

"Arrival_at_Jamaica" is indeed called in "quests_reaction.c". Just not in Jack Sparrow's one. ;) Couch Captain Charles also makes an appearance in "Devlin Opera", which is where "Arrival_at_Jamaica" is called, so anyone who wants to work on that story will need to watch out for this...
 
Indexing is wonderful. It means I don't need to search the entire PoTC folder, I can get Windows to do the search for me. :D

"Arrival_at_Jamaica" is indeed called in "quests_reaction.c". Just not in Jack Sparrow's one. ;) Couch Captain Charles also makes an appearance in "Devlin Opera", which is where "Arrival_at_Jamaica" is called, so anyone who wants to work on that story will need to watch out for this...
In Develin Opera there is another dialog file for him where the exit does exist ;).
 
Probably then the Jack Sparrow version started out as a copy of the Devlin Opera one that didn't get properly cleaned up.
I assume that the "Arrival_at_Jamaica" case isn't actually used for Jack Sparrow.
 
In Develin Opera there is another dialog file for him where the exit does exist ;).
True enough. But even there, the last two lines of the dialog.h file do not seem to be used. My guess is that there was, or was intended to be, "Arrival_at_Jamaica3" which would have led to "ExitJamaicaArrival" and would have used those lines, but it was either removed to make the end dialog shorter or was never added in the first place.
 
There is definitely some measure of "unfinished code" in Devlin Opera, Jack Sparrow and also Hornblower.
They all were brought to a relatively playable state, but somewhat "abandoned" afterwards.
 
well @Grey Roger is now working on fixing hornblower I believe.
Maybe if we are lucky @jack sparring will eventually start fixing the jack sparrow storyline more :p.
I still want to add some things in there too. Especially in the earlier years because the 4th movie added some lore there which isn't incorperated.
 
well @Grey Roger is now working on fixing hornblower I believe.
Definitely!

I still want to add some things in there too. Especially in the earlier years because the 4th movie added some lore there which isn't incorperated.
And I'd like to see DMC added and maybe AWE too.
We have a Kraken, Flying Dutchman AND "jungle church", but they aren't actually put to use yet because the main storyline writers for it disappeared.
If ever I have the chance, I might like to do that. But that is for sure a Build 15 wish of mine.
 
And while you were doing the moving, I was typing in my reply, which therefore ended up here instead of where you'd moved the discussion. ;)

I've copied my reply to the new discussion.
 
Or if you're up for some more straight-forward spelling correcting, I know some other files which are ATROCIOUS!
They are the ones in PROGRAM\DIALOGS\ENGLISH named "random_*_dialog.h" .
These are mainly for the Crewmembers on Shore encounters.
I searched for dialogue files that had either "...crew..." or "...random..." in the title, took a quick look at them, made a few changes in some so here they are. not sure they are 100% (especially where different lines are called to make a full sentence with names in between them) but i think i got most of them.
 

Attachments

  • Crewmember_fight_dialog.h
    2.4 KB · Views: 134
  • gm crew_dialog.h
    4.1 KB · Views: 135
  • KR_crewmember.h
    1.5 KB · Views: 141
  • Lair_crewmember.h
    1.5 KB · Views: 134
  • Lair_crewmember3.h
    774 bytes · Views: 135
  • permanent_crewmember_dialog.h
    775 bytes · Views: 134
and
 

Attachments

  • random_guards_group_dialog.h
    3.2 KB · Views: 119
  • random_patrol_dialog.h
    2.9 KB · Views: 117
  • random_pirates_group_dialog.h
    2.8 KB · Views: 119
  • random_sailors_group_dialog.h
    1.7 KB · Views: 124
  • Random_sailors_sit_tavern_dialog.h
    1.6 KB · Views: 128
Back
Top