Jump to content

Home

Can someone give me a script?


Exile007

Recommended Posts

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...

Link to comment
Share on other sites

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?"

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 is a post with a very good tutorial on dialog editing by Pavlos

 

Kind Regards

--Deadly Stream

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...