<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Draft: Power Creeps API]]></title><description><![CDATA[<p>Here is the request for comments proposal of the Power Creeps API.</p>
<h2>PowerCreep.create(name, className)</h2>
<p><em>A static method.</em></p>
<p>Create a new level 0 power creep. The created power creep isn't spawned in the world yet, it's just added to your account. In order to spawn it, you have to call <code>PowerSpawn.spawnPowerCreep</code>. You must have 1 spare Power Level in your account, othwerise <code>ERR_NOT_ENOUGH_RESOURCES</code> is returned.</p>
<p>Example:</p>
<pre><code class="language-js">PowerCreep.create('MyOperator1', CLASS_OPERATOR);
</code></pre>
<p><code>Game.powerCreeps['MyOperator1']</code> will be added on the next tick.</p>
<h2>PowerCreep.prototype</h2>
<p><em>Inherited from <code>RoomObject</code>.</em></p>
<p>Own properties:</p>
<ul>
<li><code>name</code> string</li>
<li><code>className</code> string</li>
<li><code>hits</code> number</li>
<li><code>hitsMax</code> number</li>
<li><code>carry</code> object</li>
<li><code>carryCapacity</code> number</li>
<li><code>owner</code> object</li>
<li><code>level</code> number</li>
<li><code>spawnCooldown</code> number - the number of ticks to wait until the creep can be spawned in the world, or <code>undefined</code> if it is already spawned;</li>
<li><code>powers</code> object&lt;string, object&gt; - list of all creep's powers in the following format:<pre><code class="language-js">{ 
  [PWR_OPERATE_EXTENSION]: {
    level: 1,
    cooldown: 0
  },
  [PWR_OPERATE_SPAWN]: {
    level: 2,
    cooldown: 3  // ticks until you can use it again
  }
}
</code></pre>
</li>
</ul>
<h2>PowerCreep.prototype.upgrade(power)</h2>
<p>Level up the power creep by upgrading one of its powers. <code>power</code> can by any of <code>PWR_*</code> constant. You need to have 1 spare Power Level in your account, otherwise <code>ERR_NOT_ENOUGH_RESOURCES</code> is returned. If the specified power cannot be taken on this level, <code>ERR_INVALID_ARGS</code> is returned.</p>
<p>Example:</p>
<pre><code class="language-js">Game.powerCreeps['MyOperator1'].upgrade(PWR_OPERATE_EXTENSION);
</code></pre>
<h2>PowerCreep.prototype.delete()</h2>
<p>Remove this power creep from your account, releasing the Power Levels it uses. The creep must not be spawned in the world in order to call this method.</p>
<p>Example:</p>
<pre><code class="language-js">Game.powerCreeps['MyOperator1'].delete();
</code></pre>
<h2>PowerCreep.prototype.usePower(power, [target])</h2>
<p>Use the specified power. <code>power</code> is one of the <code>PWR_*</code> constants. <code>target</code> (optional) can be any <code>RoomObject</code> or <code>RoomPosition</code> instance depending on the power semantics. If the power is not available for this creep, <code>ERR_NO_BODYPART</code> is returned. If the power's cooldown is still active, <code>ERR_TIRED</code> is returned. If power usage is not enabled in the room (<code>room.controller.isPowerEnabled === false</code>), <code>ERR_INVALID_ARGS</code> is returned.</p>
<p>Example:</p>
<pre><code class="language-js">Game.powerCreeps['MyOperator'].usePower(PWR_EXTEND_SOURCE, source);
</code></pre>
<h2>PowerCreep.prototype.enableRoom(controller)</h2>
<p>Enable power usage in the room. The controller has to be at the adjacent square.</p>
<p>Example:</p>
<pre><code class="language-js">let powerCreep = Game.powerCreeps['MyOperator1'];
powerCreep.enableRoom(powerCreep.controller);
</code></pre>
<h2>PowerSpawn.prototype.spawnPowerCreep(name)</h2>
<p>Spawn the power creep with the specified name. The creep must be not spawned already and have <code>spawnCooldown === 0</code>. The creep is spawned immediately on the next tick.</p>
<p>Example:</p>
<pre><code class="language-js">powerSpawn.spawnPowerCreep('MyOperator1');
</code></pre>
<h2>RoomObject.prototype.effects</h2>
<p>The list of active temporary effects (e.g. applied powers) on this object in the following format:</p>
<pre><code class="language-js">console.log(Game.spawns['Spawn1'].effects);

{
  [PWR_OPERATE_SPAWN]: {
    level: 2,
    ticksRemaining: 942
  }
}
</code></pre>
<h2>StructureController.prototype.isPowerEnabled</h2>
<p>A boolean value indicating whether power usage is enabled in this room.</p>
]]></description><link>http://screeps.com/forum/topic/2233/draft-power-creeps-api</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 18:47:31 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/2233.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 16 May 2018 10:58:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Draft: Power Creeps API on Wed, 16 May 2018 11:35:53 GMT]]></title><description><![CDATA[<p>Here is the request for comments proposal of the Power Creeps API.</p>
<h2>PowerCreep.create(name, className)</h2>
<p><em>A static method.</em></p>
<p>Create a new level 0 power creep. The created power creep isn't spawned in the world yet, it's just added to your account. In order to spawn it, you have to call <code>PowerSpawn.spawnPowerCreep</code>. You must have 1 spare Power Level in your account, othwerise <code>ERR_NOT_ENOUGH_RESOURCES</code> is returned.</p>
<p>Example:</p>
<pre><code class="language-js">PowerCreep.create('MyOperator1', CLASS_OPERATOR);
</code></pre>
<p><code>Game.powerCreeps['MyOperator1']</code> will be added on the next tick.</p>
<h2>PowerCreep.prototype</h2>
<p><em>Inherited from <code>RoomObject</code>.</em></p>
<p>Own properties:</p>
<ul>
<li><code>name</code> string</li>
<li><code>className</code> string</li>
<li><code>hits</code> number</li>
<li><code>hitsMax</code> number</li>
<li><code>carry</code> object</li>
<li><code>carryCapacity</code> number</li>
<li><code>owner</code> object</li>
<li><code>level</code> number</li>
<li><code>spawnCooldown</code> number - the number of ticks to wait until the creep can be spawned in the world, or <code>undefined</code> if it is already spawned;</li>
<li><code>powers</code> object&lt;string, object&gt; - list of all creep's powers in the following format:<pre><code class="language-js">{ 
  [PWR_OPERATE_EXTENSION]: {
    level: 1,
    cooldown: 0
  },
  [PWR_OPERATE_SPAWN]: {
    level: 2,
    cooldown: 3  // ticks until you can use it again
  }
}
</code></pre>
</li>
</ul>
<h2>PowerCreep.prototype.upgrade(power)</h2>
<p>Level up the power creep by upgrading one of its powers. <code>power</code> can by any of <code>PWR_*</code> constant. You need to have 1 spare Power Level in your account, otherwise <code>ERR_NOT_ENOUGH_RESOURCES</code> is returned. If the specified power cannot be taken on this level, <code>ERR_INVALID_ARGS</code> is returned.</p>
<p>Example:</p>
<pre><code class="language-js">Game.powerCreeps['MyOperator1'].upgrade(PWR_OPERATE_EXTENSION);
</code></pre>
<h2>PowerCreep.prototype.delete()</h2>
<p>Remove this power creep from your account, releasing the Power Levels it uses. The creep must not be spawned in the world in order to call this method.</p>
<p>Example:</p>
<pre><code class="language-js">Game.powerCreeps['MyOperator1'].delete();
</code></pre>
<h2>PowerCreep.prototype.usePower(power, [target])</h2>
<p>Use the specified power. <code>power</code> is one of the <code>PWR_*</code> constants. <code>target</code> (optional) can be any <code>RoomObject</code> or <code>RoomPosition</code> instance depending on the power semantics. If the power is not available for this creep, <code>ERR_NO_BODYPART</code> is returned. If the power's cooldown is still active, <code>ERR_TIRED</code> is returned. If power usage is not enabled in the room (<code>room.controller.isPowerEnabled === false</code>), <code>ERR_INVALID_ARGS</code> is returned.</p>
<p>Example:</p>
<pre><code class="language-js">Game.powerCreeps['MyOperator'].usePower(PWR_EXTEND_SOURCE, source);
</code></pre>
<h2>PowerCreep.prototype.enableRoom(controller)</h2>
<p>Enable power usage in the room. The controller has to be at the adjacent square.</p>
<p>Example:</p>
<pre><code class="language-js">let powerCreep = Game.powerCreeps['MyOperator1'];
powerCreep.enableRoom(powerCreep.controller);
</code></pre>
<h2>PowerSpawn.prototype.spawnPowerCreep(name)</h2>
<p>Spawn the power creep with the specified name. The creep must be not spawned already and have <code>spawnCooldown === 0</code>. The creep is spawned immediately on the next tick.</p>
<p>Example:</p>
<pre><code class="language-js">powerSpawn.spawnPowerCreep('MyOperator1');
</code></pre>
<h2>RoomObject.prototype.effects</h2>
<p>The list of active temporary effects (e.g. applied powers) on this object in the following format:</p>
<pre><code class="language-js">console.log(Game.spawns['Spawn1'].effects);

{
  [PWR_OPERATE_SPAWN]: {
    level: 2,
    ticksRemaining: 942
  }
}
</code></pre>
<h2>StructureController.prototype.isPowerEnabled</h2>
<p>A boolean value indicating whether power usage is enabled in this room.</p>
]]></description><link>http://screeps.com/forum/post/10607</link><guid isPermaLink="true">http://screeps.com/forum/post/10607</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Wed, 16 May 2018 11:35:53 GMT</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Wed, 16 May 2018 11:15:31 GMT]]></title><description><![CDATA[<p>Looks good! Should <code>delete</code> be <code>suicide</code> to match with regular creeps?</p>
<p>Will power spawns also need a Spawning object and/or directions?</p>
]]></description><link>http://screeps.com/forum/post/10608</link><guid isPermaLink="true">http://screeps.com/forum/post/10608</guid><dc:creator><![CDATA[Tigga]]></dc:creator><pubDate>Wed, 16 May 2018 11:15:31 GMT</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Wed, 16 May 2018 11:15:12 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/138">@tigga</a></p>
<blockquote>
<p>Looks good! Should delete be suicide to match with regular creeps?</p>
</blockquote>
<p><code>suicide</code> is when the creep is killed and becomes not spawned in the world, but still exists and occupies Power Levels. <code>delete</code> is when it is totally removed from your account.</p>
<blockquote>
<p>Will power spawns also need a Spawning object and/or?</p>
</blockquote>
<p>No, due to this: <code>The creep is spawned immediately on the next tick.</code></p>
]]></description><link>http://screeps.com/forum/post/10609</link><guid isPermaLink="true">http://screeps.com/forum/post/10609</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Wed, 16 May 2018 11:15:12 GMT</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Invalid Date]]></title><description><![CDATA[<blockquote>
<p><code>PowerSpawn.prototype.spawnPowerCreep(name)</code></p>
</blockquote>
<p>Should this have a directions property? It would be great to not spawn my power creeps outside of ramparts if I have a power spawn on the edge of a defended line.</p>
<p>Since I don't see any &quot;can spawn&quot; functions, are we to assume that power creeps are free to spawn if they are off cooldown? <img
      src="http://screeps.com/forum/plugins/nodebb-plugin-emoji/emoji/android/1f622.png?v=a1k070tfs06"
      class="not-responsive emoji emoji-android emoji--cry"
      title=":cry:"
      alt="😢"
    /></p>
<blockquote>
<p><code>PowerCreep.prototype.delete()</code> <br/>
The creep must not be spawned in the world in order to call this method.</p>
</blockquote>
<p>Why does this require the power creep be spawned? So, if while testing I create a power creep, and then I want to delete it, I have to spawn it first?</p>
<p>Otherwise this looks great!</p>
]]></description><link>http://screeps.com/forum/post/10611</link><guid isPermaLink="true">http://screeps.com/forum/post/10611</guid><dc:creator><![CDATA[Gankdalf]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/252">@gankdalf</a></p>
<blockquote>
<p>Should this have a directions property? It would be great to not spawn my power creeps outside of ramparts if I have a power spawn on the edge of a defended line.</p>
</blockquote>
<p>We'll consider it.</p>
<blockquote>
<p>Since I don't see any &quot;can spawn&quot; functions, are we to assume that power creeps are free to spawn if they are off cooldown?</p>
</blockquote>
<p>Yes, they are free to spawn.</p>
<blockquote>
<p>Why does this require the power creep be spawned?</p>
</blockquote>
<p>You misread, it requires the creep to be NOT spawned.</p>
]]></description><link>http://screeps.com/forum/post/10614</link><guid isPermaLink="true">http://screeps.com/forum/post/10614</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Invalid Date]]></title><description><![CDATA[<blockquote>
<p>You misread, it requires the creep to be NOT spawned.</p>
</blockquote>
<p>That makes so much more sense.</p>
]]></description><link>http://screeps.com/forum/post/10615</link><guid isPermaLink="true">http://screeps.com/forum/post/10615</guid><dc:creator><![CDATA[Gankdalf]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Invalid Date]]></title><description><![CDATA[<p>Will there be anything like the following:</p>
<p><code>Game.map.isPowerEnabled(roomName)</code>?</p>
<p><code>Room.prototype.powerEnabled</code>?</p>
<p>It would be good to make sure that every possible information gathering feature is added for anything related to all of this. Want to avoid informational gaps similar to the lack of a way to know which rooms on the map are blocked by novice/respawn zones or not.</p>
]]></description><link>http://screeps.com/forum/post/10618</link><guid isPermaLink="true">http://screeps.com/forum/post/10618</guid><dc:creator><![CDATA[Helam]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/96">@helam</a> Also, given that power creeps are essentially defenseless in non-power enabled rooms, it would be very useful to be able to avoid pathing through those rooms.</p>
]]></description><link>http://screeps.com/forum/post/10619</link><guid isPermaLink="true">http://screeps.com/forum/post/10619</guid><dc:creator><![CDATA[Davaned]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Thu, 17 May 2018 07:01:34 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/96">@helam</a> No, the power enabled flag is available only for objects loaded from the database (i.e. visible rooms). You may want to observe them yourself periodically and cache this info. It's not like novice/respawn areas, since you do have the way to check it, you just need to obtain visibility.</p>
]]></description><link>http://screeps.com/forum/post/10620</link><guid isPermaLink="true">http://screeps.com/forum/post/10620</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Thu, 17 May 2018 07:01:34 GMT</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/3">@artch</a> so <code>Room</code> objects will have a property to tell us if power is enabled or not? If we can observe it this is good.</p>
]]></description><link>http://screeps.com/forum/post/10622</link><guid isPermaLink="true">http://screeps.com/forum/post/10622</guid><dc:creator><![CDATA[Helam]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/96">@helam</a> It's <code>Room.controller.isPowerEnabled</code>, see the first post here:</p>
<blockquote>
<h2>StructureController.prototype.isPowerEnabled</h2>
<p>A boolean value indicating whether power usage is enabled in this room.</p>
</blockquote>
]]></description><link>http://screeps.com/forum/post/10623</link><guid isPermaLink="true">http://screeps.com/forum/post/10623</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/3">@artch</a> O.o I must have missed that, sorry and thank you. Has it been decided how to handle power in rooms without controllers? In this post (<a href="https://screeps.com/forum/topic/2183/power-creeps-update/19" rel="nofollow">https://screeps.com/forum/topic/2183/power-creeps-update/19</a>) it was mentioned that it had not been decided yet.</p>
]]></description><link>http://screeps.com/forum/post/10624</link><guid isPermaLink="true">http://screeps.com/forum/post/10624</guid><dc:creator><![CDATA[Helam]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Sat, 19 May 2018 14:58:45 GMT]]></title><description><![CDATA[<p>Will there a method to get all available (created in account) power creeps? Something like <code>Game.powerCreeps</code> or <code>PowerCreep.getCreeps()</code>. Will they also occured in Game.creeps? If yes then only if spawned or when unspawned too? Also maybe there must by a property <code>spawned</code> in any case.</p>
]]></description><link>http://screeps.com/forum/post/10631</link><guid isPermaLink="true">http://screeps.com/forum/post/10631</guid><dc:creator><![CDATA[U-238]]></dc:creator><pubDate>Sat, 19 May 2018 14:58:45 GMT</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Sat, 19 May 2018 20:39:01 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/2125">@u-238</a></p>
<blockquote>
<p>Will there a method to get all available (created in account) power creeps? Something like Game.powerCreeps or PowerCreep.getCreeps().</p>
</blockquote>
<p>I think that examples in the first post answer your question. It's <code>Game.powerCreeps</code>.</p>
<blockquote>
<p>Also maybe there must by a property <code>spawned</code> in any case.</p>
</blockquote>
<p><code>spawnCooldown</code> property serves this purpose:</p>
<blockquote>
<p>the number of ticks to wait until the creep can be spawned in the world, or <code>undefined</code> if it is already spawned;</p>
</blockquote>
]]></description><link>http://screeps.com/forum/post/10632</link><guid isPermaLink="true">http://screeps.com/forum/post/10632</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Sat, 19 May 2018 20:39:01 GMT</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/96">@helam</a> <a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/3">@artch</a></p>
<p>If power creeps work in rooms without controllers, please consider adding a isPowerEnabled property on the room instead of on the controller.</p>
<p>Also please consider making a better way for me to tell if one of my rooms is being attacked with a power apart from periodically cycling through every single roomObject in every single room I own to check if there is an entry in .effects that I don't expect to be there. For hostile effects, it would be amazing if you told me which player owns the effect.</p>
<p>For instance, maybe there could be a Room.activeEffects property that is an array of all the effects active in a room. Even better would be if it were a hashmap to a list of effects indexed by owner. So Room.activeEffects['shedletsky'] will give me an array of all my active effects.</p>
]]></description><link>http://screeps.com/forum/post/10639</link><guid isPermaLink="true">http://screeps.com/forum/post/10639</guid><dc:creator><![CDATA[shedletsky]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/56">@shedletsky</a> I think that adding power events to the <a href="https://screeps.com/forum/topic/2118/draft-room-event-log" rel="nofollow">room events log</a> will be more correct approach.</p>
]]></description><link>http://screeps.com/forum/post/10640</link><guid isPermaLink="true">http://screeps.com/forum/post/10640</guid><dc:creator><![CDATA[artch]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Draft: Power Creeps API on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/3">@artch</a> Yes, I didn't know about the room event log when I posted. I think adding the owner/creator as a property on each effect in the log would be helpful, otherwise figuring out when I'm being messed with could be challenging.</p>
]]></description><link>http://screeps.com/forum/post/10646</link><guid isPermaLink="true">http://screeps.com/forum/post/10646</guid><dc:creator><![CDATA[shedletsky]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>