Making a lot of NPC to have a massive war

Hi there!

So, what I want to do is basically what is explained in the photo, two different armies are completly calm, once the PC talk to (for example) the Orc Chief, both armies starts to fight in the middle of the battleground.

1 Like

Even though I only work with NWN2, I believe you just need to change their factions so that they are hostile towards each other.

In NWN1, better to put each army in its own faction from the outset, then make the factions mutually hostile. IIRC AdjustFactionReputation() is the function to use (twice - make A hostile to B, and vice-versa).

This in itself won’t start combat. Either the armies can’t see each other (as seems likely here) or they have already seen each other (deciding not to attack).

So, in the first case, use ActionMoveToLocation() or whatever to make the armies run towards the other side. Best if each soldier has a different destination, to reduce the risk of an untidy scrum at one point. When the OnPerception event fires, combat will ensue.

In the second case, use DetermineCombatRound() to make soldiers who can already see one another attack.

In practice, this may need fine-tuning. Left to its own devices, AI still tends towards that scrum. You might want to spread the soldiers out in longer lines, or move towards flank positions, for example.

1 Like