Ataris Posted November 29, 2008 Share Posted November 29, 2008 What are the common dialogue conditional scripts? Specifically for now I just want one that will turn on a new node after you've talked to the character once so that they don't give their monologue twice. Somehow I don't think that would be a good thing. >_> Link to comment Share on other sites More sharing options...
Star Admiral Posted November 29, 2008 Share Posted November 29, 2008 This probably isn't the most efficient way to do it, but you could declare a global variable in globalcat.2da and then check to see if the variable is set to determine if the character should launch his monologue. The variable starts as 0, but once the character completes the monologue, set the variable to 1 to prevent a relaunch. Use "c_global_eq" to check the variable, and use "a_global_set" to set the variable. - Star Admiral Link to comment Share on other sites More sharing options...
stoffe Posted November 30, 2008 Share Posted November 30, 2008 What are the common dialogue conditional scripts? Specifically for now I just want one that will turn on a new node after you've talked to the character once so that they don't give their monologue twice. Somehow I don't think that would be a good thing. >_> KOTOR1: put k_con_talkedto as conditional script name and k_act_talktrue as action script name on the dialog entry node that should only be available the first time the player talks to the NPC. (Greeting etc) TSL: put c_talkedto as conditional script name and a_talktrue as action script name on the dialog entry node... Link to comment Share on other sites More sharing options...
Ataris Posted December 1, 2008 Author Share Posted December 1, 2008 Actually I wanted something a bit more complicated. I have more than one nodes within the same dialogue I want using conditionals. For example: 1st time you talk: "Hey dude. Let's warp to the next module." 2nd time: "Welcome back. Do you want to warp to the next module?" 3rd time: "Welcome back. Are you ready?" Hierarchy, I guess.... Link to comment Share on other sites More sharing options...
Star Admiral Posted December 1, 2008 Share Posted December 1, 2008 I haven't checked the scripts that stoffe mentioned, so I'm not sure if they can be used for this. They probably can, as I've only just started scripting and don't know what all the ingame scripts do yet. To continue on the method that I use for my own upcoming mod, use the global variable again. For the first node, have it trigger only if the variable is set to 0. At the end of that branch, set the variable to 1. The second node will trigger only if the variable is set to 1. At the end of the second one, set the variable to 2. You can continue on for as many times as you like, each node incrementing the variable by 1. Hope that it helps. - Star Admiral Link to comment Share on other sites More sharing options...
Ataris Posted December 1, 2008 Author Share Posted December 1, 2008 Well, I'll use that as a last resort. I would pick scripting over variables in this case. Link to comment Share on other sites More sharing options...
tk102 Posted December 2, 2008 Share Posted December 2, 2008 Think through what criteria you want to apply to each dialog node. Try drawing the hierarchy on paper if that helps along with little "if..then..." notes in the margins. Then take a look at nwscript.nss for pertinent functions that might be able to provide the needed information for the conditionals. For example if you wanted to allow a certain dialog choice only if an item is possessed you might try using GetItemPossessedBy function. If you wanted the dialog only to appear within a certain module, you could use GetModuleFileName to check. Global numerics are good for quest-type dialog trees, with each value of the numeric representing a different "state" within the quest, though these tend to make the quest designs more linear. But no one says you can't use more than one global. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.