Alert & Suspicion Triggers

From The DarkMod Wiki
Jump to navigationJump to search

TODO PLACEHOLDER

AI will alert if they see or hear the player but alerts and suspicion (low alert) can be triggered by the AI noticing suspicious or missing objects and other situations. This article describes how to control this.

Suspicious Objects

TO DO noisemaker arrow on floor

CHECK OUT AIUSE_ STIM_VISUAL

That's what is issued by STIM_VISUAL on arrows, doors and AI by default. The AI code reacts to those stims based on the AI_USE spawnarg.

NOTES PASTED FOR REF TO REWRITE...

script function for responding to STIM_VISUAL in ai_darkmod_base, and made some tweaks to the visibility tests in the dll (not in the pk4 yet). By adding a visual stim to the arrow and arrow result defs, I've got the AI reacting to arrows that it sees (only the first time it sees each one, using the ResponseIgnore script function.)

However, I'd like to have the AI react differently to different sorts of objects.

variable to classify the response to stim_visual: IMO, I think it's easier to just create different stims for these different cases, with the functionality in the response. E.g., stim_body, stim_suspicious_item, stim_missing_item, etc.

Suspicious Changes

Doors ajar, torches exgtinguished

Missing Objects

Pasted from forum. to be re-edited.....

Absence markers are working now (although still a little bit WIP). All entites can have this functionality. (So AI could also notice a missing corpse for example)

There are the following spawn args for defining the properties on the entity that should be noticed when gone missing (which needs documenting in the defs, I know ):

absence_noticeability: defines the probability of noticing that the item has gone missing.

If this is > 0, an absence marker will be spawned at the original location (at the center of the bounds) which emits a visual stim. When the item is put back at its original location (within the original bounds of the entity), the absence marker is destroyed again.

absence_location_1: instead of the original location, you can define a place where the entity should be. Simply creating a brush textured with clip and converting it to func_static will do. (At the moment, only the _1 will work, making multiple locations possible is still TODO)

absence_bounds_tolerance: expands the testing bounds (both of the original location and the absence location)

team: This spawn arg can be set on all entites now. If it is set, only AI with friendly team will react to the missing entity. Entites without this spawnarg will be noticed by all AI.

absence_alert: Alert increase the AI will get. If this is not set, the AI's alert level will be set to just below agitated searching.