Okay so I am working on a quest where the player will hear a dialogue as he runs over a trigger, basically explaining and/or having the player endure a conversation between 2 people. Since I intend to multiple triggers throughout the quest areas I was wondering if I could all the coding into 1 script and that the script checks which trigger is being triggered and pulls up the appropriate line for the that section?
Yes, you can, you could do it by using local vars stored inside the trigger or by tagging the triggers differently. (though the former would be preferable imho, with integers it would allow for a Switch selection)
Exactly. You could do something like this:
if(GetLocalInt(oPC,"triggerevent1"))
{
//Your code here
}
else if(GetLocalInt(oPC,"triggerevent2"))
{
//Your code here
}
or if you want to check something in the journal perhaps, it could look something like this:
object oPC = GetFirstPC();
int nInt = GetLocalInt(oPC,"NW_JOURNAL_ENTRYyourquest");
if(nInt == 31)
{
//Your code here
}
else if(nInt == 21)
{
//Your code here
}
I do stuff like this all the time in my modules.
Or you could do it by using Switch selection. I’ve never used that type of coding myself, so I’m not sure exactly how you write that, but I’ve seen it written and I think it’s not that complicated. I’m sure you can just check the NWNLexicon for that.
Thanks man! Very helpful!
One of the first things I create in a new module is a custom trigger with a script that starts a conversation using a local string variable on the trigger holding the name of the conversation file. Save that trigger to the palettes, and I’ve got an easy way to start a conversation any time.