-
Notifications
You must be signed in to change notification settings - Fork 0
Hazard system
For more detailed and technical information, check this page.
KAI NPCs have the ability to detect nearby hazards, these hazards have to be actively emitted from the danger in question towards the NPCs. For example, a dangerous monster AOE attack needs to emit a warning to all nearby KAI NPCs for them to sense it.
This feature allows monsters to know when to avoid dangers like attacks, harmful floors, crushers, etc. It only passes information on what the danger is, so you can decide how your monsters act based on that information yourself. This includes info like the extent of the threat, its' general type, range, etc.
While what NPCs do with the hazard info they are given is up to them, the cleanup of no longer valid entries (e.g hazards that are now out of range) is handled automatically. In addition, the library itself has 2 built-in hazard emitters that can both be used by ZScript, and also placed on maps.
This is the base hazard zone, it simply warns all KAI NPCs around a specified radius. You can change the nature of the threat it warns of using its' custom arguments. In addition you can pass custom tags as a comma separated list. And making it dormant disables the hazard emission, allowing you to use it for scripted events or time it to specific events, like only activating it when a map trap is triggered.
The hazard zone has the following arguments:
Range: The range of the hazard, with the zone actor acting as the origin.
Type: The type of threat this is. Like for example if it's an attack, another actor, or an environmental hazard.
Level: Just how big of a threat this hazard is.
Flags: Custom attributes of the hazard.
- Ignore sight checks. Informs NPCs that they should run from this hazard even if it's out of sight, as long as it's in range. It's up the NPC itself to obey this.
In addition, the zone has a string user variable in the "Custom" tab, where you can pass custom tags like if the hazard is an explosive attack, as a comma separated list.
Behaves largely like the standard emitter, except that instead of producing a warning around a specific point, it warns all eligible NPCs inside of the sector the emitter is in. It also does not allow you to specify the hazard type (It's always HAZARD_WORLD), but you can limit whether or not it warns flying or ground NPCs. And can still pass custom tags through user_tags.
- Home
- Features
- Classes
- Functions
- Guides