Constants
Last updated
Was this helpful?
Last updated
Was this helpful?
Screeps provides a number of that hold references to everything from error codes to in-game resources. The constants themselves either store some kind of value (like a string or integer) or are a reference to data structures like arrays and objects. Some constants are provided for conveince while others are required for some API calls.
Unlike optional named arguments, constants should be provided as is; constants are always uppercase with individual words seperated by underscores.
Defining a creep's part list:
Referencing a resource and checking for an error code: