Tips on Building Encounters
Posted: Thu May 20, 2004 8:47 am
OnExhausted event
An encounter has five event handlers that will fire a script - four of which are standard ('OnEnter', 'OnExit', 'OnHeartbeat' and 'OnUserDefined'), and one which is unique to encounters ('OnExhausted'). An 'OnExhausted' event is fired when the last creature spawned by the encounter is slain. This can be used to trigger an event such as the opening of a gate, or a cut scene once the encounter group has been defeated.
Encounter's Faction
Its worth noting that encounters set to the standard npc factions, (commoner, merchant and defender,) don't seem to trigger for npc's that are hostile to these factions, they only trigger for PC's and members of their party. However using a custom faction on the encounter, set up with similar likes and dislikes, should work as expected.
So for example you could set a number of encounters, with a faction of 'Commoner', around a village. When triggered, these encounters would spawn groups of guards to deal with the attackers. These encounters will not be triggered when players wander around the village unless the players have been attacking villagers, thus becoming hostile to the villagers ('Commoner') faction.
Difficulty
This determines how difficult the encounter will be, constrained only by the creatures you have put in the 'Creature List'. For example, when an encounter is triggered, NWN will weigh up the challenge rating of the creatures in its 'Creature List' and the combined level of the PC's, then spawn in an appropriate amount of creatures in an attempt to match the difficulty level you have set. Obviously it will not always be able to do this - if you have only entered creatures with a challenge rating of 6 to 9 in the creature list, setting the encounter to 'Very Easy' will never make it possible for level 1 characters, nor will setting it to 'Impossible' make it challenging for characters of level 30.
Source: NWN Lexicon (http://www.nwnlexicon.com)
An encounter has five event handlers that will fire a script - four of which are standard ('OnEnter', 'OnExit', 'OnHeartbeat' and 'OnUserDefined'), and one which is unique to encounters ('OnExhausted'). An 'OnExhausted' event is fired when the last creature spawned by the encounter is slain. This can be used to trigger an event such as the opening of a gate, or a cut scene once the encounter group has been defeated.
Encounter's Faction
Its worth noting that encounters set to the standard npc factions, (commoner, merchant and defender,) don't seem to trigger for npc's that are hostile to these factions, they only trigger for PC's and members of their party. However using a custom faction on the encounter, set up with similar likes and dislikes, should work as expected.
So for example you could set a number of encounters, with a faction of 'Commoner', around a village. When triggered, these encounters would spawn groups of guards to deal with the attackers. These encounters will not be triggered when players wander around the village unless the players have been attacking villagers, thus becoming hostile to the villagers ('Commoner') faction.
Difficulty
This determines how difficult the encounter will be, constrained only by the creatures you have put in the 'Creature List'. For example, when an encounter is triggered, NWN will weigh up the challenge rating of the creatures in its 'Creature List' and the combined level of the PC's, then spawn in an appropriate amount of creatures in an attempt to match the difficulty level you have set. Obviously it will not always be able to do this - if you have only entered creatures with a challenge rating of 6 to 9 in the creature list, setting the encounter to 'Very Easy' will never make it possible for level 1 characters, nor will setting it to 'Impossible' make it challenging for characters of level 30.
Source: NWN Lexicon (http://www.nwnlexicon.com)