PDA

View Full Version : Question about Journal and Dialog


pablo_fett
07-23-2007, 01:27 PM
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.

tk102
07-23-2007, 01:59 PM
Hi, which game is this for? Rule #8 (http://www.lucasforums.com/showthread.php?t=127725)

(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));
}

pablo_fett
07-23-2007, 02:40 PM
Sorry, this is for KotorI.

tk102
07-23-2007, 03:00 PM
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);
}

pablo_fett
07-23-2007, 11:05 PM
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.

tk102
07-23-2007, 11:13 PM
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.

stoffe
07-24-2007, 07:12 AM
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. :p

Resource names should also only contain alphanumerical characters or underscores (a-z, 0-9, _) to work properly.

pablo_fett
07-24-2007, 12:06 PM
Excellent, thank you both.