The initialize function initializes the WASM module and applies global
setup options. Call it in your main loop before using any other
screeps-clockwork functions. Depending on available CPU, it may not load the
WASM module completely in the first tick, but it will pick back up where it
left off if the script times out.
It is safe to call this function repeatedly, but setup options such as
portals and portal cache sizing are applied only once, after WASM
initialization has completed. Use setPortals when you intentionally need
to reconfigure portals later.
The
initializefunction initializes the WASM module and applies global setup options. Call it in your main loop before using any other screeps-clockwork functions. Depending on available CPU, it may not load the WASM module completely in the first tick, but it will pick back up where it left off if the script times out.It is safe to call this function repeatedly, but setup options such as portals and portal cache sizing are applied only once, after WASM initialization has completed. Use
setPortalswhen you intentionally need to reconfigure portals later.