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

Fixed Jack Sparrow: Improvements to Maximus and Philippe Quest

"Blaze" is the default player character ID and basically is always that for every player, even for Jack Sparrow.
There is only one (temporary) exception that I know of, but it isn't relevant to you so I won't bother you with it. ;)

The Dialog.Currentnode should match with the case name in the dialog file that you want to trigger upon starting the dialog.

On the SelfDialog line, you can normally leave the "" as-is.
Though it should also be possible to define a quest case there (NOT a dialog case) that will be run when the dialog closes.
I think @Grey Roger has used it like that recently.
 
@Grey Roger Strange enough I find cases in Blaze dialog.c which don't have that Link.l1=DLG_TEXT[xxx]; line :confused:
I don't know how it works, then. One such case is "calling_the_black_pearl", which calls for text line 274, which is "[The cursed coin in the necklace around Elizabeth's neck has called the Black Pearl]". Can anyone who has played "Jack Sparrow" remember what, if anything, you say to yourself in answer to that?

@jack sparring: for code purposes, the player is always "Blaze". This was to be your character's name in "Sea Dogs 2" before your name was changed to "Nathaniel Hawk" and the game's name was changed to "Pirates of the Caribbean" and I'm guessing it's hard-wired into the underlying engine which we can't mess with, so you're always going to be "Blaze". Having said that, 'characters[GetCharacterIndex("Blaze")]' presumably yields your character's ID number, which I believe is also stored as "pchar" (or "Pchar", or "PChar" - apparently capital and lower case don't matter). So 'Pchar.dialog.currentnode = "skectch_cliff_found";" should also work. 'Pchar.dialog.currentnode = "Francis_sword";' certainly works, it's from the code for the "Angelique Moulin's Father" side quest and I've played that.

What comes after "dialog.currentnode" must match up with the case name in the "dialog.c" file because that's telling the program where in the "dialog.c" file to look. I find it helpful to copy what I put after "dialog.currentnode" and paste it into the "dialog.c" file.

What goes into 'LAi_ActorSelfDialog(Pchar, "xxxx");' is the name of the next case in "quests_reaction.c". Alternatively, they seem to have "player_back" in there, which calls a piece of code in "PROGRAM\QUESTS\quests_common.c" which resets the choice of dialog file to be the default one in case you've been using something else. (Right at the start of "quest.c" is a selfdialog using "Storyteller_dialog.c", which ends with a call to "player_back" so that any further selfdialog uses the default "blaze_dialog.c".) So another way of directing a dialog to lead to a quest case is to have a line in "blaze_dialog.c" (or whichever other dialog file you're using), 'AddDialogExitQuest("quest_case_name");'.

If you want the conversation to extend to another case inside the "dialog.c" file, which you'll have to do if you want it to be more than a couple of lines, 'Link.l1.go = "next_dialog_case";' is the way to do it.

Have a look at a couple of other dialog files and try to trace what they're doing - that's how I've been figuring it out. ;)
 
@jack sparring I think the most already have been said except one thing you asked:
You noticed that I used the same name for the case and the currentnode. That's a personal
choice and doesn't have to be so at all.
 
for code purposes, the player is always "Blaze". This was to be your character's name in "Sea Dogs 2" before your name was changed to "Nathaniel Hawk" and the game's name was changed to "Pirates of the Caribbean"
Very true. "Blaze" refers to "Blaze Devlin", who was meant to be the main character of Sea Dogs 2.
He then went on to become the main character in Age of Pirates instead, but got the name of "Blaze Sharp" for the Western release of the game.
His last name is taken from the main character of the first Sea Dogs game, "Nicholas Sharp".
PotC also has a reference to the same character, because you can get the "Sabre of Nicholas Sharp" from Toff Oremans in Kralendijk.

I'm guessing it's hard-wired into the underlying engine which we can't mess with, so you're always going to be "Blaze".
Actually, it IS possible to change it and that actually happens at one point in the Standard storyline too.
There just never was any real need for us yo change it at any point because the player doesn't ever see that ID.
Just changing the name and character model has been convincing enough. :cheeky

Having said that, 'characters[GetCharacterIndex("Blaze")]' presumably yields your character's ID number
Technically, GetCharacterIndex("Blaze") returns that ID number. By using that in the characters[] array like in your example, you can get the actual reference to the character.
That works with non-player characters too.

While PChar is often used to refer to the player, depending on where you are in the code, that could also be "mc", "pc", "MainCharacter" or any other number of variants.
This needs to be defined at the top of whatever function you're in with a line like:
Code:
ref PChar = GetMainCharacter();
That is effectively the same as:
Code:
ref PChar = &characters[GetMainCharacterIndex()];
And also:
Code:
ref PChar = &characters[GetCharacterIndex("Blaze")];
That may be a bit too much information though, so feel free to skip over this. :wp

"Pchar", or "PChar" - apparently capital and lower case don't matter
Indeed apart from very few specific examples, the game code is not case-dependent, so you can use those and also "pchar" interchangeably.

Alternatively, they seem to have "player_back" in there, which calls a piece of code in "PROGRAM\QUESTS\quests_common.c" which resets the choice of dialog file to be the default one in case you've been using something else.
Right again, though that "resetting of the dialog filename" is a bonus effect that I added not so long ago.
The main purpose of the "player_back" quest case is to set the player to PlayerType again (instead of, for example, ActorType) and therefore effectively returns control to the keyboard.
 
this is the last effort to make it work but i still can't make a different line appear after the delay. if i can't get it to work today i will just drop it as i think i am wasting your time with this little whim of mine :( while you probably have more important thing to do.

let's start from this part from the "quest_reaction.c" (the case "Philippe_and_Maximus_get_Doctor" is the one i changed):
Code:
case "Maximus_Philippe_to_XXXXX":
            characters[GetCharacterIndex("Captain Maximus")].Dialog.Filename = "Captain Maximus_dialog.c";
            LAi_SetActorType(characterFromID("Captain Maximus"));
            LAi_ActorDialog(characterFromID("Captain Maximus"),PChar,"",5.0,5.0);
            Characters[GetCharacterIndex("Captain Maximus")].dialog.currentnode = "Going_for_the_Doctor";
        break;

        case "Philippe_and_Maximus_get_Doctor":
            LAi_SetActorType(pchar);
            RemoveCharacterCompanion(pchar, characterFromID("Captain Maximus"));
            RemoveCharacterCompanion(pchar, characterFromID("Captain Philippe"));
            LAi_ActorRunToLocator(characterFromID("Captain Philippe"), "goto", "goto12", "",14.0);
            LAi_ActorRunToLocator(characterFromID("Captain Maximus"), "goto", "goto12", "",14.0);
            characters[GetCharacterIndex("Blaze")].Dialog.Filename = "blaze_dialog.c";
            characters[GetCharacterIndex("Blaze")].dialog.CurrentNode = "Isla_muerta_alone";
            LAi_ActorSelfDialog(pchar, "");
        break;

        case "Another_local_option":
            LAi_SetImmortal(Pchar, true);
...

the part from the "Captain Maximus_dialog.c" the first case goes to:
Code:
case "Going_for_the_Doctor":
            dialog.snd = "Voice\ARGU\ARGU001";
            dialog.text = DLG_TEXT[12];
            link.l1 = DLG_TEXT[13];
            link.l1.go = "Exit_Going_for_the_Doctor";
        break;

        case "Exit_Going_for_the_Doctor":
            DialogExit();
            NextDiag.CurrentNode = NextDiag.TempNode;
            AddDialogExitQuest("Philippe_and_Maximus_get_Doctor");
        break;

the part from the "blaze_dialog.c" i wrote:
Code:
case "Isla_muerta_alone":
        Dialog.Text = DLG_TEXT[306];
        Link.l1= DLG_TEXT[307];
        Link.l1.go = "exit";
        AddDialogExitQuest("Another_local_option");
    break;

and here is how many lines are in "blaze_dialog.h" i'm not sure if the numbers i put are correct in the '.c' file above and in the top here:
Code:
string DLG_TEXT[308] = { <---1
"Oh, it's you, ", <---2
". What are you doing here?", <---3
...
"No wait! No, no. Oi! No, no! Wait, I said! Ahhhhh! Now what?" <---308
"..."  <---309
}; <---310

the last lines here are supposed to be the ones i want to put in the "isla_muerta_alone" case
 
If you want to use text lines nr 309 and 310 the number of text lines in a dialog.h must be at least 311.

An example
if the beginning of Blaze_dialog.h looks like this:

Code:
string DLG_TEXT[323] = {
"Oh, it's you, ",
". What are you doing here?",

it means the first line has nr 0 and the last line nr 322.




So in your example it should start like this:

"Oh, it's you, ", <---- 0
". What are you doing here?" <---- 1




In a dialog.h file you can't have those comments marked in red. But you can have

"Oh, it's you, ", //0
". What are you doing here?" //1




which can be useful to keep track of which line is which:

Code:
"But grandma, we have no crew -",
"- the only ones loyal are the deaf cannon crew!",//97
 
Maybe if you only count the real text lines (strings).

this one doesn't count
string DLG_TEXT[323] = {

not this one at the end either
};

string DLG_TEXT[323]
means there are 323 text lines (strings) that can be used as dialog phrases.
Their numbers when used in a dialog.c are from 0 to 322. which will be 322 + 1 = 323.
 
If at some point you really can't figure it out, be sure to upload the file changes you did make along with the savegame you've been using.
I'm sure it can be figured out. :onya
 
i give up. i can't figure it out :modding
i don't see how my files can help, they are probably a mess. if anyone else wants to try it better start from the original which we know they work. mine don't. and the savegame is in the first page. it's from just outside the cave.
 
Please upload them :).
We all started like this figuring it out. If you upload it we can take a look at your work and correct it and show you where you went wrong :).
Starting with modding like this is hard, especially without prior coding knowledge.
 
ok so this is just the last version of the files. i have added/removed lines and cases i don't even know how many times trying things out.
 

Attachments

  • quests_reaction.c
    398.9 KB · Views: 107
  • blaze_dialog.c
    30.4 KB · Views: 116
  • blaze_dialog.h
    20.1 KB · Views: 129
If you please could hint where in quest_reaction.c the troublesome action occurs.
Is it in JackSparrow to start with?
 
A quick look in blaze_dialog.h shows that the 2 last lines are missing a , at the end.

"No wait! No, no. Oi! No, no.! Wait, I said! Ahhhhh! Now what?"
"..."

Try this first and see if it's enough.
 
Ah, Talisman had the same issue when he first started adding lines to dialog files.
Easy mistake to make, but the game code doesn't understand. :facepalm
 
ok, so i was a little pissed off to write actual words before. probably lost a couple of hours for each of these ,
it does work now. if i wasn't pissed off i probably would've been proud of myself...
 
Back
Top