![screeps flags screeps flags](https://images.sftcdn.net/images/t_app-cover-l,f_auto/p/69bbef0d-e40e-4716-b701-5e7b21ef0b67/2016499641/screeps-screenshot.jpg)
When flags were moved from being objects to serialized assets (some time ago.) they no longer forced the server to simulate that room. The server doesn't simulate rooms with no active objects. However, you can create flags in a room you have vision and then move them to a new position where you lack vision, although this works very inconsistently as has mentioned.
#Screeps flags code
If there is some compelling technical reason this can't be done, add ERR_NO_VISION as a return code option
![screeps flags screeps flags](https://static.wikia.nocookie.net/screeps/images/5/53/S05.gif)
Room positions can be defined without vision of the room they are in, so you would expect that this would be a valid way to place a flag, especially since there is no return code on createFlag such as ERR_NO_VISION. This would be understandable if the only way to create a flag was room.createFlag(pos), since the room object needs to be defined to call createFlag, but you can also call new RoomPosition(x,y,roomName).createFlag().
![screeps flags screeps flags](https://clips-media-assets2.twitch.tv/vod-172447449-offset-19768-preview-480x272.jpg)
![screeps flags screeps flags](https://www.moregameslike.com/wp-content/previews/screeps-61101-1.jpg)
You cannot create flags in rooms you don't have vision in. Here are my biggest issues I have with how flags are handled. They're very versatile, but usage completely depends on your own implementation! There's no real right or wrong, though certain things make more sense than others.Programmatically creating flags is, to me, one of the most inconsistent and frustrating experiences in the game, and I think it should be a high priority issue to work on. The flag can have memory storing a threat level, if remote mining should be active or suspended, and possibly store paths from the associated spawn to the sources. Some other people use them to manage remote harvesting. The flag memory can then contain blueprintType: "extensions" or blueprintType: "bunker". For example people use them to place a "blueprint" of buildings in a room. If you store something in your flag memory, you'll be able to access it.įlags don't have any purpose other than what you decide to use them for. 1 exists because you created the flag, but the pos attribute you're trying to access doesn't exist unless you save it (which isn't useful, because you can always access a flag's pos regardless of vision). Unless you explicitly saved something in memory, of course it's empty Creeps are the exception to this (with the _move attribute), but all other default memory types are empty unless explicitly changed.