Making an NPC an ally
Post Reply
Quote
Re: Making an NPC an ally
Posted by Cheezwedge on Sun Jan 16th at 4:17am 2005


How can I do this? I've been trying to make one of those giant battle maps, but I can't find out how to make an npc actually be on my team. Any ideas?



Quote
Re: Making an NPC an ally
Posted by Yesurbius on Sun Jan 16th at 1:12pm 2005


If you are talking about citizens as your squad members, then just create npc_citizen entities and give them a weapon. Upon seeing Freeman, they will join up.

If you are talking about getting non-citizen npcs to befriend Freeman - its a little more involved:

Create an ai_relationship entity. Position it next to the NPC that will spawn, and set its radius high enough to encompass the NPC spawn area.

In the ai_relationship properties there are two target identiifiers. In one, you enter the name of the npc class, and in the other you enter 'player' (the player). Make sure you set it to 'like' and the priority to 90. Be sure to use the class name (ie. npc_metropolice, npc_combine_s).

You will want multiple relationships, one to 'like' the player, and then many others to 'hate' all the bad guys. Also, unless you want these npcs to attack, but not be attacked back, you need to set the 'reciprocate relationship' to yes.



[addsig]





Post Reply