Destroying structures and available energy

Fairly minor, but should I be able to queue structures that require 20 energy after queuing the destruction of a structure that would then make that energy available?

This is a known issue in the queuing, and I appreciate it’s a little problematic.

From a technical perspective, Destroy Metal Mine is a ‘Unit’, which looks like this:

<AddAction          name="Destroy_Metal_Mine" turns="1" limit="1" />
<AddActionTarget    name="Destroy_Metal_Mine" target="SOURCE" type="LOCATION" relation="OWNED" />
<AddActionCondition name="Destroy_Metal_Mine" target="SOURCE" execute="START"  condition="EXISTS" conditionName1="Metal_Mine" conditionAmount1="1"    />
<AddActionCondition name="Destroy_Metal_Mine" target="SOURCE" execute="FINISH" condition="ADD"    conditionName1="Metal"      conditionAmount1="300"  />
<AddActionCondition name="Destroy_Metal_Mine" target="SOURCE" execute="FINISH" condition="ADD"    conditionName1="Mineral"    conditionAmount1="1000" />
<AddActionCondition name="Destroy_Metal_Mine" target="SOURCE" execute="FINISH" condition="ADD"    conditionName1="Ground"     conditionAmount1="1"    />
<AddActionCondition name="Destroy_Metal_Mine" target="SOURCE" execute="FINISH" condition="REMOVE" conditionName1="Metal_Mine" conditionAmount1="1"    />

The problem with the queue currently is that it looks for ‘Upkeep’ of the unit queued, and in these cases, they obviously don’t have upkeep, the upkeep is being maintained at the Metal Mine itself.

So the calculator can’t actually determine how much energy would be available on the planet once that item completes, without having to start massively traversing all the structures, and performing the calculation there.

I’m going to look into this a little bit, and see if there’s an easy way to handle this, but the entire pre-queue system is a bit of a kludged hack at the moment, the new UI version of this is substantially cleaner, because it ‘completes’ the queue to determine the end result before performing the calculations on what can be done afterwards, it’s just a lot of code to backport from Javascript into the HTML UI.

Thanks.

1 Like