Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Screeps - Where to find constants of Game Object?

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.com/docs/

like image 382
Lapu Avatar asked Nov 21 '14 08:11

Lapu


Video Answer


1 Answers

They can be found at the game docs (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

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

Directions

  • 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"

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"
like image 122
Anima-t3d Avatar answered Sep 20 '22 00:09

Anima-t3d