WarScript API Reference
Native functions available in the global scope
Language
WarScript syntax reference — constructions, data types, and operators.
Basic Constructions
Variables
# plain types
a1 = 123
a2 = "hello world"
# class instance
left_tree_node = new TreeNode [ 1 ]
tree_node = new TreeNode [ 3, left_tree_node, new TreeNode [ 2 ] ]
# array
example_array = { 1, 2, "three", new TreeNode [ 4 ] }
empty_array = {}
Conditions
if a1 > 5 and tree_node :: value == 3
# statements
elif a2 == "hello" or a3 == "world"
# statements
else
# statements
end
print a1 + a2 + tree_node :: value
Import
import "lib/common.ws"
Functions
fun fibonacci_number [ n ]
if n < 2
return n
end
return fibonacci_number [ n - 1 ] + fibonacci_number [ n - 2 ]
end
Loops
# for loop
loop i in 0..10
# statements
end
# with step
loop i in 0..100 by 5
# statements
end
# while loop
loop health > 0
# statements
end
# for-each
loop item in items
# statements
end
# break and next
loop i in 0..10
if i == 5
break
end
if i == 3
next
end
end
Exceptions
class MyException [message]
end
begin
raise new MyException ["Error message"]
rescue error
print error :: message
ensure
print "Always runs"
end
Default Parameters
Trailing function parameters can have default values. Omitting an argument passes null, which triggers the default.
fun greet [name, greeting = "Hello"]
return greeting + ", " + name
end
greet ["World"] # → "Hello, World"
greet ["World", "Hi"] # → "Hi, World"
# All params can be optional
fun point [x = 0, y = 0, z = 0]
return x + y + z
end
point [] # → 0
point [1, 2] # → 3
Lambdas / First-Class Functions
Functions are values. Use fun [params] body end in any expression position — assignments, arguments, arrays, return values.
# Store in a variable
double = fun [x] return x * 2 end
print double [5] # → 10
# Pass as argument
fun apply [arr, func]
result = {}
loop item in arr
result << func [item]
end
return result
end
apply [{1, 2, 3}, fun [x] return x * 10 end]
# Return from a function
fun pick [mode]
if mode == "double"
return fun [x] return x * 2 end
else
return fun [x] return x + 1 end
end
end
# Store in arrays
ops = {fun [a, b] return a + b end, fun [a, b] return a * b end}
f = ops{0}
print f [3, 4] # → 7
Constants
Immutable global values. Reassignment raises a syntax error at parse time.
const MAX_HP = 100
const TEAM_NAME = "Red"
const HALF_HP = MAX_HP / 2 # runtime expressions work
# MAX_HP = 50 → SyntaxException: Cannot reassign constant
Enums
Named numeric constants grouped under a class instance. Access members with ::.
enum DamageType
PHYSICAL
MAGICAL
TRUE = 5
end
# Access values
DamageType :: PHYSICAL # → 0
DamageType :: TRUE # → 5
# Reverse lookup
DamageType :: name [DamageType :: PHYSICAL] # → "PHYSICAL"
# Iteration
loop v in DamageType :: values
print DamageType :: name [v]
end
DamageType :: values # → {0, 1, 5}
DamageType :: names # → {"PHYSICAL", "MAGICAL", "TRUE"}
DamageType :: count # → 3
Values auto-increment. Explicit values reset the counter:
enum Priority
LOW = 10 # 10
MEDIUM # 11
HIGH # 12
CRITICAL = 100 # 100
EMERGENCY # 101
end
Data Types
Numeric
number1 = 1
number2 = 3.21
number3 = .543
number4 = -1
Text
text = "hello world"
print text{1}
text{1} = "a"
String Interpolation
Embed expressions inside strings using {}. Any valid expression can appear inside the braces, including variables, arithmetic, function calls, and property access.
name = "Steve"
age = 25
print "Hello {name}, you are {age} years old"
# expressions inside braces
print "Next year: {age + 1}"
# class properties
class Entity [name, hp, max_hp]
end
e = new Entity ["Warrior", 75, 100]
print "{e :: name}: {e :: hp}/{e :: max_hp}"
# function calls
fun double [n]
return n * 2
end
print "Result: {double [5]}"
# array access
arr = {10, 20, 30}
print "Second element: {arr{1}}"
Logical
logical1 = true
logical2 = false
Class
class Lamp [ type, is_on ]
fun turn_on
is_on = true
end
fun turn_off
is_on = false
end
fun set_is_on [ is_on ]
this :: is_on = is_on
end
end
lamp = new Lamp [ "Halogen", false ]
# get/set properties
lamp_is_on = lamp :: is_on
lamp :: type = "Led"
# invoke functions
lamp :: turn_off []
# inheritance
class DerivedClass: BaseClass [ property ]
end
Arrays
items = { 1, 2, "three" }
# get/set by index
value = items{1}
items{1} = 123
# append
items << 3
Null
value = null
NativeObject<T>
fun on_unit_died[unit]
print Unit_get_position[unit]
end
Operators
Operators ordered by precedence (lowest to highest):
| Operator | Symbol | Precedence | Example |
|---|---|---|---|
| Assignment | = | 1 | a = 5 |
| Addition Assignment | += | 1 | a += 5 |
| Subtraction Assignment | -= | 1 | a -= 5 |
| Multiplication Assignment | *= | 1 | a *= 5 |
| Division Assignment | /= | 1 | a /= 5 |
| Append to array | << | 1 | array << "value" |
| Logical OR | or | 2 | true or false |
| Logical AND | and | 3 | true and true |
| Parentheses | ( ) | 4 | |
| Equals | == | 5 | a == 5 |
| Not Equals | != | 5 | a != 5 |
| Greater Than Or Equals | >= | 5 | a >= 5 |
| Greater Than | > | 5 | a > 5 |
| Less Than Or Equals | <= | 5 | a <= 5 |
| Less Than | < | 5 | a < 5 |
| Addition | + | 6 | a + 5 |
| Subtraction | - | 6 | a - 5 |
| Multiplication | * | 7 | a * 5 |
| Division | / | 7 | a / 5 |
| Modulo | % | 7 | a % 5 |
| NOT | ! | 8 | !false |
| Negate | - | 8 | y = -x |
| Class Instance | new | 8 | new Type [ value ] |
| Nested Instance | :: new | 8 | type :: new NestedType |
| Property Access | :: | 8 | type :: value |
| Cast | as | 8 | type as Supertype |
| Instance Of | is | 8 | type is Supertype |
Exponentiation, floor division, square root, and other math operations are available as native functions: pow[base, exp], sqrt[n], floor[n], ceil[n], round[n], abs[n], min[a, b], max[a, b], clamp[n, lo, hi], lerp[a, b, t].
Coroutines
Coroutines allow functions to pause execution and resume on a later tick. This is useful for sequences that span multiple frames: movement, timers, cutscenes, patrol paths, dialog trees.
yield — pause until next tick
fun flash [entity]
Entity_set_color [entity, "red"]
yield
Entity_set_color [entity, "white"]
yield
Entity_set_color [entity, "red"]
yield
Entity_set_color [entity, "white"]
end
start_coroutine ["flash", {my_entity}]
yield wait — pause for a duration (seconds)
fun spawn_wave []
spawn_enemies [5]
print "Wave 1 started"
yield wait 10
spawn_enemies [10]
print "Wave 2 started"
yield wait 15
spawn_enemies [20]
print "Final wave!"
end
start_coroutine ["spawn_wave", {}]
yield until — pause until a condition is true
fun wait_for_player [door]
print "Waiting for player..."
yield until player_near [door]
open_door [door]
print "Door opened"
end
start_coroutine ["wait_for_player", {my_door}]
Looping coroutines — restart from the beginning when complete
fun patrol [unit]
move_to [unit, waypoint_a]
yield until reached_target [unit]
yield wait 2
move_to [unit, waypoint_b]
yield until reached_target [unit]
yield wait 2
end
# Patrols forever until stopped
id = start_coroutine_loop ["patrol", {guard}]
# Stop when needed
stop_coroutine [id]
Variables are preserved across yields — local state survives suspension:
fun countdown [n]
loop i in 0..n
print "{n - i}..."
yield wait 1
end
print "Go!"
end
start_coroutine ["countdown", {5}]
Engine integration: the engine calls TickCoroutines[dt] each frame to advance all active coroutines. Coroutines are fully deterministic — same inputs produce the same execution order on every client, making them safe for lockstep multiplayer.
Note: yield must appear at the top level of the function body. It cannot be nested inside if, loop, or begin blocks. Use start_coroutine_loop for repeating behavior.
engine Library
Engine configuration. Set tick rate, max players, and other server/multiplayer settings.
NumericValue
Returns the current additional input delay.
No parameters
NumericValue
Returns the current map reset timer in seconds.
No parameters
NumericValue
Returns the maximum number of players per lobby.
No parameters
NumericValue
Returns the current maximum tick time in seconds.
No parameters
NumericValue
Returns the current required buffered tick count.
No parameters
NumericValue
Returns the current simulation tick rate.
No parameters
Sets extra input delay ticks for multiplayer. Default: 2.
| Parameter | Type |
|---|---|
value | Numeric |
Sets how long (seconds) before an empty map resets. Default: 300.
| Parameter | Type |
|---|---|
value | Numeric |
Sets the maximum number of players per lobby (1–255). Default: 8.
| Parameter | Type |
|---|---|
value | Numeric |
Sets the maximum time (seconds) allowed per tick before skipping. Default: 0.1.
| Parameter | Type |
|---|---|
value | Numeric |
Sets the minimum buffered ticks required before simulation advances. Default: 1.
| Parameter | Type |
|---|---|
value | Numeric |
Sets the simulation tick rate (ticks per second). Default: 30.
| Parameter | Type |
|---|---|
value | Numeric |
game_result Library
Game result (victory/defeat). Stops simulation and shows result screen.
Triggers a defeat. Stops the simulation and shows a result screen. Args: title, body.
| Parameter | Type |
|---|---|
title | Text |
body | Text |
Triggers a victory. Stops the simulation and shows a result screen. Args: title, body.
| Parameter | Type |
|---|---|
title | Text |
body | Text |
doodad Library
Doodad definition. Define doodads in .ws instead of binary .wdoodad.
Begins a doodad with prefab config. Args: doodad id, prefab name.
| Parameter | Type |
|---|---|
doodadId | Text |
prefab | Text |
Sets a bool property on prefab config. Args: property name, value.
| Parameter | Type |
|---|---|
property | Text |
value | Logical |
Sets a float property on prefab config. Args: property name, value.
| Parameter | Type |
|---|---|
property | Text |
value | Numeric |
Sets an int property on prefab config. Args: property name, value.
| Parameter | Type |
|---|---|
property | Text |
value | Numeric |
Sets a string property on prefab config. Args: property name, value.
| Parameter | Type |
|---|---|
property | Text |
value | Text |
Defines a doodad. Args: doodad id, prefab name.
| Parameter | Type |
|---|---|
doodadId | Text |
prefab | Text |
Finalizes the current doodad with config and registers it.
No parameters
quest Library
Quest definition. Define quests in .ws instead of binary .wquest.
Defines a quest. Args: id, name translation key, description translation key, group translation key.
| Parameter | Type |
|---|---|
questId | Text |
nameTKey | Text |
descTKey | Text |
groupTKey | Text |
room_editor Library
Programmatic room creation and terrain editing.
Sets the room's biome.
| Parameter | Type |
|---|---|
biomeName | Text |
Removes all doodads from the room.
No parameters
Removes all instances of a doodad type.
| Parameter | Type |
|---|---|
doodadId | Text |
NumericValue
Removes doodads in a world-space rectangle. Args: x1, z1, x2, z2.
| Parameter | Type |
|---|---|
x1 | Numeric |
z1 | Numeric |
x2 | Numeric |
z2 | Numeric |
NumericValue
Returns doodad instance count. Pass "" for total count.
| Parameter | Type |
|---|---|
doodadId | Text |
NumericValue
Returns the room depth in cells.
No parameters
NumericValue
Returns terrain height at (x, y).
| Parameter | Type |
|---|---|
x | Numeric |
y | Numeric |
NumericValue
Returns texture layer at (x, y).
| Parameter | Type |
|---|---|
x | Numeric |
y | Numeric |
NumericValue
Returns water height at (x, y). 0 = no water.
| Parameter | Type |
|---|---|
x | Numeric |
y | Numeric |
NumericValue
Returns the room width in cells.
No parameters
Resets the room to a blank canvas. Args: name, width, height.
| Parameter | Type |
|---|---|
name | Text |
width | Numeric |
height | Numeric |
Applies Perlin noise to terrain. Args: seed, scale, amplitude, base_height.
| Parameter | Type |
|---|---|
seed | Numeric |
scale | Numeric |
amplitude | Numeric |
baseHeight | Numeric |
Paints a texture layer in a rectangle. Args: x, y, width, height, layer_index.
| Parameter | Type |
|---|---|
x | Numeric |
y | Numeric |
width | Numeric |
height | Numeric |
layerIndex | Numeric |
Paints the entire room with a texture layer.
| Parameter | Type |
|---|---|
layerIndex | Numeric |
Places a doodad at world position. Args: doodad_id, x, y_up, z, rotation_degrees, scale.
| Parameter | Type |
|---|---|
doodadId | Text |
x | Numeric |
y | Numeric |
z | Numeric |
rotation | Numeric |
scale | Numeric |
Places a doodad at terrain height. Args: doodad_id, grid_x, grid_y, rotation, scale.
| Parameter | Type |
|---|---|
doodadId | Text |
gridX | Numeric |
gridY | Numeric |
rotation | Numeric |
scale | Numeric |
Sets or removes ramps in a rectangle. Args: x, y, width, height, enabled.
| Parameter | Type |
|---|---|
x | Numeric |
y | Numeric |
width | Numeric |
height | Numeric |
enabled | Logical |
Removes water in a rectangle. Args: x, y, width, height.
| Parameter | Type |
|---|---|
x | Numeric |
y | Numeric |
width | Numeric |
height | Numeric |
Resizes the room. Preserves existing terrain.
| Parameter | Type |
|---|---|
width | Numeric |
height | Numeric |
LogicalValue
Saves the current room to the ContentResolver.
No parameters
NumericValue
Randomly scatters doodads. Args: id, count, minGX, minGY, maxGX, maxGY, minScale, maxScale.
| Parameter | Type |
|---|---|
doodadId | Text |
count | Numeric |
minX | Numeric |
minY | Numeric |
maxX | Numeric |
maxY | Numeric |
minScale | Numeric |
maxScale | Numeric |
NumericValue
Deterministic scatter. Args: id, count, seed, minGX, minGY, maxGX, maxGY, minScale, maxScale.
| Parameter | Type |
|---|---|
doodadId | Text |
count | Numeric |
seed | Numeric |
minX | Numeric |
minY | Numeric |
maxX | Numeric |
maxY | Numeric |
minScale | Numeric |
maxScale | Numeric |
Low-level: sets detail variant at a point.
| Parameter | Type |
|---|---|
x | Numeric |
y | Numeric |
detailType | Numeric |
Low-level: sets raw terrain height at a point. Prefer editor_terrain[].
| Parameter | Type |
|---|---|
x | Numeric |
y | Numeric |
height | Numeric |
Low-level: sets ramp flag at a point. Prefer editor_ramp[].
| Parameter | Type |
|---|---|
x | Numeric |
y | Numeric |
hasRamp | Logical |
Low-level: sets raw texture layer at a point. Prefer editor_paint[].
| Parameter | Type |
|---|---|
x | Numeric |
y | Numeric |
layerIndex | Numeric |
Low-level: sets raw water height at a point. Prefer editor_water[].
| Parameter | Type |
|---|---|
x | Numeric |
y | Numeric |
height | Numeric |
Adds a height offset to all terrain. Can be negative.
| Parameter | Type |
|---|---|
change | Numeric |
Smooths terrain around (cx, cy) with radius and strength (0-1).
| Parameter | Type |
|---|---|
cx | Numeric |
cy | Numeric |
radius | Numeric |
strength | Numeric |
Sets terrain height in a rectangle using the cliff system. Args: x, y, width, height, terrain_height.
| Parameter | Type |
|---|---|
x | Numeric |
y | Numeric |
width | Numeric |
height | Numeric |
terrainHeight | Numeric |
Sets the entire room to a terrain height.
| Parameter | Type |
|---|---|
terrainHeight | Numeric |
Creates water in a rectangle. Args: x, y, width, height, terrain_height, water_height.
| Parameter | Type |
|---|---|
x | Numeric |
y | Numeric |
width | Numeric |
height | Numeric |
terrainHeight | Numeric |
waterHeight | Numeric |
room Library
Room metadata. Attach scripts, override biome, configure room properties.
Overrides the room's biome. Must match a BiomeData name.
| Parameter | Type |
|---|---|
biomeName | Text |
Begins room metadata definition. The room name must match a .wroom file.
| Parameter | Type |
|---|---|
roomId | Text |
Finalizes room metadata and applies it to the room.
No parameters
Sets the rooms music.
| Parameter | Type |
|---|---|
clipName | Text |
Attaches a .ws script to the room. Runs when the room loads.
| Parameter | Type |
|---|---|
scriptPath | Text |
sound Library
Declare sound assets for use in the game. All definitions run at bootstrap before any sound is played.
Declare a sound asset. type: effect | music | ui | local_ambience | global_ambience
| Parameter | Type |
|---|---|
name | Text |
type | Text |
clips | any |
background | Logical |
volume_change | Numeric |
pitch_change | Numeric |
load_async | Logical |
override_mixer | Text |
save Library
Key-value save store for mod persistence. All data is scoped to the active mod.
Remove all keys from the current save.
No parameters
TextValue
Get the name of the currently loaded slot.
No parameters
LogicalValue
Delete a save slot from disk.
| Parameter | Type |
|---|---|
slotName | Text |
WarValue
Read any value by key. Returns null if key is missing.
| Parameter | Type |
|---|---|
key | Text |
LogicalValue
Read a boolean value. Returns default if key is missing.
| Parameter | Type |
|---|---|
key | Text |
defaultValue | Logical |
NumericValue
Read a float value. Returns default if key is missing.
| Parameter | Type |
|---|---|
key | Text |
defaultValue | Numeric |
NumericValue
Read an integer value. Returns default if key is missing.
| Parameter | Type |
|---|---|
key | Text |
defaultValue | Numeric |
TextValue
Read a string value. Returns default if key is missing.
| Parameter | Type |
|---|---|
key | Text |
defaultValue | Text |
ArrayValue
Read an array/table value. Returns empty array if key is missing.
| Parameter | Type |
|---|---|
key | Text |
LogicalValue
Check if a key exists in the current save.
| Parameter | Type |
|---|---|
key | Text |
ArrayValue
List all save slot names for the active mod.
No parameters
LogicalValue
Load a save slot from disk into memory. Returns true if the slot was found.
| Parameter | Type |
|---|---|
slotName | Text |
Create a new empty save slot and set it as current.
| Parameter | Type |
|---|---|
slotName | Text |
Remove a key from the current save.
| Parameter | Type |
|---|---|
key | Text |
Store any WarScript value by key.
| Parameter | Type |
|---|---|
key | Text |
value | any |
Store a boolean value.
| Parameter | Type |
|---|---|
key | Text |
value | Logical |
Store a float value.
| Parameter | Type |
|---|---|
key | Text |
value | Numeric |
Store an integer value.
| Parameter | Type |
|---|---|
key | Text |
value | Numeric |
Store a string value.
| Parameter | Type |
|---|---|
key | Text |
value | Text |
Store an array/table value. Supports nested arrays.
| Parameter | Type |
|---|---|
key | Text |
value | any |
LogicalValue
Check if a save slot exists on disk.
| Parameter | Type |
|---|---|
slotName | Text |
LogicalValue
Write the current save data to disk. Requires a slot to be loaded or created.
No parameters
timer Library
Deterministic timers that fire WarScript callbacks. Ticked inside the lockstep simulation.
NumericValue
Create a timer. Calls the named function when it fires. Returns a timer ID.
| Parameter | Type |
|---|---|
interval | Numeric |
repeating | Logical |
callbackName | Text |
LogicalValue
Destroy a timer by ID. Safe to call from inside a timer callback.
| Parameter | Type |
|---|---|
id | Numeric |
Destroy all active timers.
No parameters
LogicalValue
Check if a timer exists and hasn't been destroyed.
| Parameter | Type |
|---|---|
id | Numeric |
LogicalValue
Pause a timer. It stops counting down but isn't destroyed.
| Parameter | Type |
|---|---|
id | Numeric |
NumericValue
Get the remaining seconds on a timer. Returns -1 if not found.
| Parameter | Type |
|---|---|
id | Numeric |
LogicalValue
Resume a paused timer.
| Parameter | Type |
|---|---|
id | Numeric |
translation Library
Translation and localization. Define translations in .ws instead of binary .wtext.
Adds a translation entry (key → text) to the active translation. Call translation_create[] first.
| Parameter | Type |
|---|---|
key | Text |
value | Text |
Creates a new translation with the given language name. All subsequent t[] calls add entries to this translation.
| Parameter | Type |
|---|---|
name | Text |
Adds a translation entry (key → text) to the active translation. Verbose alias for t[].
| Parameter | Type |
|---|---|
key | Text |
value | Text |
map Library
Map definition. Define maps in .ws instead of binary .wmap.
Begins a map definition. Args: map id (used for lookup), display name translation key.
| Parameter | Type |
|---|---|
mapId | Text |
mapNameTKey | Text |
Adds a modifier applied once on map load.
| Parameter | Type |
|---|---|
modifierName | Text |
Finalizes the current map and registers it. Must be called after map_begin[].
No parameters
Adds an enemy to the map's spawn table. Args: enemy preset name, weight.
| Parameter | Type |
|---|---|
enemyPresetName | Text |
weight | Numeric |
Adds a periodic global modifier by name.
| Parameter | Type |
|---|---|
modifierName | Text |
Sets the global modifier tick interval in seconds (default: 1).
| Parameter | Type |
|---|---|
interval | Numeric |
Marks the current map as having elite enemies.
No parameters
Adds a room to the current map by name. Order determines layout.
| Parameter | Type |
|---|---|
roomName | Text |
bot Library
Bot AI definition. Create selectors, conditions, actions, and gambit brains.
WarValue
Issue a basic attack against the target.
| Parameter | Type |
|---|---|
target | any |
WarValue
Use a skill slot. 0 = special/potion, 1-4 = skills.
| Parameter | Type |
|---|---|
slot | Numeric |
target | any |
WarValue
Move away from the target until distance is reached.
| Parameter | Type |
|---|---|
from | any |
distance | Numeric |
WarValue
Follow the target, stopping within stop_distance.
| Parameter | Type |
|---|---|
target | any |
stop_distance | Numeric |
recompute_threshold | Numeric |
WarValue
Pathfind toward the target.
| Parameter | Type |
|---|---|
target | any |
recompute_threshold | Numeric |
WarValue
Idle wander: mostly pause, occasionally walk to a nearby point.
| Parameter | Type |
|---|---|
radius | Numeric |
min_pause_ticks | Numeric |
max_pause_ticks | Numeric |
Add a gambit group to the brain.
| Parameter | Type |
|---|---|
brain | any |
name | Text |
trigger | any |
gambits | Array |
min_hold_ticks | Numeric |
WarValue
Always returns true.
No parameters
WarValue
True when both conditions pass.
| Parameter | Type |
|---|---|
a | any |
b | any |
WarValue
True when the target enemy exists and is within range.
| Parameter | Type |
|---|---|
target | any |
range | Numeric |
WarValue
True when any enemy is within range of the resolved entity (not self).
| Parameter | Type |
|---|---|
entity | any |
range | Numeric |
WarValue
True when the bot has a leader assigned.
No parameters
WarValue
True when the target's health is below the threshold (0-1).
| Parameter | Type |
|---|---|
target | any |
threshold | Numeric |
WarValue
Inverts another condition.
| Parameter | Type |
|---|---|
condition | any |
WarValue
True when either condition passes.
| Parameter | Type |
|---|---|
a | any |
b | any |
WarValue
True with the given probability (0-1) each tick.
| Parameter | Type |
|---|---|
probability | Numeric |
WarValue
True when any target exists, is alive, and is within range.
| Parameter | Type |
|---|---|
target | any |
range | Numeric |
WarValue
Create a gambit (condition + action pair).
| Parameter | Type |
|---|---|
condition | any |
action | any |
cooldown_ticks | Numeric |
interrupts_lock | Logical |
WarValue
Create a new gambit brain builder.
No parameters
WarValue
Select a specific entity by instance ID.
| Parameter | Type |
|---|---|
entity_id | Numeric |
WarValue
Select the current leader. Returns null if no leader is set.
No parameters
WarValue
Select the allied entity with lowest health.
No parameters
WarValue
Select the nearest enemy within range.
| Parameter | Type |
|---|---|
range | Numeric |
WarValue
Select the bot entity itself.
No parameters
Finalize and set the bot's gambit brain.
| Parameter | Type |
|---|---|
brain | any |
companion_config Library
Configure AI companion slots. Called during bootstrap to override inspector defaults.
Add a companion slot. scriptPath is the .ws file for this bot. subCompanionCount is how many sub-bots it spawns. subScript is the .ws for sub-bots (empty string for none).
| Parameter | Type |
|---|---|
scriptPath | Text |
subCompanionCount | Numeric |
subScript | Text |
Remove all companion slots. Call before adding new ones.
No parameters
NumericValue
Get number of configured companion slots.
No parameters
Events
Callback functions called by the engine when implemented in your script.