Skip to content

Custom line of fire checks

inkoalawetrust edited this page May 21, 2023 · 2 revisions

The KAI library allows for the easy creation of new line of fire checks through the highly modular KAI_LOFRaycast class, which is based on LineTracer, and contains dozens of functions for checking the hit results of traces. Allowing modders to easily create new unique checks for any attack.

The default line tracer allows for KAI NPCs to not pointlessly fire at obstacles they can't shoot through, unlike vanilla monsters which will continue trying to fire their projectiles through solid props like dead trees and lights.

KAI's line of fire checks also support additional features, like allowing NPCs to shoot explosive attacks at their target, even if the attack won't hit said target, as long as the target would still be caught in the blast radius anyway, and isn't immune to splash damage.

Unlike a lot of the other features in the library, custom LOF checks aren't directly tied to KAI_Actor or its' child classes, which means that non-KAI NPC actors can also use it.

See also

Clone this wiki locally