Neville

Difficulty with Dialogue

Recommended Posts

Whenever I extract dialogue to edit for my recruit mod, the text disappears when I attempt to go to the dialogue and edit. This occurred in 2015 and this has occurred when I attempt to check dialogue from other recruit mods. I have pre-recruit/recruit dialogue planned, but my tools fail when I attempt to save dialogue. Can someone help?

Share this post


Link to post
Share on other sites
9 hours ago, LoneWanderer said:

What tools did you use to extract and edit dialogs? I'm not sure what your problem is, but did you try to use other tools?
For example, if you used only Kotor Tool, then try to open existing .dlg file or to create new dialogue in DLGEditor (https://deadlystream.com/files/file/750-dlg-editor/) to see whether it'll also bugged for you or not.

I was using KotOR Tool to extract dialogue. All text disappeared when I attempted to edit and save with it. KOTOR Dialog Editor (KOTOR Dialog Editor - Modding Tools - Deadly Stream) failed to recognize .dlg files, but opened the .tlk file with all StrRef files in KotOR.

Share this post


Link to post
Share on other sites
1 hour ago, Neville said:

KOTOR Dialog Editor (KOTOR Dialog Editor - Modding Tools - Deadly Stream) failed to recognize .dlg files

Never used it before. Tried it now, and it couldn't open existing .dlg files because of some error.

 

1 hour ago, Neville said:

I was using KotOR Tool to extract dialogue. All text disappeared when I attempted to edit and save with it.

Funny thing is, this just happened to me too. I never noticed this problem before, because I always use DLGEditor to work with dialogs (I needed to open TSL dialogs and internal dlg editor of Kotor Tool doesn''t work correctly with TSL dialogs).

So, once again, I suggest you download DLGEditor, set up TLK path in File/Set TLK File Path; set up Mod: KOTOR. Then:

1. Extract some .dlg file with KotOR Tool, but don't open it with KotOR Tool after extracting.

2. Launch DLGEditor and open extracted .dlg file, edit and save it.

 

  • Like 1

Share this post


Link to post
Share on other sites

 

4 hours ago, LoneWanderer said:

Never used it before. Tried it now, and it couldn't open existing .dlg files because of some error.

 

Funny thing is, this just happened to me too. I never noticed this problem before, because I always use DLGEditor to work with dialogs (I needed to open TSL dialogs and internal dlg editor of Kotor Tool doesn''t work correctly with TSL dialogs).

So, once again, I suggest you download DLGEditor, set up TLK path in File/Set TLK File Path; set up Mod: KOTOR. Then:

1. Extract some .dlg file with KotOR Tool, but don't open it with KotOR Tool after extracting.

2. Launch DLGEditor and open extracted .dlg file, edit and save it.

 

I was able to open dialog from purchase of HK-47 with DLGEditor, but displays information from strings in the .tlk file. I can replace dialogue lines with lines from other .dlg files. Do I have to add StrRef entries or modify a .dlg file prior to extraction?

Share this post


Link to post
Share on other sites
10 hours ago, Neville said:

I was able to open dialog from purchase of HK-47 with DLGEditor, but displays information from strings in the .tlk file. I can replace dialogue lines with lines from other .dlg files.

So, you managed to open .dlg file, and text is correctly displayed? Then, to edit a line of dialog, you need to change the value of its StrRef field to -1.

 

10 hours ago, Neville said:

Do I have to add StrRef entries or modify a .dlg file prior to extraction?

There are 2 ways to create/modify dialogs: adding lines to dialog.tlk and then using StrRef entries or adding lines directly to .dlg files.

If you don't plan to translate your mod into other languages, then It is easier to work directly with .dlg files without ever touching dialog.tlk .

 

Also, if you need basic tutorial about dialog creation, watch this tutorial by Rece https://www.youtube.com/watch?v=u8tixbfgJ8g

Share this post


Link to post
Share on other sites
6 hours ago, LoneWanderer said:

So, you managed to open .dlg file, and text is correctly displayed? Then, to edit a line of dialog, you need to change the value of its StrRef field to -1.

 

There are 2 ways to create/modify dialogs: adding lines to dialog.tlk and then using StrRef entries or adding lines directly to .dlg files.

If you don't plan to translate your mod into other languages, then It is easier to work directly with .dlg files without ever touching dialog.tlk .

 

Also, if you need basic tutorial about dialog creation, watch this tutorial by Rece https://www.youtube.com/watch?v=u8tixbfgJ8g

Examining other .dlg files (Czerka Protocol Officer, HK-47, Sarna, Sharina, Yuka Laka), I believe I have created, nearly, a new .dlg file. I am trying to find a way to make the recruitable NPC greet the player differently if there was previous interaction and, my intent being to have the NPC replace Bastila, location of Bastila on the Ebon Hawk. I believe the script k_act_talktrue in dialogue makes the NPC respond to the player.

Share this post


Link to post
Share on other sites
44 minutes ago, Neville said:

I am trying to find a way to make the recruitable NPC greet the player differently if there was previous interaction

This is easy. You need to create 2 dialog trees inside your .dlg file: upprer one for the first interaction, lower one for second and later conversations.

After that you need to attach 2 basic scripts (they already exists in the game files, you just need to call them) to the first NPC line of upper dialog tree: "k_con_talkedto" in the “Script that determines availability” field, “k_act_talktrue” in the “Script that fires when spoken” field. Like this:

Spoiler

2090770600_dlgcreation1.jpg.52be30a24a08b6e3a5e50af67ec7c244.jpg

 

1 hour ago, Neville said:

my intent being to have the NPC replace Bastila, location of Bastila on the Ebon Hawk.

You should study existing K1 Recruitment mods like "Recruit Kay". I can't work with K1 resources at the moment, so my help with this will be limited, but I'll post here if I find something useful for you.

Share this post


Link to post
Share on other sites
1 hour ago, LoneWanderer said:

This is easy. You need to create 2 dialog trees inside your .dlg file: upprer one for the first interaction, lower one for second and later conversations.

After that you need to attach 2 basic scripts (they already exists in the game files, you just need to call them) to the first NPC line of upper dialog tree: "k_con_talkedto" in the “Script that determines availability” field, “k_act_talktrue” in the “Script that fires when spoken” field. Like this:

  Hide contents

2090770600_dlgcreation1.jpg.52be30a24a08b6e3a5e50af67ec7c244.jpg

 

You should study existing K1 Recruitment mods like "Recruit Kay". I can't work with K1 resources at the moment, so my help with this will be limited, but I'll post here if I find something useful for you.

As I studied the .dlg files for Sharina Fizark and Yuka Laka, prior to your reply, I had added the scripts you mention. 

Share this post


Link to post
Share on other sites

Ok. Then let's move to replacing Bastila.

I quickly researched several recruitment mods and it seems all you have to do is to write 2 scripts: one to delete npc from module when she is recruited and another to replace party member with your npc. Something like this:

void main() {
	ActionPauseConversation();
	object oNpc_sarna = GetObjectByTag("npc_sarna", 0);
	SetGlobalFadeOut(1.0, 0.5, 0.0, 0.0, 0.0);
	DelayCommand(1.0, DestroyObject(oNpc_sarna, 0.0, 0, 0.0));
	DelayCommand(1.0, SetGlobalFadeIn(0.7, 0.0, 0.0, 0.0, 0.0));
	ActionResumeConversation();
}
void main() {
	RemoveAvailableNPC(0);
	AddAvailableNPCByTemplate(0, "p_sarna");
	DelayCommand(1.5, ShowPartySelectionGUI("", 0xFFFFFFFF, 0xFFFFFFFF, 0));
}

You need to compile the scripts (via Kotor Scripting Tool + nwnnsscomp.exe) and to attach them to the “Script that fires when spoken” fields of dialog lines.

 

But the big question is: At what point in the game do you intend to replace Bastila? She appears in many scenes that can potentially break without her, so you'll need to check them

Share this post


Link to post
Share on other sites
2 hours ago, LoneWanderer said:

Ok. Then let's move to replacing Bastila.

I quickly researched several recruitment mods and it seems all you have to do is to write 2 scripts: one to delete npc from module when she is recruited and another to replace party member with your npc. Something like this:


void main() {
	ActionPauseConversation();
	object oNpc_sarna = GetObjectByTag("npc_sarna", 0);
	SetGlobalFadeOut(1.0, 0.5, 0.0, 0.0, 0.0);
	DelayCommand(1.0, DestroyObject(oNpc_sarna, 0.0, 0, 0.0));
	DelayCommand(1.0, SetGlobalFadeIn(0.7, 0.0, 0.0, 0.0, 0.0));
	ActionResumeConversation();
}

void main() {
	RemoveAvailableNPC(0);
	AddAvailableNPCByTemplate(0, "p_sarna");
	DelayCommand(1.5, ShowPartySelectionGUI("", 0xFFFFFFFF, 0xFFFFFFFF, 0));
}

You need to compile the scripts (via Kotor Scripting Tool + nwnnsscomp.exe) and to attach them to the “Script that fires when spoken” fields of dialog lines.

 

But the big question is: At what point in the game do you intend to replace Bastila? She appears in many scenes that can potentially break without her, so you'll need to check them

I am testing methods of spawning Sarna on Tatooine. She will, due to the Sith destroying Taris while she was still on the planet, state she left the Sith and offer help. Accepting her offer will be similar to Bastila replacing Trask Ulgo after he fights Darth Bandon. I would advise only accepting her offer (joining your party) after Darth Malak captures Bastila on the Leviathan. Most dialogue is complete, and I have made a node in the dialogue to run a recruit script (add_sarna). I have script that should spawn Sarna in the Tatooine docking bay. I may have difficulty with two scripts to recruit. I knew a new character has to be added to the party and the original NPC has to be destroyed, but I am unsure as to how to run two scripts with one command.

Share this post


Link to post
Share on other sites
21 hours ago, Neville said:

I have script that should spawn Sarna in the Tatooine docking bay. I may have difficulty with two scripts to recruit. I knew a new character has to be added to the party and the original NPC has to be destroyed, but I am unsure as to how to run two scripts with one command.

Yes, KOTOR allows to attach only one action script to dialog line (unlike TSL). But this shouldn't cause any troubles: attach "add_sarna" to one dialog line and "bye_sarna" script (that destroys npc_sarna) script to the next dialog line.

Share this post


Link to post
Share on other sites
On 5/22/2021 at 4:06 PM, LoneWanderer said:

Ok. Then let's move to replacing Bastila.

I quickly researched several recruitment mods and it seems all you have to do is to write 2 scripts: one to delete npc from module when she is recruited and another to replace party member with your npc. Something like this:


void main() {
	ActionPauseConversation();
	object oNpc_sarna = GetObjectByTag("npc_sarna", 0);
	SetGlobalFadeOut(1.0, 0.5, 0.0, 0.0, 0.0);
	DelayCommand(1.0, DestroyObject(oNpc_sarna, 0.0, 0, 0.0));
	DelayCommand(1.0, SetGlobalFadeIn(0.7, 0.0, 0.0, 0.0, 0.0));
	ActionResumeConversation();
}

void main() {
	RemoveAvailableNPC(0);
	AddAvailableNPCByTemplate(0, "p_sarna");
	DelayCommand(1.5, ShowPartySelectionGUI("", 0xFFFFFFFF, 0xFFFFFFFF, 0));
}

You need to compile the scripts (via Kotor Scripting Tool + nwnnsscomp.exe) and to attach them to the “Script that fires when spoken” fields of dialog lines.

 

But the big question is: At what point in the game do you intend to replace Bastila? She appears in many scenes that can potentially break without her, so you'll need to check them

I still must analyze the numbers to ensure "n_sarna" is removed properly. I have found the regular positions of characters on the Ebon Hawk (k_pebn_pophawk). A duplicate is referenced whenever a new party member is recruited (HK-47, Jolee). Is there a conditional to put a new character in place? I hoped to make my party member, at the Star Forge, state "That's new to me as well."

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.