PDA

View Full Version : Can someone give me a script?


Exile007
01-01-2008, 01:19 PM
Alright, I need a script that replaces someone's dialog once a certain action is done. I'd appreciate this much, thanks!

jonathan7
01-01-2008, 01:35 PM
I'm not scripter, so can't really help, but I would suggest you put in an awful lot more information into your post as its hard to help people when they're non-specific with what the problem/what they want done is.

Marius Fett
01-01-2008, 02:50 PM
Well i'm no expert but if you want a certain dialog option to be available after a certain event has happened this might work.

For example if you want a certain node available after the PC finds out they are Revan in K1.

Write your dialog file and wite a seperate node off the main one you want available after a certain event.

Select this node in DLGEditor and in the box that says "Script that determines if node is availbale" type k_pkor_knowrev.

This will also work with other scripts too.

Sorry if this isn't explained well but i'm not really good with this sort of thing...

Exile007
01-01-2008, 03:25 PM
Ok so let's say the PC talks to this one guy. Then the PC kills a Sith Lord in the same module. How would I change the dialog?

Ex:

Can you please kill Sith?

I'll wait

(kill Sith)

Alright let's go!

End

So how would I change "please kill Sith" to "Alright let's go?"

Marius Fett
01-01-2008, 03:38 PM
Well theres probably an easier way but i'd do this:

Attatch an OnDeath script to the Sith's UTC.

Then use that on death script in the same way as described above...

That's what I do anyway.

Silveredge9
01-01-2008, 05:25 PM
There's loads of ways you could pull something like this off.

The way I'd use is to attach a script to the "Script that determines if node is availbale" box for the "Alright let's go!" dialogue thing that includes:

int StartingConditional() {

object oNPC1 = GetObjectByTag("SITH LORD TAG");

if (GetIsObjectValid(oNPC1) == FALSE)

{
return TRUE;
}
else

{

return FALSE;
}
}


The above script will check to see if an NPC that uses the tag you'd list is somewhere in the current module or not. If the NPC isn't in the module (Because you'd have killed him), then the dialogue the script is attached to "Alright let's go!", would become active.

Don't forget to put the "Alright let's go!" dialogue option at the top of the list of possible dialogues in that particular .dlg file. Like -

- Alright let's go!
- Can you please kill Sith?
- I'll wait.

Exile007
01-01-2008, 05:54 PM
Ok I did that and it doesn't work. The guy just says the same thing. I put the script in the script section in dialog editor(not KOTOR tool version) was there something I did wrong?

Stream
01-03-2008, 06:43 PM
Ok I did that and it doesn't work. The guy just says the same thing. I put the script in the script section in dialog editor(not KOTOR tool version) was there something I did wrong?
Don't forget to put the "Alright let's go!" dialogue option at the top of the list of possible dialogues in that particular .dlg file.

Silveredge9 got it mixed up, the node that doesn't have a conditional script needs to be at the bottom of all nodes.

When a conversation is fired, the game will go down the file in order, if there's two nodes in the file and the first has a conditional script, if that script returns true then that node will play through. If however it returns false then the game will move to the next node.

This continues all the way through the conversation, until the game has returned true to a condition or has run out of nodes to try, in which case the conversation ends.

Also make sure you put the script in the conditional field and not the script field, also don't include the extension.

Here (http://www.lucasforums.com/showthread.php?t=180845) is a post with a very good tutorial on dialog editing by Pavlos

Kind Regards
--Deadly Stream

Exile007
01-03-2008, 08:34 PM
Awesome I got it working, thanks!