In the last tutorial, we have created 5 lines of code/script using Script Generator and then copied it to the (memory) Clipboard. Now we will need to look for an appropriate place to paste the script from the Clipboard into the game mod.
If you have not yet done so, open the NWN2 Toolset, load the Module we have been working on thus far. Open up the AREA known as "Frans_Inn" and locate the conversation known as frans_01, which is the first conversation uttered between Frans and the player (when they first met). Scroll through the convo thread and search for the following line in which Frans informed the player the whereabouts of Bennay:
She is in the kitchen right now.
We are going to use the codes from Script Generator to tell the game mod that the player have spoken with Frans. Since the conversation has two threads, which thread of convo was more appropriate for this "condition check"? Should we be using just one of the convo thread, or both?
Because the player did not want to help Frans in one of the thread, spoken2Frans should NOT be applied to that thread. Why? Just imagine this: if a Player refused to help Frans, would Bennay be friendly to him/her? Try to put aside the name of the script, but think about its purpose...
Caveat: You wouldn't want to attach the "check" at the beginning of a conversation thread because that does not ensure the Player have "finish talking" with Frans. (In fact, some conversation may be "interruptable", which means it may not go all the way to the end (where END DIALOG was). So, in order to ensure a player has indeed completed the entire thread of conversation, and thus receive ALL information, we will need to do the "condition check" right at the end of a convo thread. In this case, since She is in the kitchen now." is Frans' last sentence to the player in that thread, it would be the best place to attach the script. (Note that the empty [END DIALOG] is attached to a Player, and is a means to return "play control" to the PC. This ensure there was time enough for the player to read the last response by the NPC.
Select the last line of conversation spoken by Frans (an NPC). This is where we will attach the script to. To create the Actions, do the following:
Continue to ยป checkSpoken2Frans | Return to Experience