Where can I find a list of the constants for the Game
object like Game.HOSTILE_CREEPS
, Game.MOVE
and Game.ATTACK
?
I cannot find it on /
Where can I find a list of the constants for the Game
object like Game.HOSTILE_CREEPS
, Game.MOVE
and Game.ATTACK
?
I cannot find it on http://screeps./docs/
Share Improve this question edited Nov 21, 2014 at 14:34 zisoft 23.1k10 gold badges64 silver badges74 bronze badges asked Nov 21, 2014 at 8:47 LapuLapu 771 silver badge3 bronze badges3 Answers
Reset to default 5They can be found at the game docs (bottom of the page)
Constants
Result Codes
Game.OK
0Game.ERR_NOT_OWNER
-1Game.ERR_NO_PATH
-2Game.ERR_NAME_EXISTS
-3Game.ERR_BUSY
-4Game.ERR_NOT_FOUND
-5Game.ERR_NOT_ENOUGH_ENERGY
-6Game.ERR_INVALID_TARGET
-7Game.ERR_FULL
-8Game.ERR_NOT_IN_RANGE
-9Game.ERR_INVALID_ARGS
-10Game.ERR_TIRED
-11Game.ERR_NO_BODYPART
-12Game.ERR_NOT_ENOUGH_EXTENSIONS
-13
Room.find() constants
Game.CREEPS
1Game.MY_CREEPS
2Game.HOSTILE_CREEPS
3Game.SOURCES_ACTIVE
4Game.SOURCES
5Game.DROPPED_ENERGY
6Game.STRUCTURES
7Game.MY_STRUCTURES
8Game.HOSTILE_STRUCTURES
9Game.FLAGS
10Game.CONSTRUCTION_SITES
11Game.MY_SPAWNS
12Game.HOSTILE_SPAWNS
13Game.EXIT_TOP
14Game.EXIT_RIGHT
15Game.EXIT_BOTTOM
16Game.EXIT_LEFT
17
Directions
Game.TOP
1Game.TOP_RIGHT
2Game.RIGHT
3Game.BOTTOM_RIGHT
4Game.BOTTOM
5Game.BOTTOM_LEFT
6Game.LEFT
7Game.TOP_LEFT
8
Body Parts
Game.MOVE
"move"Game.WORK
"work"Game.CARRY
"carry"Game.ATTACK
"attack"Game.RANGED_ATTACK
"ranged_attack"Game.TOUGH
"tough"Game.HEAL
"heal"
Structure Types
Game.STRUCTURE_EXTENSION
"extension"Game.STRUCTURE_RAMPART
"rampart"Game.STRUCTURE_ROAD
"road"Game.STRUCTURE_SPAWN
"spawn"Game.STRUCTURE_WALL
"constructedWall"
Colors
Game.COLOR_RED
"red"Game.COLOR_PURPLE
"purple"Game.COLOR_BLUE
"blue"Game.COLOR_CYAN
"cyan"Game.COLOR_GREEN
"green"Game.COLOR_YELLOW
"yellow"Game.COLOR_ORANGE
"orange"Game.COLOR_BROWN
"brown"Game.COLOR_GREY
"grey"Game.COLOR_WHITE
"white"
Room Modes
Game.MODE_SIMULATION
"simulation"Game.MODE_SURVIVAL
"survival"Game.MODE_WORLD
"world"
Depends on what you're looking for:
- This is the list of constants used for finding stuff, expand
find(type, [opts])
(ex:Game.HOSTILE_CREEPS
) - This is the list for game constants, expand
createCreep(body, [name], [memory])
(ex:Game.ATTACK
) - This is a list of option parameters for some functions, expand
findPath(fromPos, toPos, [opts])
(ex:ignoreCreeps: boolean
)
This is what I was able to find, hope it helps! The documentation kinda hard to sort through!
They are not bundled together in the docs. They are described under the methods that use them.
The ones you asked for are at:
http://screeps./docs/Room.php#find
http://screeps./docs/Spawn.php#createCreep