@hiryus After some trial and effort I got my spawns happily adding extensions if there aren't enough yet. Can't thank you enough.
Posts made by Gamerein
-
RE: Script for adding extensions to Spawn
-
Script for adding extensions to Spawn
Hello, I am new to this forum and to Screeps. And I was not sure if this post belongs to the Help catagory or not.
Anyway I want my creeps to be able to add extensions to any spawn. My idea was to make a method that I can add to all spawns called 'addExtension'. So when I call
Game.spawns['Spawn1'].addExtension
a construction site would be placed. But I am not sure how to program this. I want the extensions to be placed in a checker pattern around the spawn. I guess the method should just go over all tiles in that checker pattern till it finds an empty space.I hope somebody can help me with this or tell me how else I should do it
Edit: http://rein.ga/i/jHgW4.png Kind of how it should look but made from the inside out