Skip to content

five-on-it / packages/ai/src/system / spawnSentry

Function: spawnSentry() ​

spawnSentry(ai, spec, schedule?): number

Defined in: packages/ai/src/system.ts:500

Spawns a sentry (sentry.ts): a character nobody owns, standing at its home with the sentry's profile (its weapon, or none), whose body stays where it falls once dead; a guard is drawn as an enemy. With a schedule, its hours change its rounds and send it home and back out (schedule.ts). Returns its entity id; the caller fills its pockets.

Parameters ​

ai ​

AiWorld

spec ​

SentrySpec

schedule? ​

readonly ScheduleEntry[]

Returns ​

number