Skip to content

Spawn Process

Nhan Ho edited this page Oct 17, 2016 · 1 revision

Source src/components/processes/room/spawn.ts

A SpawnProcess for a room can be retrieved with getSpawnProcess(roomName) in src/components/kernel/kernel-utils.ts

Requesting a creep: spawnProcess.spawn(creepID, { CARRY: 1, WORK: 2 , MOVE: 3 }, myPid, priority). priority is optional and defaults to 10. Every room maintain a spawn queue of requested creep. The queue is a priority queue.

When a creep is ready (the spawn is spawning it), SpawnProcess will make a call .receiveCreep(creepID, creep) to the process that requested the creep, make sure you also implement receiveCreep for any process that needs creep. CreepID can be used to distinguish between different type of creeps a process might need, it is NOT used for creep name.

Clone this wiki locally