Jump to content

NPC listening distance?


Recommended Posts

I am looking into npc scripting, and got one placed, however, I am not sure how to correct its behavior.

 

Using what I can find from Lassev's NPC routing, and what Arth posted on map-forge about the available npc entitiy,  I am able to get far, see links below

 

http://www.student.oulu.fi/~lvaarisk/tutorials/navgoaler.htm

http://map-forge.net/wiki/doku.php?id=tutorials:npcwaves_data:npcwaves

 

But I am wondering what the listening distance is from an NPC, and is this available to set. As in listening I mean detecting, if this is in view. I checked Behaved, and there is indeed something that is called field of view (the Hfov and Vfov -> horizontal and vertical) As i dont want it to seek me when I am up, i asume i can set it to 64 units, so it uses 64 units i guess to look up and down away from him, but since i want my character to sneak, i have probably an issue with the horizontal check. What would be recommended, cause as it is filled in blank, it sees me from approx 700 grid units (i placed my avatar on a ledge and i have a stormy patrolling that ledge)

 

Also, as my next question, is there something called an out of combat script i can start, so if i am to far away from the stormtrooper, it should return to it's old duties? (answered it: its called lostenemyscript)

 

 

 

spawnscript - default script to run once spawned (none by default)
usescript - default script to run when used (none by default)
awakescript - default script to run once awoken (none by default)
angerscript - default script to run once angered (none by default)
painscript - default script to run when hit (none by default)
fleescript - default script to run when hit and below 50% health (none by default)
deathscript - default script to run when killed (none by default

 

There are some things i can trigger, but not the "range" thing. Does anybody know a solution for, cause I am not sure if i can set this in an if block within the script. 

 

-edit-

 

Okay in behaved, i see something called lostenemyscript, but when does that kick in, in how far units?

Link to comment

I'm not sure what the listening distance is. You can set it to whatever you want, though.  In the Set Type event  set it to "Set Earshot" ( its down in the list under floats). Then, click on re-evaluate to give it a distance in grid units.  

 

Are you trying to do something similar to Cairn Dock in JO where you have to sneak around or else you get caught?

Link to comment

I'm not sure what the listening distance is. You can set it to whatever you want, though.  In the Set Type event  set it to "Set Earshot" ( its down in the list under floats). Then, click on re-evaluate to give it a distance in grid units.  

 

Are you trying to do something similar to Cairn Dock in JO where you have to sneak around or else you get caught?

 

I actually set it now to 512 units and it seems to work fine through listening. I just need to get him now to not spot me while i am standing behind crates .. or when he loses eye sight of me to return to normal duty ;). Thanks for the suggestions, @@Asgarath83,I ll try it with SET_VISRANGE. 

Link to comment

i still have trouble finding out when the lostenemyscript becomes active. I tried hiding my character in the map, however, it still stayed in offense stance, even if i no-clipped out of the map, it kept following me with his head and never returned to its behavior i stated in the lostenemyscript. Is this not working in JKA?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...