PDIALOG.2DA (or other 2da files if referenced in CAMPAIGN.2DA) kicks in whenever:
- NPC joins party (JOIN dialogue set)
- NPC is kicked from party (POST dialogue set)
- game is loaded and NPC is in party (JOIN dialogue set)
So generally SetDialog() should be only used on CREs outside the party. This way dialogue is not reset unless NPC joins the party.
You can overcome the second condition (e.g. if you want your NPC who left party in BG1 part appear in BG2 with the default dialogue - same as when he started in BG2) by either
a) if NPC leaves on his own with dialogue DO~LeaveParty() SetDialogue(theoneforBG2)
or if you have no contol over this (e.g.in a transition cutscene)
b) put something like this in the NPC override script which is read even if NPC is not (yet) in party: - covers the case where the exact starting location of NPC in BG2 is not determined
Edited by Roxanne, 17 February 2017 - 08:09 AM.