This tutorial will teach you how to make a Combine Sniper, which can be used to ‘seal’ maps, or just act as another problem for the player to overcome.
Some related images:
We will start with our setup. You will only need a handful of entities in this tutorial. They are:
* Phys_ragdollmagnet OR env_shooter
* item_ammo_crate OR lots of item_frag These aren’t necessary if you want to make it impossible to kill the sniper.
Set up an area for the sniper to reside in, and an area that the player will have plenty of room to run around in. Make sure there are lots of obstacles and walls for the player to hide behind. Be sure to texture the back faces of the area that your sniper will be in with tools/toolsblack, because the sniper isn’t actually rendered, and it would look very odd if you could see the back wall that the sniper would be blocking.
Once you’ve done that, select your NPC_Sniper and name him Sniper_1 You can play around with all of his Keyvalues to see what they will do. Click apply and place your sniper inside a window, or other appropriate place.
Next, place an info_snipertarget. This is where your sniper will aim if there aren’t any enemies to kill. Place it near the player, so that they will see there is a sniper in the area. Enter its properties and set Sweep to Speed to 6 and group name to sniper_sweeptarget. Go to the flags tab and uncheck all except Resume if interrupted. This will make the sniper return its aim to this position if all targets have been eliminated.
Place an item_ammo_crate or lots of item_fragsomewhere near the sniper’s position so that it can be killed easily. If you are using an ammo crate, make sure you select grenades under ammo type. You can skip this step if you don’t want the player to be able to kill the sniper.
Finally, we have our phys_ragdollmagnet. This is what is going to make the sniper ‘Fall’ out of the window. Alternatively you could use an env_shooter and set the model to models/Combine_Soldier.mdl, like Valve does in some of its levels, mainly where a phys_ragdollmagnet isn’t practical. (If there are other ragdolls in the area that are too close to the magnet.) If you are using a phys_ragdollmagnet, place it just outside the window that the sniper should fall out of. Make it a bit underneath the window and set Force to 3000 and Effective Radius to an appropriate size, making sure that only the sniper is covered.
If you wish to use an env_shooter instead, place it inside the window, where the sniper is. Name it Sniper_Ragdollshooter and set the model to models/Combine_Soldier.mdl and change the various properties as needed. Now select the NPC_Sniper and go to it’s outputs tab. Click add and set it to this:
My output named: OnDeath
Target Entities named: Sniper_ragdollshooter
Via This input: Shoot
Now You’re done! Compile and run, get killed by the sniper, and try it again. I hope if helped anyone with some problems they were having, and thanks for reading my tutorial!