Skip to content

Knight's Sanity ​

This library will not function if your server doesn't have Knight's Sanity installed:

General ​

AoE Shapes (Reference sheet) ​

TypeIndexShape
Point0Point
Point1Sphere
Point2Cylinder
MultiPoint0Wall
Directional0Cone
Directional1Line
Directional2Cube

PushCharacter function ​

Syntax:

lua
void KS.PushCharacter( Character player, Vector origin, float distance, bool pull, bool sweep )

SelectCharacters function ​

Syntax:

lua
void KS.SelectCharacters( Character player, int targets, float maxDistance, table<string> allowedTargetTypes, bool allowPartial, bool allowRepeat, string command, string title )

Possible Target Types:

Players
Self
Puppets
NPC

SelectPoint function ​

Syntax:

lua
void KS.SelectPoint( Character player, int shape, float maxDistance, float radius, float height, string command, Color color, string title )

SelectMultiPoint function ​

Syntax:

lua
void KS.SelectMultiPoint( Character player, int shape, float maxDistance, float length, float width, float height, string command, Color color )

SelectDirection function ​

Syntax:

lua
void KS.SelectDirection( Character player, int shape, float length, float width, string command, Color color, string title )

ProcessAoE function ​

Syntax:

lua
void KS.ProcessAoE( Character player, Vector point, int shape, float radius, float height, bool visualize, bool trace, Color color )

ProcessMultiPointAoE function ​

Syntax:

lua
void KS.ProcessMultiPointAoE( Character player, Vector first, Vector second, int shape, float width, float height, bool visualize, bool trace, Color color )

ProcessDirectionalAoE function ​

Syntax:

lua
void KS.ProcessDirectionalAoE( Character player, Vector point, Rotator direction, int shape, float length, float width, bool visualize, bool trace, Color color )

GetSelectedPoints function ​

Syntax:

lua
Vector, Vector, Rotator KS.GetSelectedPoints( Character player )

GetSelectedCharacters function ​

Syntax:

lua
table<Character|TotPuppet> KS.GetSelectedCharacters( Character player )

InfoBox function ​

Syntax:

lua
void KS.InfoBox( Character player, string title, string content )

CombatTracker function ​

Syntax:

lua
void KS.CombatTracker( Character player [, table<string> playerNames = {}, int activeTurn = -1 ] )

CreateCUI function ​

Shows a Custom User Interface to a player. Generate definition code using cui.ratajmods.net.

Syntax:

lua
void KS.CreateCUI( Character player, string definition )

Redlight function ​

Toggle redlight warning on screen of all players.

Syntax:

lua
void KS.Redlight( bool enabled [, bool blocking = false ] )

Volumes ​

Volumes are static visualized areas, they can represent lasting area of effect, or anything else. They have essentially no functionality and only serve as visualizers.

KSVolume constructor ​

KSVolume can be constructed directly using a function of the same name.

Syntax:

lua
KSVolume KSVolume( Vector location, string shape, table options )
ShapeOptions
Sphereradius, color
Cylinderradius, height, color

GetColor function ​

Syntax:

lua
Color KSVolume:GetColor()

GetRadius function ​

Syntax:

lua
float KSVolume:GetRadius()

GetHeight function ​

Syntax:

lua
float KSVolume:GetHeight()

GetShape function ​

Syntax:

lua
string KSVolume:GetShape()

SetColor function ​

Syntax:

lua
void KSVolume:SetColor( Color color )

SetRadius function ​

Syntax:

lua
void KSVolume:SetRadius( float radius )

SetHeight function ​

Syntax:

lua
void KSVolume:SetHeight( float height )