

Again with the jobs system, this was pretty easy. To get back to full functionality I need to add some flags for harvesting other rooms. If I want it to break from its norm and do another job I drop a flag of a certain colour and the AI handles it. When it did reach RC3 both of my source containers died before the tower got built which threw a huge spanner in the works and added a few hours to wait for that room to be self-sufficient. The sources are so far apart that it takes a lot longer to get energy where it’s needed. Of the 2 rooms, I claimed 1 has gone really well, getting to RC3 before anything died and building up very nicely. Once you hit RC3 in a room you can drop a tower which can heal everything very quickly, my AI relies on towers to heal. I had quite a few issues with me not having healer creeps. Adding extractors back in took a small amount of work (see commit).

The new AI makes adding new jobs a lot easier. To get this working I get my creeps to move to the flags RoomPosition and then claim the rooms controller once they are nearTo the RoomPosition. I need to move to the target room and then aim for the controller.

Game.rooms only contains rooms you control or have creeps in so I can’t just get the controller of the room the flag is in. It took a bit of work getting the room claiming system to work.

It wasn’t important at the time, my rooms were all dead and I only needed it to gather energy and build new creeps. The new AI from part 12 was not as complete when it was called into service. This is part 13 of my Screeps story, you can read the whole story here. 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.2017 Screeps Screeps Part 13 – Building Up 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.
