Knight's Sanity
This library will not function if your server doesn't have the Knight's Sanity mod installed.
General
AoE Shapes (Reference sheet)
| Type | Index | Shape |
|---|---|---|
| Point | 0 | Point |
| Point | 1 | Sphere |
| Point | 2 | Cylinder |
| MultiPoint | 0 | Wall |
| Directional | 0 | Cone |
| Directional | 1 | Line |
| Directional | 2 | Cube |
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 )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 [, float radius = 1, Color color ] )GetColor function
Syntax:
lua
Color KSVolume:GetColor()GetRadius function
Syntax:
lua
float KSVolume:GetRadius()SetColor function
Syntax:
lua
void KSVolume:SetColor( Color color )SetRadius function
Syntax:
lua
void KSVolume:SetRadius( float radius )