pablo_fett Posted July 23, 2007 Share Posted July 23, 2007 Hi, I read Darth333's tutorial on Journal editing, and everything went really well. But now I'm trying to change the dialog with an NPC depending upon which stage of the quest the PC is in. For example: This NPC wants me to do something for him. 10 indicates that I have heard the quest, 20 indicates that I have done the thing, 30 indicates that I have told him and finished the quest. Upon first meeting: "Hey, maybe you could help with these 2 things." After this meeting: "Have you done the thing I've asked?" After telling him I did the thing: "Hey thanks again for doing that thing." How do I make sure the node that appears is the correct one for the stage? Thanks for any help. Link to comment Share on other sites More sharing options...
tk102 Posted July 23, 2007 Share Posted July 23, 2007 Hi, which game is this for? Rule #8 (It makes a big difference when talking about scripting conditionals for dialogs.) For KotOR1, you'll have to write individual scripts that check specific values of the journal and return TRUE or FALSE. Example: int StartingConditional() { return (GetJournalEntry("my_quest_name")==10); } For TSL, you can write a generic script that you use multiple times but just change the P1 parameter in DLGEditor. Example: int StartingConditional() { return (GetJournalEntry("my_quest_name")==GetScriptParameter(1)); } or even more generic (to use for different plots) by making use of String Param in DLGEditor int StartingConditional() { return (GetJournalEntry( GetScriptStringParameter() )==GetScriptParameter(1)); } Link to comment Share on other sites More sharing options...
pablo_fett Posted July 23, 2007 Author Share Posted July 23, 2007 Sorry, this is for KotorI. Link to comment Share on other sites More sharing options...
tk102 Posted July 23, 2007 Share Posted July 23, 2007 So your dialog would appear something like this in DLGEditor (with conditionals turned on) [+]<myquest0> Hey I've got a quest for you... [+]<myquest10> I've told you what you need to do already... [+]<myquest20> Oh you've finished the quest! Great! [+]<myquest30> Thanks for your help with the quest. And myquest0.nss would be int StartingConditional() { return (GetJournalEntry("my_quest_name")==0); } And myquest10.nss would be int StartingConditional() { return (GetJournalEntry("my_quest_name")==10); } And myquest20.nss would be int StartingConditional() { return (GetJournalEntry("my_quest_name")==20); } And myquest30.nss would be int StartingConditional() { return (GetJournalEntry("my_quest_name")==30); } Link to comment Share on other sites More sharing options...
pablo_fett Posted July 24, 2007 Author Share Posted July 24, 2007 Outstanding, thank you. It worked perfectly. I have a follow up question. I think I have seen this before, but is there a limit on the length of the filename for a script? Thanks for all your help. Link to comment Share on other sites More sharing options...
tk102 Posted July 24, 2007 Share Posted July 24, 2007 Glad you asked. 16 characters is the limit not including the file extension. The same goes for the Tag and any other resource reference you come across. Link to comment Share on other sites More sharing options...
stoffe Posted July 24, 2007 Share Posted July 24, 2007 Glad you asked. 16 characters is the limit not including the file extension. The same goes for the Tag and any other resource reference you come across. Well, the Tag can technically be 32 characters in length (unless they removed the engine limit from NWN), but it's usually a good idea to set it to the same as the resource/file name unless you have a very good reason not to. Resource names should also only contain alphanumerical characters or underscores (a-z, 0-9, _) to work properly. Link to comment Share on other sites More sharing options...
pablo_fett Posted July 24, 2007 Author Share Posted July 24, 2007 Excellent, thank you both. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.