Jump to content

Home

NPC war


brwarner

Recommended Posts

Give them factions that are hostile to eachother. Have a look in repute.2da, this file defines the standard factions in the game and their relations to eachother. 0 is hostile, 50 is neutral and 100 is friendly.

 

If you want "Group vs. Group" battles I suggest using the GIZKA1 and GIZKA2 factions for your combatants. Unlike the Predator/Prey factions, those are Friendly to people of their own faction, and thus (some) buff powers will work on their allies as well.

 

Then, make sure that your combatants have AI scripts assigned. They should automatically start fighting as soon as they perceive an opponent, so make sure they have Long perception range set. If they still won't fight, make them run the GN_DetermineCombatRound() function and they should start fighting. This is most easily and safely done by running this script line for at least a few combatants on each team:

ExecuteScript("k_ai_master", oCombatant, 1003);

...where oCombatant is the one who should start fighting, substitute for OBJECT_SELF if they run that script line themselves.

 

Also note that the player can't be very far away for the battle to take place. World objects further away than 250 meters from the Player controlled character are automatically turned off by the game engine to save CPU resources.

Link to comment
Share on other sites

But they never die.

 

Since I didn't see anyone else mention it, as for the second part of your question, set the Minimum 1 HP option in the UTC file for your npc's to true. Or, you can do it through a script.

 

SetMinOneHP(target,TRUE);

 

where target is a reference to the object that represents your NPC.

 

If you ever want them to die, you can use the same script to let them die. Just change TRUE to FALSE. Since it's kind of tough to edit the UTC file in the middle of the game. :lol:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...