-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NPC retreat, no investigate, and investigate limit zones #29867
Add NPC retreat, no investigate, and investigate limit zones #29867
Conversation
I wonder if there might be more appropriate names for "no investigate" and "investigate limit". Those aren't very self explanatory. Having it in the dialogue tutorial does help |
I am open to suggestions for better names. They make sense to me and all zone names are kind of cryptic, honestly. |
Yeah, I'm struggling to think of anything better at the moment too. If it comes to mind I'll let you know |
No investigate zone - how about "ignore sounds" zone? Investigate limits - I think this one is probably okay if 'no investigate' is changed since it makes them less similar sounding. However I sort of vaguely think "investigation limits" sounds a little clearer in intent. |
Make both of these functions take an int range argument that defaults to MAX_DISTANCE.
Add a new zone that friendly NPCs will prefer to retreat to, instead of fleeing in a blind panic. Update the NPC dialogue tutorial.
Add two new zones: one prevents friendly NPCs from investigating noises coming from it, the other prevents friendly NPCs from investigating noises coming out of it.
c8fa040
to
adf3dbb
Compare
"Don't investigate" "Investigate within reason/limits" |
Summary
SUMMARY: Features "Add NPC retreat, no investigate, and investigate limit zones"
Purpose of change
Part of #29333
Add 3 new zones for friendly NPCs:
Describe the solution
Add two new functions to the zone manager: get_nearest returns the nearest point of a zone type within a specified distance, and has_defined returns true if there is a cached zone type.
In npcmove.cpp, good_escape_dir will attempt to path to the nearest retreat zone in preference to using the threat map.
in npctalk.cpp, handle_sounds will skip investigating sounds that come from inside a no investigate zone, or if a investigate limit zone is defined, from sounds coming from outside of it.
Update the in-dialogue tutorial to include the new features.