Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Uniquely identify a block without the use of CustomName?

Discussion in 'Programming Questions and Suggestions' started by Malware, Jan 29, 2015.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Phoera Senior Engineer

    Messages:
    1,713
    where GetCubeBlock generating exception when it cannot find block.
    it must return null.
     
  2. hellokeith Apprentice Engineer

    Messages:
    335
    Hrmm. It's not the same EntityID stored in the Sandbox SBS file.
     
  3. Phoera Senior Engineer

    Messages:
    1,713
    which values you compare?
     
  4. happyjack27 Apprentice Engineer

    Messages:
    452
    [​IMG]

    "That one."
     
    Last edited by a moderator: Jan 30, 2015
  5. Immersive Apprentice Engineer

    Messages:
    122
    Ahh. That does make things rather.. awkward.
     
  6. hellokeith Apprentice Engineer

    Messages:
    335
    [​IMG]
    Code:
    <MyObjectBuilder_CubeBlock xsi:type="MyObjectBuilder_Reactor">
    <SubtypeName>SmallBlockSmallGenerator</SubtypeName>
    <EntityId>188930194007816968</EntityId>
    <Min x="3" y="-2" z="-6" />
    <BlockOrientation Forward="Up" Up="Right" />
    <ColorMaskHSV x="0" y="-1" z="0" />
    <ShareMode>None</ShareMode>
    <DeformationRatio>0</DeformationRatio>
    <CustomName>test reactor 1</CustomName>
    <ShowOnHUD>false</ShowOnHUD>
    <Enabled>true</Enabled>
    <Inventory>
    <Items>
    <MyObjectBuilder_InventoryItem>
    <Amount>0.984929</Amount>
    <PhysicalContent xsi:type="MyObjectBuilder_Ingot">
    <SubtypeName>Uranium</SubtypeName>
    </PhysicalContent>
    <ItemId>0</ItemId>
    <AmountDecimal>0.984929</AmountDecimal>
    </MyObjectBuilder_InventoryItem>
    </Items>
    <nextItemId>1</nextItemId>
    </Inventory>
    </MyObjectBuilder_CubeBlock>
    
    <MyObjectBuilder_CubeBlock xsi:type="MyObjectBuilder_Reactor">
    <SubtypeName>SmallBlockSmallGenerator</SubtypeName>
    <EntityId>179375487271291264</EntityId>
    <Min x="3" y="-2" z="1" />
    <BlockOrientation Forward="Up" Up="Right" />
    <ColorMaskHSV x="0.575" y="0" z="0" />
    <ShareMode>None</ShareMode>
    <DeformationRatio>0</DeformationRatio>
    <CustomName>test reactor 2</CustomName>
    <ShowOnHUD>false</ShowOnHUD>
    <Enabled>true</Enabled>
    <Inventory>
    <Items>
    <MyObjectBuilder_InventoryItem>
    <Amount>4.977923</Amount>
    <PhysicalContent xsi:type="MyObjectBuilder_Ingot">
    <SubtypeName>Uranium</SubtypeName>
    </PhysicalContent>
    <ItemId>0</ItemId>
    <AmountDecimal>4.977923</AmountDecimal>
    </MyObjectBuilder_InventoryItem>
    </Items>
    <nextItemId>1</nextItemId>
    </Inventory>
    </MyObjectBuilder_CubeBlock>
    
    Now I see that the EntityID ingame is Hex = Decimal in file. :)

    For comparisons, should we parse the ToString to get the EntityID? Or just leave it as is?
     
  7. Phoera Senior Engineer

    Messages:
    1,713
    better parse, cuz typename can change with update as part of obfuscation.
     
Thread Status:
This last post in this thread was made more than 31 days old.