<?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[How are we upgrading our creeps?]]></title><description><![CDATA[<p>Was interested if anyone had a good way of upgrading their creeps in a more dynamic way. So far I've only been able to successfully store the body in advance, for example:</p>
<p>var gatherBody = [CARRY, MOVE, CARRY, MOVE, CARRY, MOVE];</p>
<p>While it's dead simple to see the pattern here, this is a fixed string array and so trying to add another CARRY,MOVE when you've freed up another 100 energy with capacitors (easily checked with aRoomPointer.energyAvailable or aRoomPointer.energyCapacityAvailable) can't really be done (read above: FIXED array).</p>
<p>I feel like I missing something obvious so I was wondering if anyone had any methods of saying (if I have this much more energy, add these components).</p>
<p>This would be so much easier with a LinkedArray that supports .add() but as far as I can tell it isn't supported.</p>]]></description><link>http://screeps.com/forum/topic/1379/how-are-we-upgrading-our-creeps</link><generator>RSS for Node</generator><lastBuildDate>Fri, 16 Oct 2026 11:52:37 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/1379.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 06 Sep 2015 04:34:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How are we upgrading our creeps? on Invalid Date]]></title><description><![CDATA[<p>Was interested if anyone had a good way of upgrading their creeps in a more dynamic way. So far I've only been able to successfully store the body in advance, for example:</p>
<p>var gatherBody = [CARRY, MOVE, CARRY, MOVE, CARRY, MOVE];</p>
<p>While it's dead simple to see the pattern here, this is a fixed string array and so trying to add another CARRY,MOVE when you've freed up another 100 energy with capacitors (easily checked with aRoomPointer.energyAvailable or aRoomPointer.energyCapacityAvailable) can't really be done (read above: FIXED array).</p>
<p>I feel like I missing something obvious so I was wondering if anyone had any methods of saying (if I have this much more energy, add these components).</p>
<p>This would be so much easier with a LinkedArray that supports .add() but as far as I can tell it isn't supported.</p>]]></description><link>http://screeps.com/forum/post/6169</link><guid isPermaLink="true">http://screeps.com/forum/post/6169</guid><dc:creator><![CDATA[RaskVann]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How are we upgrading our creeps? on Invalid Date]]></title><description><![CDATA[<p>You can predefine levels for every role as follows:</p>
<p>var carrier_levels = [ { cost: 100, body: [ CARRY, MOVE ] }, { cost: 200, body: [ CARRY, MOVE, CARRY, MOVE ] } ];</p>
<p>Then select most appropriate level for certain conditions.</p>]]></description><link>http://screeps.com/forum/post/6170</link><guid isPermaLink="true">http://screeps.com/forum/post/6170</guid><dc:creator><![CDATA[Actium]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How are we upgrading our creeps? on Invalid Date]]></title><description><![CDATA[<p>I'm not sure why I didn't think of a 2D array. Thanks a bunch Actium, I should be able to wip something up rather quick.</p>]]></description><link>http://screeps.com/forum/post/6171</link><guid isPermaLink="true">http://screeps.com/forum/post/6171</guid><dc:creator><![CDATA[RaskVann]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How are we upgrading our creeps? on Invalid Date]]></title><description><![CDATA[<p>You could also do:</p>
<p>var gatherBody = [CARRY, MOVE, CARRY, MOVE, CARRY, MOVE];</p>
<p>if (some condition)<br>
     gatherBody = gatherBody.concat([CARRY, MOVE]);</p>
<p>Which will add another CARRY and another MOVE on to the original array.</p>]]></description><link>http://screeps.com/forum/post/6172</link><guid isPermaLink="true">http://screeps.com/forum/post/6172</guid><dc:creator><![CDATA[Beowulfe]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How are we upgrading our creeps? on Invalid Date]]></title><description><![CDATA[<p>var bodyparts = [];<br>
bodyparts.push(CARRY);<br>
bodyparts.push(MOVE);</p>
<p>Works fine? You can then check how many parts you want and just loop the 2 .push()</p>]]></description><link>http://screeps.com/forum/post/6173</link><guid isPermaLink="true">http://screeps.com/forum/post/6173</guid><dc:creator><![CDATA[heggico]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How are we upgrading our creeps? on Invalid Date]]></title><description><![CDATA[<p>My code</p>
<p>for each role define parts percent in the body and cost. totalPercent is the max amount of a room energy it will use<br>    parts: { <br>        pieces:[<br>            {typeName:WORK, percent:0.5, cost:100}, <br>            {typeName:CARRY, percent:0.25, cost:50}, <br>            {typeName:MOVE, percent:0.25, cost:50}<br>        ],<br>        totalPercent:0.67<br>    },</p>
<p> </p>
<p>then you just have to go through parts.pieces the amount of each part is percent * energyRoom * totalpercent /cost</p>
<p>And then loop pushing each typeName in an array</p>]]></description><link>http://screeps.com/forum/post/6174</link><guid isPermaLink="true">http://screeps.com/forum/post/6174</guid><dc:creator><![CDATA[bometo]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>