Can you adjust npcs fov/line of sight, increase their vision distance?
8 replies, posted
Npcs act blind and I want them to see player from bigger distance
Which npcs exactly ? Standart npc from HL2 series ? Like Combines and civillians ? You could make some trigger which will give them some hints about player location. Second variant is to mess with lua scripts.
Every standard npc from hl2 and I want it to look as much natural as it can. I have some kind of arena that lets enemies in but they are idling until player comes close so you can exploit it just by staying in the corners
I bet I saw something what can force npc to see you, but i canr remember what exactly. Everything what i can recommend for now - make trigger which will force npc to move to exact ground node, so it would like theyre very cool tactical guys who can move across battlefield between corners.
Here's a solution i use: Name the NPCs (don't have to but it helps)
1) Place an aiscripted_schedule anywhere on the map
2) Set the target entity to 'player' (might work, don't include speech marks) or '!player' (definitely works, but will only go for player 1, don't include speech marks)
Set the NPCs to use (i think it's source entity) to the npcs you have named.
Set the schedule to run as 'Set Enemy to Goal Entity' or 'Set Enemy as Goal Entity AND Run to Goal Entity'
3) Either when the npcs spawn, or by trigger_multiple, add an output from a logic_relay or the trigger to start the schedule.
4) In game, the npcs will auto target the player when the schedule starts, hopefully at every distance. You MUST include AI nodes for this to work, but your map should already have those where appropriate.
Hope this helps
Thanks, this works with most npcs but I still got problem with rollermines, when they are out of player range they turn themselves off any way to avoid that?
npc_enemyfinder might help, put rollermines in the same squad basically
How do you set this entity up? I can't get it to work, I got the rollermines squad name added to npc itself + enemyfinder, it starts enabled but makes no difference
I find npc_enemyfinder awkward to use, i'd skip it personally! (Don't take this advice too seriously!)
Rollermines work in a fundamentally different way to other npcs in that they have a very small aggro radius (as they are mines) and lose track of enemies instantly when out of range.
You could always try and force them to roll somewhere or towards the player by using a scripted_sequence. Not sure if rollers respond to it though.
Or... you could try...
...making a separate aiscripted_schedule for the rollermines. Rather than 'Set Enemy to Goal Entity' try 'Run to Goal Entity' and see if that works out.
No idea if this works, but it might. You could set the 'interruptability' to 'Damage or death' or 'general' to make it abandon the chase when the player is found and shoots at it.
Quoted in the wrong area but u know what i mean!
Bottom line is you may have to abandon this idea for rollermines unless you are willing to go to extra lengths to achieve the effect. Hopefully not. Update this thread with your findings and i might do more investigation on it.
Sorry, you need to Log In to post a reply to this thread.