PDA

View Full Version : NPC atacking another NPC


Ravager
02-08-2009, 08:38 AM
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, 09:56 AM
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
Thanks. I didnt know about this prey/predator thing ;d

Canderis
02-08-2009, 10:13 AM
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
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, 02:33 PM
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