Screeps Wiki
Advertisement
Flag.png

An entity which can be set as a target for creeps.

Flags have many purposes in game. Because they are considered a player-owned object and their location is stored in memory, players often use them to mark sources for remote mining to allow creeps to navigate outside the room when using Game.getObjectById() would return NULL because the player does not have vision.

They are easily placed (as opposed to modifying memory, for example) and provide visual cues, and as a result they are also often used to guide military forces "by hand". Some players base entire systems off this, where flags are created, have AI, can queue creeps, create construction sites, etc. Color coding allows both excellent visual feedback and a script method to determine the purpose of the flag.

Flags do not have a limit, cannot be seen by other players, and their locations do not take CPU to parse, leading some players to use them to mark future construction sites for structures like roads.

Api[]

Methods[]

  • remove()
  • setColor(color)
  • setPosition(x, y)
  • setPosition(pos)

Properties[]

  • memory
  • name
  • roomName (deprecated, please use pos.roomName)
  • room
  • pos
  • color
  • secondaryColor

Prototype Chain[]

  • RoomObject

References[]

Advertisement