Skip to content

five-on-it / packages/ai/src/roles / spawnRoleNpc

Function: spawnRoleNpc() ​

spawnRoleNpc(ai, spec, enrol): number

Defined in: packages/ai/src/roles.ts:197

Spawns a role NPC: a character nobody owns (not hostile, its body staying where it falls once dead), a driver at the wheel of a car of its class spawned with it; returns the character. enrol puts the NPC in the AI's list (system.ts' addNpc).

Parameters ​

ai ​

AiWorld

spec ​

RoleSpec

enrol ​

(eid, ownCar) => NpcState

Returns ​

number