General Half-Life 2/Scripting
description
Make the combine weld open a door and blow it open.
keywords
combine, door, pry, combine door, explode, open, soldier, combine soldier.
This tutorial will explain how to make combine appear to pry open a locked combine door that they will later blow open and advance through.
Firstly, make a medium sized room that will hold a long combine wall, a player start, and enough room for two combine npc's to run and shoot in. Compose a long wall textured with any of the shiny dark combine textures. Then, clip a 128x128 section of that wall into its own brush, this wll act as the locked combine door. Take that door brush and center the texture completely, then clip that 128x128 brush into two separate brushes by the Y axis, so you have two 64x128 brushes. Make both combine door brushes separate func_physbox brush entities. Name them "combinedoors", set the material type to "metal" and tick the following flags: Ignore +USE for pickup, Motion Disabled, and physgun is not allowed to pick this up. It is important to also change the mass scale to ".9" to lighten its weight.

Now that we have our two locked and static combine doors, we will make the actual moving welding spark. create an env_spark entity at the very top of the meeting edges of the two combine doors, so it it welded starting from the top. Name the env_spark entity "spark" and tick the "glow" flag. Set its parent to "sparkbrush".

Now we will create the entity that will make the env_spark move. Create a tiny 2x2 unit brush textures with "nodraw" around the env_spark entity, so the center of the nodraw brush
is also in the same exact center of the env_spark. Select this nodraw brush and make it a func_movelinear brush entity. Name this entity "sparkbrush", set its speed to 10, set its move direction to "down", move distance to 128, and its starting sound "ambient/energy/weld1.wav", and tick the "not solid" flag.
We will now create the explosion effects. Place an env_explosion entity right in the middle of the two combine physbox doors. Name it "doorexplosion", and set the flags and other keyvalues to your liking, but make sure to tick the "no damage"
flag so it wont hurt you or the combine soldiers.
Next, place two npc_combine_s soldiers BEHIND the combine doors, as if they were the actual soldiers welding the door open. Set their name and squad to both "doorsoldiers", and change their sleep state to
"Waiting for input, ignore PVS". (it is also possible to make them spawn from a point_template or npc_template_maker but is not necessary) Set their keyvalues to your liking, but don't change their flag status. Make sure they are facing the two combine doors, and have plenty of info_nodes for movement and combat.

Lastly for the effects, place an env_physexplosion right in the middle of both of the combine doors, but 32 units behind the doors ON THE OTHER SIDE of the wall that your on, so the doors will explode open in your direction. Name the entity "physdoorexplosion", set its magnitude to 1000000 and set the "limit to entity" keyvalue to "combinedoors". Set the flags to your liking.

Now to make everything run. Place an appropriately sized and placed trigger_once brush entity in front of your combine doors. Add the following outputs:
OnTrigger sparkbrush Open 0.00
OnTrigger spark startspark 0.00
OnTrigger spark stopspark 13.00
OnTrigger combinedoors enablemotion 15.00
OnTrigger doorsoldiers wake 15.00
OnTrigger doorexplosion explode 15.10
OnTrigger physdoorexplosion explode 15.10

And that is it, when you touch the trigger the spark will slowly move down the door, followed by the explosions and the combine waiting to shoot at you. Thanks for taking this technique into consideration.
- Spas12

