Screeps - Where to find Game Object constants?

Where can I find a list of constants for a Game object, for example Game.HOSTILE_CREEPS , Game.MOVE and Game.ATTACK ?

I can not find it at http://screeps.com/docs/

+5
source share
3 answers

They can be found in the game documents (bottom of the page)

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

Constants Room.find ()

  • 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

Routes

  • 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 "hard"
  • Game.HEAL "heal"

Structure types

  • Game.STRUCTURE_EXTENSION "extension"
  • Game.STRUCTURE_RAMPART Walpa
  • Game.STRUCTURE_ROAD Road
  • Game.STRUCTURE_SPAWN "spawn"
  • Game.STRUCTURE_WALL "builtWall"

Colors

  • Game.COLOR_RED Red
  • Game.COLOR_PURPLE "Purple"
  • Game.COLOR_BLUE "blue"
  • Game.COLOR_CYAN "blue"
  • Game.COLOR_GREEN Green
  • Game.COLOR_YELLOW "yellow"
  • Game.COLOR_ORANGE "orange"
  • Game.COLOR_BROWN Brown
  • Game.COLOR_GREY "gray"
  • Game.COLOR_WHITE "white"

Room modes

  • Game.MODE_SIMULATION "simulation"
  • Game.MODE_SURVIVAL Survival
  • Game.MODE_WORLD "world"
+5
source

Depending on what you are looking for:

  • This is a list of constants used to find things, expand find(type, [opts]) (ex: Game.HOSTILE_CREEPS )
  • This is a list for game constants, expand createCreep(body, [name], [memory]) (for example: Game.ATTACK )
  • This is a list of parameter parameters for some functions, expand findPath(fromPos, toPos, [opts]) (ex: ignoreCreeps: boolean )

This is what I could find, hope it helps! Documentation that is hard to sort!

+3
source

They are not tied together in documents. They are described in the methods that use them.

The ones you requested are located at:

http://screeps.com/docs/Room.php#find

http://screeps.com/docs/Spawn.php#createCreep

0
source

Source: https://habr.com/ru/post/1207380/


All Articles