View Full Version : Scripts

07-08-2008, 08:26 AM
Hello again. I am sure you are sick of answering my questions already, but I do want to ask you something so I can improve my dialogue.

In a reply of a dialogue (in blue, the PC speaks it) I have written: "Script that fires when spoken: k_pman_selkmad_y". And I have created a new entry at the beginning with "Script that determines availability: k_pman_selkmad_y", but it does not work. Do I have to have this script as in a NCS file or something? If so, what has to be in it?

07-08-2008, 10:12 AM
What game is this for?

What does the script do?

Have you compiled the script?

07-08-2008, 10:25 AM
You don't use the same script for the "Availability" and "When Spoken To" fields.

The Script that fires when Spoken To is a script that does something, such as gives the player an item, spawns a placeable/creature in the area/module and so on. OR, it could also set a global variable, a local variable, or a boolan.

The Script that fires when you are checking for availability is a script called a conditional script. These types of scripts are handy, they will check for the existence of an item within the game, or if a variable has been set.

For example, this one checks if an item is in the PC's inventory:

int StartingConditional()
if ( GetIsObjectValid( GetItemPossessedBy( GetFirstPC(), sTag))) return TRUE;

return FALSE;

So, that script checks if the PC has an item, where the item is, you place the tag in steed of sTag. If you have the item, it returns true, and if you don't it returns false. If it returns true, than your dialog branch with this as the conditional opens, if its false, it goes to the next one.

So, basically, there is no error with the Dialog, just the scripts. Ask around here if you need a script that will do what you want. (I know I do!)

07-08-2008, 10:26 AM
It is for KotOR I. I just want to do the simple k_act_talktrue and k_con_talkedto. Do I need to create a NSS file and then compile it? What should in there?

07-08-2008, 10:35 AM
If I understand your post, you need a conditional script that will be placed on an entry, and you want to make this entry available only if it's the first time you speak to the NPC.

Here's what you must do:

Create 2 entries. One should be something like:"Hello, stranger."{You talk to the NPC for the first time}, and the other would be something like this:"Hello, again."{You talk to the NPC for the second/third/fourth etc time}.

In the entry that would only fire the first time you speak to the NPC("Hello, stranger."), put k_con_talkedto in the Script that determines availability. And in the same entry put k_act_talktruein the Script that fires when spoken.

Worked for me!!:xp: