In this tutorial, you will learn how to make a Combine metro police officer kick down a door. This is an effective cinematic scripted sequence that can really freak out your players if done properly. This tutorial assumes intermediate knowledge of Hammer.
(Note: I’ve cut away the walls so you can see better.)
Firstly, construct two small, connected rooms linked with a doorway as in the picture.
Create a “prop_door_rotating” and set the “World Model” property to models/props_c17/door01_left.mdl. Place it in your doorway.
Name it “Door” and set the “Speed” property to 250. The only flag that should be checked is “Ignore player +use.”
Next create an “npc_metropolice” entity behind the door. Name him “cop”. All of his other properties and flags are optional. The player won’t even see him until he kicks the door open.
Go to his “Model” tab and select “Kickdoorbaton”. You can now see how far the cop’s foot extends when he kicks. Move him forward or back so that his foot just starts to go through the door.
{Note: I apologize, in this picture, I have already added a scripted_sequence and am too lazy to retake it. Please ignore the presence of the scripted_sequence.}
Next, create a “scripted_sequence” somewhere on the map, preferably behind the cop.
Name it “DoorKick”. The properties should be as follows.
Name: DoorKick
Parent: (Blank)
PitchYawRoll: (Unnecessary)
Target Npc: Cop
Pre action idle animation: (Not necessary, the player won’t see him at the time.)
Entry Animation: (none)
Action Animation: Kickdoorbaton
{Leave the rest as default, except for…}
Move to position: No
On player death: Do nothing.
Next, create an “ambient_generic” somewhere near the door.
Create the following properties for it.
Name: Knock
Sound Name: ambient/materials/clang1.wav (or some other similar sound)
Volume: 9 or 10.
Next, create another ambient_generic entity.
Set the following properties:
Name: Bam!
Sound Name: ambient/materials/door_hit1.wav
Volume: 10
The rest of the properties are fine as they are.
Once this is done, create a logic_auto somewhere in the corner.
Add the outputs in the picture below.
After doing this, return to your scripted_sequence. Click on the “Outputs” tab. Add the following outputs.
My Output Named: OnBeginSequence
Target Entities Named: Door
Via This Input: OpenAwayFrom
After a delay in seconds of: 0.75
My Output Named: OnBeginSequence
Target Entities Named: Bam!
Via This Input: PlaySound
After a delay in seconds of: 0.75
Believe it or not, at this point, you’re pretty much done. Create an info_player_start somewhere in the map and run it (making sure that yours has walls, unlike my example :p ).
If you did everything correctly, the map will load up, and after about three seconds, you should hear three loud knocks on the door. A few seconds later, the door will be kicked open by the cop. If you’re having trouble seeing it, you can turn go to the console by pressing the ~ tilde key. (You may have to turn on “enable developer console” under “Advanced Options” of the “Keyboard” tab in the options menu.) Enter “mat_wireframe 1” in the console and press enter. Oooh, pretty Tron effects… but seriously you can see what the cop is doing behind the wall.
If this is all that you wanted to do, than great, but chances are that you wanted the cop to actually enter the room after knocking the door down. I will cover that next...
Create a “path_corner” entity in the middle of the room that the metro cop enters. Name it “Corner”.
{Once again, please ignore the ground nodes in the picture :/}
Next, create a “aiscripted_schedule”.
Name it “schedule” Set the “Target Npc” property to “Cop”, and the “Goal Entity” to “Corner”.
Return to your “logic_auto” and click on the “Outputs” tab. Add the following output:
My Output Named: OnMapSpawn
Target Entities Named: Schedule
Target Input: StartSchedule
After a delay in seconds of: 7.5
Finally, add in a bunch of “info_node” entities. As far as I know, there’s no exact science to this, so just pretty much cover the floor with them.
If you haven’t already, create an info_player_start somewhere in the room and run the map. If you don’t want the cop to attack the player as he enters, you can create an “ai_relationship” entity somewhere on the map.
If you do, set the properties to:
Name: (Unnecessary)
Subject: npc_metropolice
Target: !player
Disposition: Like
Radius for subject: 0
Disposition priority: 10
Start Active: Yes
Reciprocal: (Unnecessary)
Now, after the cop kicks in the door, he will come inside the room. Congratulations! You’re done!
As a completely optional extra bit, I will write out how to make a change to this sequence, in which after the cop kicks down the
door, his escort of two soldiers enters the room with weapons drawn, followed by him. This is just for those interested.
Extra Bit
Firstly, if your rooms were as small as mine were in the tutorial images, I reccomend that you make them larger. {You don't need to worry about having so many nodes yet}
Next, create two "npc_combine_s" entities behind the cop, as sort of a guard or escort. Name them "Soldier1" and "Soldier2".
Move your path_corner from here
To here.
This is where the cop will backpedal to, allowing the soldiers to enter the room first.
Go to the properties of your cop and change"Pistol Starts Drawn" to "Yes" if you haven't done so already.
Go to your "logic_auto" and change the following output:
My output named: OnMapSpawn
Target entity: Schedule
Trget Input: Start Schedule
Delay: (Change to 6.75)
Create a new "aiscripted_schedule" somewhere on the map. Give it the following properties:
Name: Soldier1Schedule
Target Npc: Soldier1
Search Radius: Unnesscesary
All in radius: No
Ai State to set: Set state to COMBAT
Schedule to run: Run to goal entity
Interuptability: Damage or death
Goal entity: (Nothing yet)
Create another aiscripted_schedule. Set the following properties:
Name: Soldier2Schedule
Target Npc: Soldier2
Search Radius: Unnesscesary
All in radius: No
Ai State to set: Set state to COMBAT
Schedule to run: Run to goal entity
Interuptability: Damage or death
Goal entity: (Nothing yet)
It's redundant, I know. Create one more aiscripted_schedule. Set the properties to the same as the last two, except for:
Name: copSchedule2
Target Npc: cop
Next, you're going to need a few path_corners in the room. Create one about here and name it "SoldierPath2".
Create one about here and name it "SoldierPath1".
Create one more about here and name it "copPath".
Return to your aiscripted_schedule entites and set the "Goal Entity" properties to the following:
Name: Soldier1Schedule
Set "Goal Entity" to: SoldierPath1
Name: Soldier2Schedule
Set "Goal Entity" to: SoldierPath2
Name: copSchedule2
Set "Goal Entity" to: copPath
Finally, go to your logic_auto. Change any outputs that may be different to the ones in the picture, and add the new ones.
{I hope that's clear enough to read...} You may have to fiddle with the timing of the schedules on here, depending on how far away the soldiers are from the door, etc, because only one soldier can fit through the door at a time. Messed-up timing here can make it look like an episode of The Three Stooges. Lastly, add in a bunch of nodes, pretty much covering the floor.
Combine soldiers are pretty picky about their nodes, so if they aren't getting to their path_corner properly, chances are that they either don't have enough nodes, or they are spaced too far apart.
Well, it appears that the "extra bit" has turned out to be longer than the actual tutorial. Sorry about that :/
For questions or feedback, you can email (hambandito@gmail.com) or PM me.
-Psalm
Great tutorials, keep up the awesome work :D
cool, what will your next tut be? :p
cant wait
Nice you listen to people :D I can really use this. You would be the most awesome guy if you could make a cop that kicks a door open, and two(2) cops enter and the first enter after. That would be friggin awesome.
Wow, thanks for the positive feedback everyone! Suduki, I think I know what you mean... I'll see what I can do :D
THAT IS SO FRIGGIN AWESOME!!!!!!!!!!!!!!!!!!!!!!!! YOU JUST MADE MY DAY!!!!!!!!!!!!!!! Gonna use this to convert my CSS map into a SP HL2 map :D Im out of requests now...
wow sweet man
sweet
Great tutorial. I learned alot from it. The only problem I had was when the cop kicked the door. It didn't really move; it seemed stuck. But later..when the schedule kicked in..the door opened fine. Any thoughts?
hi Great tutorial but the images are not working properly when i click the
image to go the the big version it opens Moddb.com
hi
Really Good!
Everything worked nicely!
Looks like S.W.A.T tactics, really cool!
How am I supposed to add the outputs in the picture when you can't maximize it, help please.
In case anyone can't read the properties in the 10th picture from the top, (of the Logic_Auto) here they are:
My Output Named: OnMapSpawn
Target Entities Named: knock
Via This Input: PlaySound
Delay: 3
Only Once: Yes
My Output Named: OnMapSpawn
Target Entities Named: knock
Via This Input: PlaySound
Delay: 3.2
Only Once:Yes
My Output Named: OnMapSpawn
Target Entities Named: knock
Via This Input: PlaySound
Delay: 3.4
Only Once:Yes
My Output Named: OnMapSpawn
Target Entities Named: doorkick
Via This Input: BeginSequence
Delay: 6.0
Only Once: Yes
THANK YOU SOOOOOOOOOOOOOOOOOO MUCH!!!! I was really worried there for a second.
2021 and this guide is still helpful to people. Cheers.
what about hl1 grunts kicking down doors?