PDA

View Full Version : I created new dialog in KOTOR!!!


Den Baster
01-04-2004, 07:36 PM
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

Lil' Jawa
01-04-2004, 08:05 PM
Good too see that you got my script working now;)

Den Baster
01-04-2004, 08:16 PM
Originally posted by Lil' Jawa
Good too see that you got my script working now;)
Yeah we did this together :)

Veldrin
10-31-2004, 01:32 AM
Very thx for this script:) but I have one questions/problem.

Where I must select this script? In the utc file or dlg file?

And where in the file( i can't find the script line).

Help pliz.

Darth333
10-31-2004, 04:46 AM
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.

Veldrin
10-31-2004, 06:19 AM
I want use it in situation:

When NPC see me ( I am near NPC) They start dialog.

Some tutorial please:(

PoM
10-31-2004, 11:02 AM
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.

Veldrin
10-31-2004, 11:25 PM
But I need script, no dialog

PoM
11-01-2004, 02:04 AM
Yup, but this thread is still old.

Darkkender
11-01-2004, 04:24 AM
refer to Darth333's post above all you need to do is attach the script to a placeable object maybe once you enter a door etc.

Darth333
11-01-2004, 05:54 AM
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 ;)

Veldrin
11-01-2004, 07:24 AM
Yes witch friends we creating new planet. I understand but can I find some location mods with scripts i need?

You now in live.:D

Darth333
11-01-2004, 07:59 AM
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

Veldrin
11-01-2004, 10:22 AM
Thanks but I have problem. I do everything It still no working.

Can you do for me little mod, maybe small location where you ussing this script, you know?

Please??

Darth333
11-01-2004, 11:09 AM
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"));
}

Veldrin
11-02-2004, 09:09 AM
Thx but I still have one questions and problem.
- when I comipe scripts the have error with "object"

- how i can caunt the geometry points?

Darth333
11-02-2004, 09:13 AM
I dedited the script above, I missed a ";" in the first line when I pasted.

For the geometry points, you have to go in the game and do the whereami cheat to get the coordinates.

Veldrin
11-03-2004, 06:31 AM
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

Xavier2
11-04-2004, 04:20 PM
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?

Mono_Giganto
11-04-2004, 04:25 PM
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:

Darth333
11-04-2004, 05:42 PM
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 :)

Xavier2
11-07-2004, 05:25 PM
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?

tk102
11-07-2004, 06:46 PM
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 (http://www.pcgamemods.com/5853/) for more information.

Veldrin
11-08-2004, 07:27 AM
I like to use this script to starts the dialog when the PC enter to location. I found in the ARE file line "ON ENTER" but it don't work.
Help.

tk102
11-08-2004, 10:31 AM
Try using some script debug functions (http://www.lucasforums.com/showthread.php?s=&threadid=125847) to see whether or not your script is even being fired.

Also, it almost always better to use a Trigger (.utt) object rather than the ARE itself, since most of the ARE files already have their OnEnter scripts defined.

Xavier2
11-08-2004, 03:47 PM
How can i make a npc say your PC name in dialog?

Mono_Giganto
11-08-2004, 04:00 PM
Originally posted by Xavier2
How can i make a npc say your PC name in dialog?

Use <FullName>

Xavier2
11-08-2004, 04:26 PM
I figure the linked dialogs leads you to the same dialog in another branch. But is there another function? Is it posible to make the link for another dlg file?

Darkkender
11-08-2004, 04:40 PM
I think you would want to have a script that activates a dialogue attached to the last statement within the dialogue file to activate a seperate dialogue.

tk102
11-08-2004, 05:50 PM
You could just combine the two dialogs into a single dialog and use the Speaker/Listener tags as necessary also.

Xavier2
11-29-2004, 07:01 PM
I am having a problem with a dialog i have attached to a Landspeeder placeable. I am trying to do more or less the same as the game does in that Mandalorian side quest in Kashyyyk, but the dialog doesn't triggers. I checked the dlg file with a GFF Editor and it seems to be fine compared to the aforementioned Kashyyyk one...

Is there a script or field in the placeable.utc or .dlg i must be missing? Any clues? :(

Darth333
11-29-2004, 07:24 PM
I've made dialogues with placeables in the past (but they are not in my "published" mods) and they work just as any other dlg with a NPC. Unless you want to set a condition, you don't need any script. Double check your dlg file. The problem is very likely located at this level.