View Full Version : NPC war
10-18-2005, 07:32 AM
Is there a simple script to make one group on NPCs attack another and have them attacking back. But they never die.
10-18-2005, 08:01 AM
maybe you could give them a very high health regenerating?
10-18-2005, 08:07 AM
Thats not it I can't even get them to attack each other
10-18-2005, 08:12 AM
im sorry, i dont know anything about modding
10-18-2005, 12:54 PM
I think you do it by playing with the prey and predator(?) factions.
10-18-2005, 03:18 PM
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.
10-19-2005, 12:58 AM
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.
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:
vBulletin®, Copyright ©2000-2014, Jelsoft Enterprises Ltd.