Npc Line of sight

Hey, me and my Gmod friends like to play stealth missions using snipers, silenced pistols and the perfected climb swep. But when we play we need to make the npcs ignore players, or disable Ai because the either look at us or fire at us. It would be fun to make them not know youre there unless the see you, so you can AMBUSH THEM :smiley:

Thats why i want someone to make a script thing like a line of sight so you can sneak past them and things like that. Cheers!


I would like this aswell.

I’ve always wanted stealth in Gmod. Sometimes, me and my brother use a tactic of simulating stealth by first allowing the npcs to see us just for a moment, then turning on ignore players, which causes the NPCs to enter an “alert” state so they begin randomly walking around, and then we creep around behind objects and in the shadows to simulate the idea of stealth.

If an addon like this existed, it would make it unnecessary to do all that elaborate stuff just for stealth, and actualy make it possible to be caught.

Yeah exactly! I would like this in gmod soo fucking bad! It would be awesome!

want this

I like this. SplinterCell-Like player detection. I’ll make it.

While testing, I found that most npcs already do this. You can even sneak up behind them by holding alt so you don’t make footstep sounds. You can even rub against them and they won’t know you’re there. (you have to walk very quietly to get that close). The only improvement to source’s already pretty damn good npc system is lighting detection like in splintercell, but I doubt that is possible to implement in lua’s current state.

What if you made a code that took lighting settings from the nearest light and if it was low enough, would turn on the “ignore players.” (Without displaying “ai_ignoreplayers had been changed to 0,” of course)

yeah, like the code could say IF the player is X distance away and the area the player is in is under X amount of shadow/under less than X amount of light, then the npc will not see the player.

Hmm. Well, I’ve found the function Render.GetLightColor so I’ll give it a try.

[editline]17th October 2010[/editline]

Awesome. It works great. Just need to test some more and get all the math balanced.

I löv you

Would be the best addon ever if accomplished. I salute you, grb.

if an npc spots you, they will continue to shoot until they don’t see you, and they will attempt to find you, but after 15 seconds they will lose you.

Shooting, Distance, Moving, Making noise, being in front of the npc, and being in well lit places all contribute to and npc detecting you, and you can be in front of an npc and not alert it if it is dark, but moving will increase your chance of being detected. Shooting and moving will alert it depending on your distance.

Is that good?

O M F G :open_mouth: I LOOOVE YOU MAKE A RELEASE :smiley: (credit me for idea :slight_smile: )

Here, test it for me. No errors so far. I’m not sure if the lighting is balanced though. Put in addons. I’ll release it if it works alright.

:smiley: i’d really like to test it out. D: too bad i don’t own GMod10.

Scratch that just bought it

Very nice work!

dosnt work for me i think? Put up a video someone i wanna see whats supposed to happen :smiley:

I’m going to make a light sensor bar thing like in splintercell, then I’ll release it.