View Single Post
Old 03-13-2006, 10:34 AM   #1566
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by Joris1
I have a question to the conversation editor: How can I make it that a conversation possibility is only one time choosable.
Or how can I make it, that you can choose a conversation possiblity as long as you haven't finish the conversation completly?
You can use LocalBoolean variables to keep track of such things. Be careful when using LocalBooleans though since there is a limited number of them available and many are already used for creatures. 110-159 should be unused by the standard game and generally safe to use on your own creatures though.

How this is done depends on what game this is for:
  • KotOR1: In the "Script determines if node is available" box you'll have to put the name of a script (NCS file) you will have to create that checks if a particular LocalBoolean is set.
    For example, if you use localboolean 120 to check if a dialog node has been picked, your script code could look like:
    Code:
    int StartingConditional() {
        return !GetLocalBoolean(OBJECT_SELF, 120);
    }
    The dialog node with that script attached would only show up if LocalBoolean 120 has not been set.

    Then, on the dialog node where you wish to make the above node unavailable, you would add the name of a script in the "Script to run for this node" box, whose code would look something like:
    Code:
    void main() {
        SetLocalBoolean(OBJECT_SELF, 120, TRUE);
    }
    This would set the LocalBoolean 120 when that dialog node is reached, blocking out those nodes who has the first conditional script attached.

  • K2:TSL: The KotorTool Conversation editor does not work properly with Kotor2 dialog files and should not be used. Use the DLGEditor instead for this. For TSL there is less work involved since there are already standard scripts in the game to check and set LocalBooleans. Thus you will not need to make your own.

    In the "Conditional #1" (or #2 if the first is already used) box (in DLGEditor) for the dialog node you wish to disappear, put the script name "c_local_notset". This script already exists in the game, so you won't have to create it. In the P1 (Parameter 1) field next to that box, put the LocalBoolean number you wish to check, in the above example "120".

    Then, in the "Script #1" (or #2 if the first slot is already used) of the dialog node where you wish to make the first node(s) unavailable, add "a_local_set", again a script that already exists in the game, and set the P1 (Parameter 1) field next to that box to the LocalBoolean to set, "120" in the above example.

stoffe is offline   you may: quote & reply,