Request: room.createConstructionSite returns tentative id



  •   So I know this is a solve-able problem, and barring this feature request actually being fulfilled, I will probably just solve it by putting an adapter class around all construction related calls i make so that I can auto handle them. However the issue is like this:

    When creating a construction site, without memorizing and tracking the room position at which the construction site was created and the structure type (since some structures can be built on top of each other) and then running lookForAt every tick you cannot easily track a construction site from room.createConstructionSite call to fully produced structure by using the same id all the way, however there doesn't seem to be a reason for this.  Logically it should be easy to produce a preliminary id that room.createConstructionSite() returns if it doesn't return another error (in the same way that spawn.spawnCreep() returns a creep name of a future, non-existent creep)

    It should also be possible on construction of the actual structure, to re-use the same id, destroying the object related to the construction site, and then creating the newly created structure object with the previously used id.  Alternatively, if this interferes in some kind of auditing that is done, successfully creating a construction site could create the id for it (the construction site) and the eventual structure that is produced by it, before the eventual structure is ever actually produced, also allowing easy tracking by players.

    It just seems that this is an arbitrary exclusion since the other main way players produce entities in the game world (spawning creeps), there are a number of ways of tracking the creep from spawn call (which returns the creeps name) to finish (fully spawned creep).



  • Would be nice if the construction id carried over to the final structure.

    Would be nice indeed.



  • For backwards compatibility, it may be best if `ConstructionSite` had a `structureId` property that later became `Structure.id` upon completion.