A flag. Flags can be used to mark particular spots in a room. Flags are visible to their owners only. You cannot have more than 10,000 flags.
Applied effects, an array of objects with the following properties:
parameter | type | description |
---|---|---|
effect
|
number |
Effect ID of the applied effect. Can be either natural effect ID or Power ID. |
level
optional |
number |
Power level of the applied effect. Absent if the effect is not a Power effect. |
ticksRemaining
|
number |
How many ticks will the effect last. |
An object representing the position of this object in the room.
The link to the Room object. May be undefined in case if an object is a flag or a construction site and is placed in a room that is not visible to you.
Flag primary color. One of the
COLOR_*
constants.
A shorthand to
Memory.flags[flag.name]
. You can use it for quick access the flag's specific memory data object.
Flag’s name. You can choose the name while creating a new flag, and it cannot be changed later. This name is a hash key to access the flag via the Game.flags object. The maximum name length is 60 charactes.
Flag secondary color. One of the
COLOR_*
constants.
Remove the flag.
Always returns OK .
Game.flags.Flag1.setColor(COLOR_GREEN, COLOR_WHITE);
Set new color of the flag.
parameter | type | description |
---|---|---|
color
|
string |
Primary color of the flag. One of the
|
secondaryColor
optional |
string |
Secondary color of the flag. One of the
|
One of the following codes:
constant | value | description |
---|---|---|
OK
|
0 |
The operation has been scheduled successfully. |
ERR_INVALID_ARGS
|
-10 |
|
Game.flags.Flag1.setPosition(10,20);
Game.flags.Flag1.setPosition( new RoomPosition(10, 20, 'W3S5') );
Set new position of the flag.
parameter | type | description |
---|---|---|
x
|
number |
The X position in the room. |
y
|
number |
The Y position in the room. |
pos
|
object |
Can be a RoomPosition object or any object containing RoomPosition . |
One of the following codes:
constant | value | description |
---|---|---|
OK
|
0 |
The operation has been scheduled successfully. |
ERR_INVALID_TARGET
|
-7 |
The target provided is invalid. |