Skip to content
inkoalawetrust edited this page Jun 20, 2024 · 11 revisions

Note: The library is still heavily WIP !

Welcome to the KAI wiki, the wikis' purpose is to document the KAI (Koala AI) Library and its' usage, serving as a code reference for classes, methods, and variables. It may not be a full substitute for having to look at the libraries' codebase, but it should at least reduce the need to do so.

Aside from code reference. The wiki also contains a few guides on tasks like setting up the library, and using it to make custom NPCs with it. (TBD)

NOTE: It is assumed that you have at least a basic understanding of ZScript and/or GZDoom. If you do not, then it is suggested that you read Agent Ash's ZScript guide first, before trying to use the KAI or any other ZScript library.

Using the library in your projects

For info on how to use the library in your own mods/maps, read this page.

My Discord server

For help, suggestions, etc. My Discord server can be found here: https://discord.gg/SxU9Cem3ef

Classes

The NPC base classes. For a (Mostly) full list of KAI classes, check the sidebar. The whole concept of NPC types and their layout is vaguely modelled after VJ Base.

CVARs

The library includes the following server-side CVARs.

KAI_DebugPrintMessages

Allows debugging console messages to actually be printed if on, off by default. Due to ZScript not allowing for passing varargs between functions, there is no generic debug print function. So you must manually check if this CVAR is on before each debug message printed like this:

If (KAI_DebugPrintMessages) Console.Printf ("aeiou");

KAI_DebugTurretAim

Makes vehicle turrets produce 2 particle trace lines every time they call AimAtTarget. A white line, that is aimed at the direction the turret wants to traverse to. And a yellow one, aimed at the direction the turret is actually aiming at.

KAI_DebugHitChance

Makes DetermineHitChance() print debug information on the values by its' Basic and Smart algorithms, such as what actor called the function. For the latter, it also prints out the start and end position of each trace. Along with showing successful traces in green, and failed ones in red.

KAI_DebugPrintGroupEvents

Prints info about any events that occur to NPC groups in the console. Like if an actor in a group was killed, it will print a message of the pointer and class names of both the affected actor, and the group they're in.

CCMDs

KAI_GetTargetGroup

Prints information about all the groups the actor in front of the player is in, if any, easy way to check for group info on particular actors.

Guides

Clone this wiki locally