Police Stander: Difference between revisions
(Started - police stands and guards his post) |
Thunder4ik (talk | contribs) m (Unicodifying, replaced: [[Image: → [[File: (2)) |
||
(11 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
A Police Stander is | {{Underlinked|date=January 2024}} | ||
{{lang|Police Stander}} | |||
A Police Stander is an {{ent|npc_metropolice}} who will stand in one spot and warn approaching players to back off. If you get too close to the metropolice, he will strike at you with his baton. This article will set up this simple example. | |||
The Police Stander consists of 3 components: | The Police Stander consists of 3 components: | ||
* | * {{ent|ai_goal_police}} | ||
* | * {{ent|npc_metropolice}} | ||
* A trigger of some sort to set up the relationship. | * A trigger of some sort to set up the relationship. | ||
==Structure== | ==Structure== | ||
<center>[[ | <center>[[File: police_stander_d1.jpg]]</center> | ||
First thing that needs to be done is to set the | First thing that needs to be done is to set the <code>npc_metropolice</code> entity wherever you want him to stand. Then, you need to place an [[ai_goal_police]] entity near the metropolice and assign it a specified radius so it knows to use the metropolice. Finally, a trigger will be needed to set up their relationship. | ||
===ai_goal_police=== | ===<code>ai_goal_police</code>=== | ||
Specifies the goal for the police entity. | Specifies the goal for the police entity. | ||
====Keyvalues==== | ====Keyvalues==== | ||
* '''Name''': A name will need to be assigned. | * '''Name''': A name will need to be assigned. | ||
* '''Radius''': Setting this value will allow multiple metropolice entities within the | * '''Radius''': Setting this value will allow multiple metropolice entities within the <code>ai_goal_police</code>’s radius to be affected. This can be used to make multiple actors do the same action. | ||
* '''Target''': This will need to be set to '''!player''' so the cop targets the player and no other entity. | * '''Target''': This will need to be set to '''!player''' so the cop targets the player and no other entity. | ||
Line 35: | Line 36: | ||
===Trigger=== | ===Trigger=== | ||
<center>[[ | <center>[[File: police_stander_d2.jpg]]</center> | ||
This dialog should explain what needs to be set on a trigger’s output to hook the | This dialog should explain what needs to be set on a trigger’s output to hook the <code>ai_goal_police</code> and the <code>npc_metropolice</code> together. | ||
(If the "OnStartTouch" turns red, try "OnFoundEnemy" instead. If this works, then place the <code>ai_goal_police</code> where the <code>npc_metropolice</code> will stand/walk after it detects the player.) | |||
==Conclusion== | ==Conclusion== | ||
To recap: | To recap: | ||
#A | #A <code>npc_metropolice</code> needs to be placed where you want him to stand and guard with his keys set as stated above.. | ||
#An | #An <code>ai_goal_police</code> entity is set near the <code>npc_metropolice</code> with a ‘’’Radius’’’ set so it touches the metropolice and with its keys set as stated above. | ||
#A trigger needs to be placed with the values set in the above second diagram. | #A trigger needs to be placed with the values set in the above second diagram. | ||
When triggered, the | When triggered, the <code>npc_metropolice</code> should stand at this post (where you placed him in the editor) and whack anyone who gets near him. This example is good for having a visual setup for blocking doorways and other paths instead of just throwing up an invisible wall. | ||
[[Category:AI]] | [[Category:AI]] |
Latest revision as of 00:09, 7 January 2024




January 2024


A Police Stander is an npc_metropolice who will stand in one spot and warn approaching players to back off. If you get too close to the metropolice, he will strike at you with his baton. This article will set up this simple example.
The Police Stander consists of 3 components:
- ai_goal_police
- npc_metropolice
- A trigger of some sort to set up the relationship.
Structure

First thing that needs to be done is to set the npc_metropolice
entity wherever you want him to stand. Then, you need to place an ai_goal_police entity near the metropolice and assign it a specified radius so it knows to use the metropolice. Finally, a trigger will be needed to set up their relationship.
ai_goal_police
Specifies the goal for the police entity.
Keyvalues
- Name: A name will need to be assigned.
- Radius: Setting this value will allow multiple metropolice entities within the
ai_goal_police
’s radius to be affected. This can be used to make multiple actors do the same action. - Target: This will need to be set to !player so the cop targets the player and no other entity.
Flags
- Do not leave post: Checked. This will keep the police in his designated spot.
- Everything else: Unchecked
npc_metropolice
The combine metropolice entity.
Keyvalues
- Name: A name will need to be assigned.
- Weapons: This will need to be set to Stun Stick.
Flags
- Don’t drop weapon: Checked.
Trigger

This dialog should explain what needs to be set on a trigger’s output to hook the ai_goal_police
and the npc_metropolice
together.
(If the "OnStartTouch" turns red, try "OnFoundEnemy" instead. If this works, then place the ai_goal_police
where the npc_metropolice
will stand/walk after it detects the player.)
Conclusion
To recap:
- A
npc_metropolice
needs to be placed where you want him to stand and guard with his keys set as stated above.. - An
ai_goal_police
entity is set near thenpc_metropolice
with a ‘’’Radius’’’ set so it touches the metropolice and with its keys set as stated above. - A trigger needs to be placed with the values set in the above second diagram.
When triggered, the npc_metropolice
should stand at this post (where you placed him in the editor) and whack anyone who gets near him. This example is good for having a visual setup for blocking doorways and other paths instead of just throwing up an invisible wall.