Jump to content

Home

I created new dialog in KOTOR!!!


Den Baster

Recommended Posts

Hello comrades and modders

Today we created 1 new dialog in the Kotor

This command run dialog!

void main()

{

object oPC=GetFirstPC();

ActionStartConversation(oPC,"mydlg");

}

 

Dialog edit in the NWN tools and this work!!! Very important compiled dialog and script in ONE module. It is a guarantee that will work!

see screenshot!

http://www.fieldglory.narod.ru/newdialog.htm

Link to comment
Share on other sites

  • 9 months later...

This script will make the npc start a conversation automatically when some event happen. There are many places where you can attach it: this kind of script is used when the npcs start to talk together, when the messengers appears and start talking to the PC, when xors starts talking again after the battle, etc...you can attach it a numerous places depending on what you want to do: to a door, an area enter script, to the userdefined field of the .utc, etc. This is also the kind of script that is fired from spells.2da when you use tk102's vfx armband and my warping and party manager armbands because .uti files do not have a dialogue field.

Link to comment
Share on other sites

Oooooooooold thread! One of the first actually. I checked all the first threads about modding yesterday, it was quite interesting...Today i can create 1 new dialog in kotor during the time of 5 minutes :)

 

 

 

No dialog editors made by tk102 were harmed during the creation of this post.

Link to comment
Share on other sites

Attaching the script to a door won't do the job in this particular case, unless you want the npc to walk towards your pc and start a conversation right when your PC enters the room/area. Are you building a new area? You may need to use a trigger so that when your PC walks in that area, the NPC will initiate conversation.

 

And, The Knife, this thread is old but useful Veldrin found it in it the Do you want to mod SW-Kotor Sticky ;)

Link to comment
Share on other sites

First, place your npc in the placeable list in the .git file (unless you want himto spawn only at certain conditions of course).

 

Then, set a trigger (.utt file) that will make your npc do something when your PC crosses the trigger area. I suggest you use an existing .utt file and modify it in order to avoid mistakes in the field identification and save time. Attach your script that tells the npc to do something to the ScriptOnEnter field.

 

Edit the trigger list of your .git file. It will look something like this: http://img.photobucket.com/albums/v144/Darth333/gitvalues2.jpg

 

This is an extract form an old tutorial I started ages ago but never finished :rolleyes: :

 

o The XYZ Position are the location of the trigger. When you PC crosses this spot, the npc will be spawned

 

o In TemplateResRef: put the same thing as the title of the .utt file (avoid capital letters)

 

o The geometry XYZ points determine the trigger area. Think of an imaginary polygon. I recommend you use 4 coordinates here. If the area is too small, the risks are that if your npc doesn't step exactly on "the spot" you will miss the trigger. If it's too big and it overrides other triggers, then you will have funny effects.

 

If you want to "vizualize" triggers, I suggest you look at an area with the area editor included in Kotor Tool, you'll see then how triggers really work.

 

More info here: http://nwn.bioware.com/developers/Bioware_Aurora_Trigger_Format.pdf

Link to comment
Share on other sites

Sorry but I don't really have time to make a new area for this. However, I could check if I still have the files of a mod I did back then (my recruitable Dustil unfinished light side quest) where I did a similar thing but he was spawned only if the player had recovered the Star Map on Korriban and did not Killed Dustil so his .utc wasn't in the git file (I am not sure if I kept a backup copy of those files when I changed my computer this summer).

 

The script won't work if you don't have the following:

 

make sure you did all the following:

 

1. Create your .utc file for your npc and place it in the .git file (Creatures list)

 

2. Use a trigger (.utt file) and again, place it in the .git file.

 

3. Attach your script in the ScriptOnEnter field:

void main()
{
object oNPC=GetObjectByTag("npc_tag");
object oPC=GetFirstPC();
AssignCommand(oNPC,ActionMoveToObject(oPC));
AssignCommand(oNPC,ActionStartConversation(oPC,"my_dlg"));
}

Link to comment
Share on other sites

I now, but in your screnn and in the git files the geoametry coordinations is etc 0,00000 or -5,644. Why?

 

I like to do someyhing this:

 

 

A----------------------B

i i

i NPC i

i i

i i

C---------------------D

 

An NPC coorinations is etc. X=100, Y=50, Z=5

Link to comment
Share on other sites

I have a few questions.

 

1. If i need a certain NPC to give evasive responses (or the ones without cutscene) to the PC untill some specific event happens, will i need two different dlg files or this can be done in the same dialog tree;

2. If this NPC is placed in a different area. But still in the same plot. Do i need another .utc and another .dlg?

Link to comment
Share on other sites

Originally posted by Xavier2

I have a few questions.

 

1. If i need a certain NPC to give evasive responses (or the ones without cutscene) to the PC untill some specific event happens, will i need two different dlg files or this can be done in the same dialog tree;

2. If this NPC is placed in a different area. But still in the same plot. Do i need another .utc and another .dlg?

 

Alright for question one, you build the dialog with the response. (The one that won't become available until after a certain event)

 

You attach a script to that, which will prevent it from showing up until it's requirements are met.

 

However, I don't happen to have my hands on the particular script at the moment. :rolleyes:

Link to comment
Share on other sites

Originally posted by Xavier2

I have a few questions.

1. If i need a certain NPC to give evasive responses (or the ones without cutscene) to the PC untill some specific event happens, will i need two different dlg files or this can be done in the same dialog tree;

Ok if you want to make a plot that will use different modules and keep track of what is going on, you can use global variables ( if it's for a single dialogue in a module that will not afffect the events in the other modules, use local numbers instead of globals because there will be no need to edit globalcat.2da)

 

 

1. If you are using globals, create a new line in globalcat.2da and use the SetGlobalNumber function to keep track of your plot as explained in this old tutorial concerning journal entries and plot tracking with globals: http://www.lucasforums.com/showthread.php?s=&threadid=129333

 

Example: add the line MY_PLOT to globalcat.2da (in type , put Number)

 

Then when the event happen attach this script somewhere. It can be to a dialogue, when you pc enters an area, when your pc kills a specific npc (then you would have to use the OnDamage flag in the user define script of that .utc file), etc... of course easiest way it to put it in a dialogue. Note, the number 1 number is a random number that is used as a marker, you could use a random serie of numbers to keep track of your plot like 87, 34, 22, 45 to keep track of your plot if you want it doesn't matter but logically it makes things much easier if you use 1, 2, 3, 4, etc.

 

{
   SetGlobalNumber("MY_PLOT", 1);
}

 

then at another stage of your plot you could use:

[code]{
   SetGlobalNumber("MY_PLOT", 2);
}

 

This will make the game remeber where you are.

 

 

2. If you want to make some replies/entries available only if a certain event has occured, then attach a conditional script in the active field of the 'RepliesList' in the EntryList that checks where your global is and, depending on the result, make those replies/entries available or not:

 

int StartingConditional()
{
   int nResult = GetGlobalNumber("MY_PLOT");
    if nResult == 1
   {
       return TRUE;
   }
   return FALSE;
}

 

In short, what this script says is that IF the global Number MY_PLOT is at 1, then make the reply/entry available.

 

You could also check for charisma, alignment, the presence of another party member instead of globals. This can be used various ways.

 

2. If this NPC is placed in a different area. But still in the same plot. Do i need another .utc and another .dlg?

Yes and no:

- if you pack your .utc files in your module folder then yes, they will be considered as different objects by the game.

- If you put the .utc files in the override folder, then no, just use a spawn script and it will be considered as the same object.

 

I suggest you pack them in the module if the dialogue is going to be different between the two modules. It keeps the override folder cleaner.

 

Hope this helps :)

Link to comment
Share on other sites

I have another question. I noticed a field in the dialog called Speaker TAG. I believe that it must be the TAG field of the .utc for that speaking character. I noticed also that the .utc has a field to place the npc dialog.

 

So...;) Do i need to fill:

 

a) both fields;

b)only the diialog field;

c) only the utc field?

 

Or am i getting it all wrong?

Link to comment
Share on other sites

The Speaker field is only necessary when you want a 3rd NPC to begin speaking. Like when you're talking to Mission and Zaalbar chimes in and they start bantering to each other. The Listener field behaves in a similar manner.

 

If you just have your PC talking to the one NPC, no Speaker or Listener field value is necessary.

 

In regards to the .utc, the Conversation field is the resref for your .dlg file. You'll need to specify this so the game knows which dialog to use.

 

Take a look at the readme that comes with DLGEdit for more information.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...