|
This tutorial was submited on Dec 23, 2005.
First off, let me show you my layout.

As you can see I have place env_global, logic_auto, npc_metropolice, and ai_goal_police entities in the map.
Env_Global (Optional)
This entity can be used to set a basic level of behavior for the npc_metropolice entities. When the Global State Gordon Pre-Criminal is set, the npc_metropolice entities will only push you when you get too close and chase you when you throw objects at them. This is how they are set in the beginning levels of Half-Life. When Gordon Pre-Criminal is not set then the npc_metropolice entities will give you 3 warnings then chase you for a bit before returning to their original location.
Logic_auto
This is the entity used to make the npc_metropolice entity begin policing when the map starts.
Use these outputs:
My output named: OnMapSpawn
Targets entities named: (your npc_metropolice entity)
Via this input: SetPoliceGoal
With a parameter override of: (name of your ai_goal_police entity)
Npc_metropolice
This is the actual entity that will be policing. A couple things to note about this entity:
Notice how in the picture that the npc_metropolice entity is not standing on the ai_goal_police entity. When the npc_metropolice entity receives the SetPoliceGoal input properly it will walk to where the ai_goal_police entity is.
Also note that you can set specific behaviors about the entity directly while the ai_goal_police can set others.
Ai_goal_police
This is the entity which sets the area for the npc_metropolice to police. If the target gets near the radius of the ai_goal_police entity the npc_metropolice entity will issue verbal warnings but not take action. When the target enters the radius the npc_metropolice will act according to the behaviors that have been set by the ai_goal_police and itself.
There are other ways to tell an npc_metropolice to start policing. For example, you could set up a trigger_mulitple (or single) and use a similar output to the one used by the logic_auto. Really, any entity that is capable of sending an output can work.
Download the example map (1.48KB) and see it yourself.
Still need help? Ask your questions in one of our HELP FORUMS
|