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

A start for the "Master and Commander" storyline

His dialog and your answers all go in the same file.
Try looking at an existing dialog and see how it's built up.
Did anyone point you to the old Wiki yet? It's still relevant for this kind of things.
http://robotsdontbleed.com/wacko/wakka.php?wakka=POTCwiki
 
Thank you, Mr. Boelen, i will take a look at that sometime.

There are so many things to do in this very first scene that im very excited to keep working on this.

Now, another question. How do i make the main character (Jack Aubrey) to sit down at the table and start to chat with Stephen Maturin? Also, since the chat is too long, i plan to make the screen become dark for a moment and then the chat restart in an important point.
 
For the sitting dialog, have a look at this code from the Jack Sparrow storyline opening:
Code:
		case "Take_a_seat_BB":
LAi_SetActorType(characterFromID("Storyteller"));
LAi_ActorSetSitMode(characterFromID("Storyteller"));
LAi_fade("Take_a_seat_BB2", "Take_a_seat_BB3");
break;

case "Take_a_seat_BB2":
LAi_SetSitType(pchar);
ChangeCharacterAddressGroup(pchar, "Tortuga_tavern", "sit", "sit4");
break;

case "Take_a_seat_BB3":
Characters[GetCharacterIndex("Storyteller")].dialog.currentnode = "Tavern_Story2";
LAi_ActorDialog(characterFromID("Storyteller"), pchar, "", 0.0, 0.0);
break;
 
I guess i will have to take a look at that wiki before i start working with the dialogs. I understand almost nothing :shrug
 
ActorType is a character type that allows you to make him do things, such as start dialogs.
ActorSetSitMode makes the guy sit, but still allows you control to start dialog.
SetSitType on the pchar (player) makes the player sit.
ChangeCharacterAddressGroup on the pchar makes the character move to another place (such as on the chair).
dialog.currentnode is needed for setting up the correct dialog text to start with.
ActorDialog makes the other character start a dialog with the player.
 
So, is it correct?

//#include "DIALOGS\Stephen Maturin_dialog.h"
void ProcessDialogEvent()
{
ref NPChar, PChar, d;
PChar = GetMainCharacter();
aref Link, Diag;
string NPC_Meeting;

DeleteAttribute(&Dialog,"Links");

makeref(NPChar,CharacterRef);
makearef(Link, Dialog.Links);
makeref(d, Dialog);
makearef(Diag, NPChar.Dialog);


switch(Dialog.CurrentNode)
{
// -----------------------------------Äèàëîã ïåðâûé - ïåðâàÿ âñòðå÷à
case "Take_a_seat_BB":
LAi_SetActorType(characterFromID("Stephen Maturin"));
LAi_ActorSetSitMode(characterFromID("Stephen Maturin"));
LAi_fade("Take_a_seat_BB2", "Take_a_seat_BB3");
break;

case "Take_a_seat_BB2":
LAi_SetSitType(pchar);
ChangeCharacterAddressGroup(pchar, "Redmond_tavern", "sit", "sit5");
break;

case "Take_a_seat_BB3":
Characters[GetCharacterIndex("Stephen Maturin")].dialog.currentnode = "Stephen Maturin";
LAi_ActorDialog(characterFromID("Stephen Maturin"), pchar, "", 0.0, 0.0);
break;

case "Exit":
DialogExit();
break;
}
}
 
No, that is not where you put that code, that code that Pieter pointed you to is from the Jack Sparrow quest_reaction.c file (which is the main code file)

Dialog files look more like this:
Code:
void ProcessDialogEvent()
{
ref NPChar;
aref Link, Diag;

DeleteAttribute(&Dialog,"Links");

makeref(NPChar,CharacterRef);
makearef(Link, Dialog.Links);
makearef(Diag, NPChar.Dialog);

ref PChar;
PChar = GetMainCharacter();
ref lcn = &Locations[FindLocation(PChar.location)];

Npchar.nation = Characters[getCharacterIndex("St John's Commander")].nation;

switch(Dialog.CurrentNode)
{
case "First time":
Dialog.defAni = "dialog_stay1";
Dialog.defCam = "1";
Dialog.defSnd = "dialogs\0\017";
Dialog.defLinkAni = "dialog_1";
Dialog.defLinkCam = "1";
Dialog.defLinkSnd = "dialogs\woman\024";
Dialog.ani = "dialog_stay2";
Dialog.cam = "1";

link.l1 = DLG_TEXT[0] + GetMyFullName(PChar) + DLG_TEXT[1];
link.l1.go = "test";
break;

case "test":
Dialog.text = DLG_TEXT[2];
link.l1 = DLG_TEXT[3];
link.l1.go = "exit";
break;

case "Exit":
DialogExit();
Diag.CurrentNode = Diag.TempNode;
break;
}
}
the number after DLG_TEXT refers to the file of the same name in the Dialogs/ENGLISH folder (the first line is 0 and ever line after goes up by 1)
Code:
Characters[GetCharacterIndex("[charc id]")].dialog.currentnode = "test";
would make it go straight to the dialog in case "test" and if not then it would go to First Time and then when you select the dialog will then move onto test...
Code:
link.l1.go = "test";
Makes this happen
 
Try copying an existing dialog file and edit that to get some text for Maturin.
Then make him use that dialog and see if it works.
Don't bother with sitting stuff until you got that sorted.
Once you understand the workings of the dialog system a bit,
you can continue with the quest coding for the sitting and the automatic dialog start.
 
Lets start again so i can organize my head.

I want the main character to go to the place where Stephen Maturin is sitting and join him in the dinner/chat. The chat goes one until the screen fade to black and return some minutes later at the moment Stephen reveals himself a physicist with surgeon skills. Then the chat continues and in the end, the main character manages to convince Stephen Maturin to join the crew as the Surgeon Officer.

That done, the main character leaves the tavern, so does Stephen Maturin. And the Quest Log is supposed to update to the next step of the quest.

Now, which files do i have to work with to make all this to happen?

How do i make the dialogs to work? I have to make the "Stephen Maturin_dialog" codes and make the dialog in the ENGLISH folder? Just that? Or there is another file that i must create/edit yet?
 
Try copying an existing dialog file and edit that to get some text for Maturin.
Then make him use that dialog and see if it works.
Don't bother with sitting stuff until you got that sorted.
Once you understand the workings of the dialog system a bit,
you can continue with the quest coding for the sitting and the automatic dialog start.

Exactly what im trying to do right now, but i dont know what to edit...
 
You need to make the dialog code file in the DIALOGS folder. Then the dialog text file in DIALOGS\English.
Try to base his dialog on a simple other file, for example PROGRAM\Storyline\LegendJackSparrow\dialogs\witness-dialog.c.
Take that .c and accompanying .h file in the \English folder, rename them to "Stephen Maturin_dialog" and put them in your DIALOGS folder.
Change the text in the .h file to something like "Hello, I'm Stephen Maturin",
then make Stephen use that dialog file through the character init entry that you have already made.
Start a new game, go and find him in the tavern and he should now say "Hello, I'm Stephen Maturin".

I wouldn't recommend using Enc_Officer_dialog, because that's got too much stuff in there already.
 
First step, done! :onya

Now i have to edit the dialog to my story.

Thank you very much for your patience, Mr. Boelen. :dance
 
In the dialog file you pointed as example is written:

//#include "DIALOGS\witness-dialog.h"
void ProcessDialogEvent()
{
ref NPChar;
aref Link, NextDiag;

DeleteAttribute(&Dialog,"Links");

makeref(NPChar,CharacterRef);
makearef(Link, Dialog.Links);
makearef(NextDiag, NPChar.Dialog);

ref PChar;
PChar = GetMainCharacter();


switch(Dialog.CurrentNode)
{
// ----------------------------------- Äèàëîã ïåðâûé - ïåðâàÿ âñòðå÷à
case "First time":
Dialog.defAni = "dialog_stay1";
Dialog.defCam = "1";
Dialog.defSnd = "dialogs\0\017";
Dialog.defLinkAni = "dialog_1";
Dialog.defLinkCam = "1";
Dialog.defLinkSnd = "dialogs\woman\024";
Dialog.ani = "dialog_stay2";
Dialog.cam = "1";
Dialog.snd = "dialogs\0\009";

dialog.text = DLG_TEXT[0];
Link.l1 = DLG_TEXT[1];
Link.l1.go = "node_1";
break;

case "node_1":
dialog.text = DLG_TEXT[2];
link.l1 = DLG_TEXT[3];
link.l1.go = "node_2";
break;

case "node_2":
AddDialogExitQuest("ex_dialog2_5");
DialogExit();
NextDiag.CurrentNode = NextDiag.TempNode;
break;

}
}


It worked, but i want to enlarge this dialog to 12 lines, but i wasnt successfull.

Any suggestion?
 
The top of the .h file has a number
Code:
string DLG_TEXT[4] = {         //4
"I was sitting in the tavern when this happened.",
"Tell me what you know.",
"Not long before you came to the tavern, a man left the room. I can recall the look of his face, and he was a slaver, for sure.",
"Thanks.",

};
I have put it after the // :yes
To make it 12 lines change the 4 to a 12, write the new lines in quotes (MAKE SURE YOU HAVE A , AFTER IT)
if you want the lines to continue after node_1 change
Code:
case "node_2":
AddDialogExitQuest("ex_dialog2_5");
DialogExit();
NextDiag.CurrentNode = NextDiag.TempNode;
break;
To case "exit": and then have "node_2" use
Code:
case "node_2":            //2
dialog.text = DLG_TEXT[4];
link.l1 = DLG_TEXT[5];
link.l1.go = "node_3";         //3
break;
The numbers that I have highlighted wit the // again will increase every time you want new lines until you want it to finish then instead of link.l1.go = "node_#" change it to link.l1.go = "exit"
 
Here is the file i did, but it wont work yet.

//#include "DIALOGS\Stephen Maturin_dialog.h"
void ProcessDialogEvent()
{
ref NPChar;
aref Link, NextDiag;

DeleteAttribute(&Dialog,"Links");

makeref(NPChar,CharacterRef);
makearef(Link, Dialog.Links);
makearef(NextDiag, NPChar.Dialog);

ref PChar;
PChar = GetMainCharacter();


switch(Dialog.CurrentNode)
{
// ----------------------------------- Äèàëîã ïåðâûé - ïåðâàÿ âñòðå÷à
case "First time":
Dialog.defAni = "dialog_stay1";
Dialog.defCam = "1";
Dialog.defSnd = "dialogs\0\017";
Dialog.defLinkAni = "dialog_1";
Dialog.defLinkCam = "1";
Dialog.defLinkSnd = "dialogs\woman\024";
Dialog.ani = "dialog_stay2";
Dialog.cam = "1";
Dialog.snd = "dialogs\0\009";

dialog.text = DLG_TEXT[0];
Link.l1 = DLG_TEXT[1];
Link.l1.go = "node_1";
break;

case "node_1":
dialog.text = DLG_TEXT[2];
link.l1 = DLG_TEXT[3];
link.l1.go = "node_2";
break;

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

case "node_3":
dialog.text = DLG_TEXT[6];
link.l1 = DLG_TEXT[7];
link.l1.go = "node_4";
break;

case "node_4":
dialog.text = DLG_TEXT[8];
link.l1 = DLG_TEXT[9];
link.l1.go = "node_5";
break;

case "node_5":
dialog.text = DLG_TEXT[10];
link.l1 = DLG_TEXT[11];
link.l1.go = "node_6";
break;

case "node_6":
dialog.text = DLG_TEXT[12];
link.l1 = DLG_TEXT[13];
link.l1.go = "exit";
break;

case "exit":
AddDialogExitQuest("ex_dialog2_5");
DialogExit();
NextDiag.CurrentNode = NextDiag.TempNode;
break;

}
}
 
Back
Top