Joined
    Jun 27, 2013
    Messages
    895
    Reaction score
    165
    (Not sure where to post this... Moderators, please feel free to move if you deem it more appropriate elsewhere.)


    I'm trying to make the ice->water conversion process reversible, but it seems some part of the engine doesn't like it.

    I have the following BlockConfigImport.xml:
    Code:
    <Config>
      <Element>
        <Terrain>
    
          <Block icon="155" name="Water" textureId="475, 475, 475, 475, 475, 475" type="TERRAIN_WATER">
            <!--Consistence>
            <Item count="10">TERRAIN_ICE_ID</Item>
            </Consistence-->
            <Consistence>
              <Item count="1">TERRAIN_ICE_ID</Item><!-- conversion 1:1, freezing shouldn't annihilate mass... -->
            </Consistence>
            <!--BlockResourceType>2</BlockResourceType-->
            <!--ProducedInFactory>3</ProducedInFactory-->
            <!--BasicResourceFactory>0</BasicResourceFactory-->
            <!--FactoryBakeTime>5.0</FactoryBakeTime-->
            <!--Physical>true</Physical-->
            <Physical>false</Physical><!-- make water "more liquid" -->
          </Block>
    
          <!-- try to make water<->ice conversion work in both directions... -->
          <Block icon="42" name="Ice" textureId="505, 505, 505, 505, 505, 505" type="TERRAIN_ICE_ID">
            <!--Consistence /-->
            <Consistence>
              <Item count="1">TERRAIN_WATER</Item><!-- conversion 1:1, melting shouldn't annihilate mass... -->
            </Consistence>
            <!--Price>1</Price-->
            <Price>20</Price><!-- same as water -->
            <!--BlockResourceType>2</BlockResourceType-->
            <!--ProducedInFactory>0</ProducedInFactory-->
            <!--BasicResourceFactory>0</BasicResourceFactory-->
            <!--FactoryBakeTime>5.0</FactoryBakeTime-->
            <ProducedInFactory>3</ProducedInFactory>
          </Block>
    
        </Terrain>
      </Element>
    </Config>
    I have put the original values in comments for reference, and have also tried whether it works without comments, or without modifying the water block, leaving only the modifications to ice, just in case. Same result every time.

    When I start the game, it crashes with the following error:
    Code:
    (...)
    [2015-09-05 14:42:30] [INITIALIZE] COMMAND ID's ASSIGNED
    [2015-09-05 14:42:30] [CONFIG] CONFIG FILE IMPORT FOUND: /home/Valck/StarMade/StarMade/./customBlockConfig/BlockConfigImport.xml
    [2015-09-05 14:42:31] Water(86) buildIcon 155 MERGING physical
    [2015-09-05 14:42:31] Water(86) buildIcon 155 AFTER MERGING physical
    [2015-09-05 14:42:31] Water(86) buildIcon 155 MERGING buildIconNum
    [2015-09-05 14:42:31] Water(86) buildIcon 155 AFTER MERGING buildIconNum
    [2015-09-05 14:42:31] Water(86) buildIcon 155 MERGING name
    [2015-09-05 14:42:31] Water(86) buildIcon 155 AFTER MERGING name
    [2015-09-05 14:42:31] Water(86) buildIcon 155 MERGING consistence
    [2015-09-05 14:42:31] Water(86) buildIcon 155 AFTER MERGING consistence
    [2015-09-05 14:42:31] Ice(64) buildIcon 42 MERGING buildIconNum
    [2015-09-05 14:42:31] Ice(64) buildIcon 42 AFTER MERGING buildIconNum
    [2015-09-05 14:42:31] Ice(64) buildIcon 42 MERGING name
    [2015-09-05 14:42:31] Ice(64) buildIcon 42 AFTER MERGING name
    [2015-09-05 14:42:31] Ice(64) buildIcon 42 MERGING producedInFactory
    [2015-09-05 14:42:31] Ice(64) buildIcon 42 AFTER MERGING producedInFactory
    [2015-09-05 14:42:31] Ice(64) buildIcon 42 MERGING price
    [2015-09-05 14:42:31] Ice(64) buildIcon 42 AFTER MERGING price
    [2015-09-05 14:42:31] Ice(64) buildIcon 42 MERGING consistence
    [2015-09-05 14:42:31] Ice(64) buildIcon 42 AFTER MERGING consistence
    [2015-09-05 14:42:31] [CONFIG] Merging Categories
    [2015-09-05 14:42:31] [CONFIG] Writing merged config
    [2015-09-05 14:42:33] [CONFIG] CONFIG FILE IMPORT DONE AND MERGED
    [2015-09-05 14:42:33] Exception in thread "main"
    [2015-09-05 14:42:33] java.lang.StackOverflowError
    [2015-09-05 14:42:33]     at java.util.ArrayList.isEmpty(ArrayList.java:268)
    [2015-09-05 14:42:33]     at org.schema.game.common.data.element.ElementInformation.calculateDynamicPrice(SourceFile:584)
    [2015-09-05 14:42:33]     at org.schema.game.common.data.element.ElementInformation.calculateDynamicPrice(SourceFile:588)
    (last line repeated about 1024 times)
    It obviously picks up the changes and merges them in, but then chokes when trying to use the new config.

    I wonder if anyone else has tried something similar, and maybe succeeded?