Gareth Parker
Gareth Parker

Reputation: 5062

How do I create a new structure in Screeps

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)

Upvotes: 15

Views: 7466

Answers (2)

artch
artch

Reputation: 4545

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.

Upvotes: 30

Lucas Azevedo
Lucas Azevedo

Reputation: 1095

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

Upvotes: 2

Related Questions