Where are docs about Game Constants?

432 Views Asked by At

In the tutorial I'm seeing: Game.HOSTILE_CREEPS

var targets = creep.room.find(Game.HOSTILE_CREEPS);

No where in the docs do I see anything that tells me this is possible. Where would I find out more about these constants?

3

There are 3 best solutions below

0
On BEST ANSWER

The documents got updated, check below Game.php#notify in the docs. As of posting these are the constants:

Result codes

Game.OK 0
Game.ERR_NOT_OWNER  -1
Game.ERR_NO_PATH    -2
Game.ERR_NAME_EXISTS    -3
Game.ERR_BUSY   -4
Game.ERR_NOT_FOUND  -5
Game.ERR_NOT_ENOUGH_ENERGY  -6
Game.ERR_INVALID_TARGET -7
Game.ERR_FULL   -8
Game.ERR_NOT_IN_RANGE   -9
Game.ERR_INVALID_ARGS   -10
Game.ERR_TIRED  -11
Game.ERR_NO_BODYPART    -12
Game.ERR_NOT_ENOUGH_EXTENSIONS  -13

Room.find() constants

Game.CREEPS 1
Game.MY_CREEPS  2
Game.HOSTILE_CREEPS 3
Game.SOURCES_ACTIVE 4
Game.SOURCES    5
Game.DROPPED_ENERGY 6
Game.STRUCTURES 7
Game.MY_STRUCTURES  8
Game.HOSTILE_STRUCTURES 9
Game.FLAGS  10
Game.CONSTRUCTION_SITES 11
Game.MY_SPAWNS  12
Game.HOSTILE_SPAWNS 13
Game.EXIT_TOP   14
Game.EXIT_RIGHT 15
Game.EXIT_BOTTOM    16
Game.EXIT_LEFT  17

Direction constants

Game.TOP    1
Game.TOP_RIGHT  2
Game.RIGHT  3
Game.BOTTOM_RIGHT   4
Game.BOTTOM 5
Game.BOTTOM_LEFT    6
Game.LEFT   7
Game.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"
0
On

If you look at the docs: http://screeps.com/docs/Room.php#find

You'll see a little button with three dots in it, click it and it will show the list of constants. A lot of the functions have this additional info.

1
On

Try the doc for the find(...) function on the page for room

I would say those are pretty self explanatory