NPC_Sniper Entity

  • Thread starter Thread starter Aavenr
  • Start date Start date
A

Aavenr

Guest
Hey there,

You may be remember snipers on HL2 weren't really out there in the open, but secluded on dark corners where you could only flush them out with explosives. I want to have some of them on top of the Combine watch towers, so I have been trying to get the NPC_Sniper enemy to take damage from regular weapons and not just explosions (say, with grenades or the LAW) or physics objects. However, I have looked hard into the entity's settings and its flags, and wasn't able to find anything useful.

I have also attempted to sort of hack my way to some decent results by trying to place an entity that would detect when it is being shot at and in turn kill off the sniper. That said, I inspected closely all the different trigger entities and none seem to be able to tell when they are being shot. The closest thing I have found is the func_guntarget entity, which allegedly is a moving target that moves along a path of path_tracks, and it can be shot and killed.

So I created a mesh around the sniper, tied it to this entity and set it up so that when the entity was killed it in turn would set the sniper's health to zero. I even placed a path track to it (since it's after all supposed to be a moving target entity) on the exact same spot it was originally (so that it stays in place) but for some reason, the entity just doesn't seem to die, even with the minimum "damage to take" setting. I am not sure how to proceed now.

So guys, I come to your help. Would you know by any chance if it is possible to tweak the sniper so that it can be shot at with say, a crossbow? Or is it possible to do with the help of a trigger entity and if so, what entity would work here?

Much appreciated! ;)
 
what would be the point of having the sniper visible anyway? there are no sniper animations
 
The sniper is represented as a combine soldier.
 
yes i know, but what i mean is he has no weapon and no weapon-use animations, so while he's firing at you he won't look like he's firing a sniper rifle

what does he look like when firing anyway?
 
Raeven0 said:
Func_breakable?

Now I feel a bit stupid for not thinking about it. :)

UltraProAnti said:
yes i know, but what i mean is he has no weapon and no weapon-use animations, so while he's firing at you he won't look like he's firing a sniper rifle

A good point, no doubt. The character model just stands there completely static while the invisible rifle shoots around. Thankfully I am having the sniper positioned on a watch tower high on the air and away from the player, so I figure I can get away with it. I fear it just wouldn't be very intuitive if I were to build an intricate barricade for him in that tower and assume the player will take him out with the LAW or some grenades.

So anyways, I spent a full day struggling with this issue and I thought I would share with you guys what I have found so far.

I decided to give the func_breakable a shot and rather than having it send the sniper a sethealth to 0 input -- which for some reason it doesn't seem to work -- I had it trigger an env_explosion placed behind the sniper. The explosion entity had its flags set to not produce any visible fx or sound so that it would go unnoticed.

This set-up works like a charm except that for some weird reason if you place the func_breakable as a brush on top of the character it won't detect the crossbow's projectiles. It does detect regular bullets and explosions but the only way it goes off from a crossbow projectile is if you have the breakable brush away from the sniper so that it doesn't touch it -- and if you do that the main problem is the sniper sets off the trigger himself when shooting at the player. The other problem is func_breakable forceably produces material gibs/debris when breaking and if you set the material type to flesh it only churns out wood pfx, not flesh. I was able to minimize this by setting the material type to metal, which is the more subtle of the bunch, and not noticeable enough at a long range to bother me.

I really would like to make this work with the crossbow, since it is the specialized long-range gun on the arsenal, but it seems impossible with this approach. But hey, given the difficulties, I guess I will take what I can get. :)
 
That's a strange issue. The sniper absorbs the crossbow darts, or what?
 
Raeven0 said:
That's a strange issue. The sniper absorbs the crossbow darts, or what?

I suspect something like that is at work here. Too bad, really.
 
Back
Top