Tutorials
Ai_Relationship
This tutorial assumes you know how to make a basic level, and place entities in it.
What I'm going to do is show you how to change relationships of npcs to act differently towards you or other npcs.
In this example, I'm going to make the police friendly to you, so you can watch them administer justice on some rebels.
The first step in making the police friendly is placing an ai_relationship. This will tell the npcs how to feel towards one another. It's position in the map is not relevant, as long as it's inside somewhere. Go to the entities list and place an ai_relationship somewhere in your map.

Once you place your ai_relationship, select it and hit Alt+Enter to view it's properties. "Subjects" is the targetname of the npcs which you are going to change the feelings of. "Targets" is the targetname of the npcs you want to change the feelings TOWARDS. So in this example I put "soldiers" in the Subjects key, because that will be the targetname of my policeman. I put "!player" in the Targets field because "!player" is what you type in when you are referring to the player. The police will change their attitude towards the player. I set "Disposition" to "Like" and "Start Active" to "Yes". "Reciprocal" means the relationship is mirrored the other way, in this case, the player also loves police.
![]()
Once your ai_relationship is set up, the next step is to create your policemen. I made 4 npc_metropolice in this example.

Go into each of the policemen's properties, or go through the first one and clone him afterwards. The main thing we want to set is his "Targetname" to "soldiers". As you can see in the picture below, the name soldiers is in bold because more then one entity is using this targetname. The ai_relationship will affect ALL entities by the name of "soldiers".
Since I'm on the topic of metropolice, I'll make a note about manhacks. You can set police to start with manhacks on their back. They just sit on their backs, and the soldier pulls them off in combat and turns them on. If you give them manhacks, they will deploy them, but the manhacks will not like you, so use caution when giving friendly police portable manhacks.
![]()
Once all that is set up, compile your map and play, and the policemen should not harm you. I even have a demo for you to watch in case you don't want to play it yourself.
Related:
Example Map
Alcoholic
