Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

NPC atacking another NPC

Page: 1 of 1
 Ravager
02-08-2009, 8:38 AM
#1
Hi!

I want to make npc who will attack another npc by script. Somebody can tell me how it should look like?
 Canderis
02-08-2009, 9:56 AM
#2
You would use somthing like this:

void main() {
object oNPC1=GetObjectByTag("npc 1 here");
object oNPC2=GetObjectByTag("npc 2 here");
ChangeToStandardFaction(oNPC1, STANDARD_FACTION_PREY);
ChangeToStandardFaction(oNPC2, STANDARD_FACTION_PREDATOR);
}
 Ravager
02-08-2009, 10:09 AM
#3
Thanks. I didnt know about this prey/predator thing ;d
 Canderis
02-08-2009, 10:13 AM
#4
Is one of the people a party member? If so you will need to change back to his/her original faction.
 Ravager
02-10-2009, 11:56 AM
#5
I dont want to make another topic so i am writing here.

I want to fire conversation after NPC spawn. I have script but i dont know where can i put this. I tried to add this to OnEnter but it dont work.
 Star Admiral
02-10-2009, 2:33 PM
#6
I believe that inside the utc for the NPC, there is a entry OnSpawn. You'll put your script name in that category.

- Star Admiral
Page: 1 of 1