How do I create a new structure in Screeps

7.2k views Asked by At

So, this is a question about the game screeps. I know that in the simulation, I can create a road by going to the Construct menu on the left, but is there an API reference I can use to create one programmatically? My goal is to have a script that will automatically lay down construction sites between target A and target B. Has anyone found such a reference in the docs?

(I would tag this question with the screeps tag, but it appears I cannot do so with my current reputation. If this is the wrong place to post, please direct me to the right place, I just came here from the screeps website)

2

There are 2 answers

1
artch On BEST ANSWER

UPDATED: A method Room.createConstructionSite has been added to the API today (changelog). Sample usage:

Game.rooms[roomName].createConstructionSite(10, 15, STRUCTURE_ROAD);

OLD POST: A developer of Screeps is here. Indeed, there is no such API yet, but we plan to add it very soon. I will by update my answer when it is done.

0
Lucas Azevedo On

I've checked the Screeps API (http://screeps.com/docs/index.php) and I don't think it's possible to create structures programmatically.