Snarkpit Articles


This tutorial shows you how to handle ai_relationship. Now, for example, you want to create turrets that shoot combine instead of you. Or other things.

We need a room, one npc_turret_floor, one npc_citizen, and an info_player_start, one npc_combine_s. Set these NPCs up to your wishes.

Now place 4 ai_relationships. Name the turret turret or something else. Go to one of the ai_relationships properties and set the first one up like this:

subject(s): turret
target(s): !player
Disposition: Like
Disposition Priority: 9
Start Active: Yes

And the second one:

subject(s): turret
target(s): npc_citizen
Disposition: Like
Disposition Priority: 9
Start Active: Yes

Third:

subject(s): turret
target(s): npc_combine_s
Disposition: Hate
Disposition Priority: 9
Start Active: Yes

Now you got the turret to like you, the citizen and hate the combine. But the citizen is afraid of the turret now (it wont shoot it but run away from it) so you have to set the fourth ai_relationship like this:

subject(s): npc_citizen
target(s): npc_turret_floor
Disposition: Like
Disposition Priority: 9
Start Active: Yes

Compile, and enjoy.

If you want turrets that start inactive like the nova prospekt ones then follow this.

Set the output on your turret like this:

| My output > | Target entity | Target input |
1:OnPhysgunPickup Turret Disable
2:OnPhysgunDrop Turret Enable

And the spawn flags of the npc_turret_floor to start inactive.


Post ReplyView Topic
Discussion
0 starsPosted by maduin2k on Tue Aug 5th 2008 at 7:02pm

You could place a turret into a tank, but that just looks funny. and it causes some errors, i think.
0 starsPosted by Shrapnel on Sun Apr 10th 2005 at 10:18am

If you set 'Reciprocal' to yes, you can save time, as this applies the same settings for the 'target' towards the 'subject'.
0 starsPosted by Dred_furst on Thu Apr 7th 2005 at 12:51pm

Can you do this with func_tanks ?

good tut btw smiley
0 starsPosted by Storm on Fri Mar 18th 2005 at 1:25pm

Very good! I always wondered how to do it
Just needed some screenshots and it would be a 10 smiley
0 starsPosted by Paladin[NL] on Fri Mar 18th 2005 at 10:24am

8/10, you could added some pictures for some more spice...I know it's a rather technical tutorial, but still, some pictures always add a higher level of interest
Post ReplyView Topic