JediMaster76
06-24-2008, 09:05 PM
Alright. So, what I'm trying to do is turn a decent-sized group of NPC's hostile. A couple of these NPCs were spawned into the module and have different spawn-in locations but the same tag (like Sith troopers).
This script generally works for me...
void main() {
object oNPC=GetObjectByTag("baddie");
ChangeToStandardFaction(oNPC, 1);
object oThug1 = GetObjectByTag("obj1");
object oThug2 = GetObjectByTag("obj2");
object oThug3 = GetObjectByTage("obj2");
ChangeToStandardFaction(oThug1, 1);
ChangeToStandardFaction(oThug2, 1);
ChangeToStandardFaction(oThug3, 1);
ExecuteScript("k_ai_master",oNPC,1005);
}
... however, when I use that script, only one object with the "obj2" tag actually turns hostile, the other remains neutral and doesn't do anything. So basically what I'm asking is, what's the easiest way to work around this, simply give all my NPCs unique tags (which would take awhile in some cases), or is there a script where it turns ALL instances of "obj2" hostile?
This script generally works for me...
void main() {
object oNPC=GetObjectByTag("baddie");
ChangeToStandardFaction(oNPC, 1);
object oThug1 = GetObjectByTag("obj1");
object oThug2 = GetObjectByTag("obj2");
object oThug3 = GetObjectByTage("obj2");
ChangeToStandardFaction(oThug1, 1);
ChangeToStandardFaction(oThug2, 1);
ChangeToStandardFaction(oThug3, 1);
ExecuteScript("k_ai_master",oNPC,1005);
}
... however, when I use that script, only one object with the "obj2" tag actually turns hostile, the other remains neutral and doesn't do anything. So basically what I'm asking is, what's the easiest way to work around this, simply give all my NPCs unique tags (which would take awhile in some cases), or is there a script where it turns ALL instances of "obj2" hostile?