User login

Navigation

Poll

I downloaded the ETQW demo and....
...I'm too busy playing for polls.
0%
...it's awesome.
60%
...it's okay, I expected better.
20%
...I'm lost in the valley, anyone have a map?
0%
...my machine won't run it. :-(
20%
Total votes: 5

Who's online

There are currently 0 users and 38 guests online.

Welcome to RUST | Gamedesign.net

Hidden and Dangerous: npc_sniper

Submitted by yesukai on Sun, 2005-03-27 23:01.

SniperOne of the cooler enemies in Half-Life 2 was the npc_sniper. Your invisible foe, firing well aimed leaded death from the other end of a blue laser. Getting these guys into the game is fairly simply, but getting them to work well takes a few more entities then just a npc_sniper.

The first thing to do is make your sniper's nest. The nest should be fairly high up, but close enough to the ground to make shoving a grenade down his throat easy. Make it (at least) about 80 units tall and 48 units wide/deep. Cutting out the window from a texture works well for making a room large enough, and as a plus, it actually looks like he is inside a window. Now, do not put a light source in the room, snipers are not meant to be seen, and they look pretty bad if they are. Between shots their "idle" animation is the same as their ragdoll, so unless you want a sniper that plays "airplane" between shots, keep it dark.

The next step is to place the sniper in the nest. Using the entity tool (Shift-E), simply place a npc_sniper in the nest, away from the walls and close to the opening. Rotate the sniper to face out the window. Now, the sniper has a few keyvalues that you may find useful:

  • Squad Name: If this is set to the same as some troops on the ground, and the Wake Squad attribute is set on all of them, the sniper will alert the troops to your presence when he sees you, (or visa-versa).


  • Initial Misses: How many times the sniper should miss you when he firsts sees you. You should probably make this 1, as its no fun to get pw0ned before you even see the enemy.


  • Beam Brightness: How bright to make the "blue laser of death".


  • Bullet Shield Distance: Turns out bullets don't hurt snipers. This and the Bullet Shield Radius control how large of a shield of protection these guys have. The default value works well.


This guy pretty much uses standard flags, you really shouldn't have to mess with any of them.

So, now that we have the sniper, lets make him more dramatic. In the opening you made for him to shoot out of, make a thin brush covered with tools/NODRAW. Using the Texture Application Tool (shift-A) change the face that faces outward from the sniper into a nice partially transparent window textures, like glass/glasswindow002c. Resize it to look less like glass and more like just a frame, then tie it to a func_illusionary with a render mode of solid and a render amount of 255. This will make the glass panels transparent, but will leave the bars. Give the func_illusionary a name, like sniperwindow. You will use the name to destroy the window, by having an output on the sniper's OnDeath target the func_illusionary's Input of Kill. Sniper dies (which will happen by explosion), the window frame is gone.

Now, one last step that no sniper can be without is the phys_ragdollmagnet. This is the physics entity that, after the sniper is dead, will pull his corpse out of his nest, sending him tumbling towards the ground in true Hollywood fashion. Simply place one of the these bad boys to the front and down a little from the sniper, out in the open air. Make sure the "effective radius" is high enough to envelope our sniper, and give the "force" key a reasonable value, like 5000.

Well, we are done. When the sniper sees Gordon he will attempt to kill him, at which time Gordon throws a grenade into the window and sends our poor sniper plummeting to his death. Doesn't get any better then lasers and falling corpses. As usual, if you have any questions or comments about this article, post them here or email me at jeffca51 at yahoo dot com. Any other mapping questions can be directed to the Half-Life 2 or Hammer forums.

RUST | Gamedesign.net is your source for all the latest game-editing news and tutorials. If you are seeing this message, this means that you are using a browser that does not support CSS. Please upgrade your browser and enjoy your stay at RUST and if you have any questions, comments, or suggestions, please contact a site administrator.