Miniboatlanternbrain
Based on game build 714014 | Last updated: 2026-03-07
Overview
MiniBoatLanternBrain is a behavior tree-based AI controller for a small entity (e.g., the Boat Lantern) that patrols ocean terrain. It uses a Wander behavior when the entity is positioned on ocean water, has a non-empty fueled component, and is not grounded. It records the starting position as "home" upon initialization for use as a wander reference point.
Usage example
local inst = CreateEntity()
inst:AddComponent("fueled")
inst:AddComponent("knownlocations")
inst:AddBrain("miniboatlanternbrain")
-- The brain automatically records "home" on initialization and begins wandering when conditions are met.
Dependencies & tags
Components used: fueled, knownlocations
Tags: None identified.
Properties
No public properties.
Main functions
OnStart()
- Description: Initializes and assigns the behavior tree. Sets up a priority root node that executes a
Wanderbehavior only whenShouldMove()returnstrue— i.e., the entity is on ocean terrain, has afueledcomponent, and the fuel is not empty. - Parameters: None.
- Returns: Nothing.
- Error states: The
Wanderbehavior uses"home"location viaknownlocations:GetLocation("home"), which must have been previously set.
OnInitializationComplete()
- Description: Records the entity’s current world position as
"home"in theknownlocationscomponent. Prevents overwriting if"home"already exists. - Parameters: None.
- Returns: Nothing.
Events & listeners
Not applicable.