1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

Block variant modding guide

Discussion in 'Modding Guides and Tools' started by rexxar, Jun 30, 2016.

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

    rexxar Senior Engineer

    Messages:
    1,532
    This week's update brings us "unified building", which is the system in Medieval Engineers where you can place one block in your toolbar, then use the mouse wheel to scroll through all available variants. In the case of SE, you'd place a light armor block in your toolbar, then the scroll wheel allows you to select the slope, corner, and inverted corner blocks.

    And the variants are moddable! Here's a snipped from my CubeBlocks.sbc:

    Code:
    <Definition>
           <Id>
             <TypeId>ConveyorConnector</TypeId>
             <SubtypeId>ShipyardConveyor_Large</SubtypeId>
           </Id>
           ...
           <BlockVariants>
             <BlockVariant>
               <TypeId>ConveyorConnector</TypeId>
               <SubtypeId>ShipyardConveyorMount_Large</SubtypeId>
             </BlockVariant>
           </BlockVariants>
         </Definition>
    
    
         <Definition>
           <Id>
             <TypeId>ConveyorConnector</TypeId>
             <SubtypeId>ShipyardConveyorMount_Large</SubtypeId>
           </Id>
           ...
         </Definition>
    In this case, the ShipyardConveyor_Large is the "main" block type, and the ShipyardConveyorMount_Large is the variant type. Just place your list of variants in the definition for the main block, and you should be good to go!

    Courtesy @Digi
    Also, use
    Code:
    <GuiVisible>false</GuiVisible>
    to hide blocks from the G menu that you want to use in block variations.

    And from my testing, you need to add the same size to the variants otherwise you'll get weird grid-size swapping mid scrolling.

    This is what I'll use for my ladder which has 2 large and 3 small:


    This means that you can have only the main block visible in the G menu, and the variants are only accessible by using the scroll wheel.
     
    Last edited: Jul 2, 2016
    • Like Like x 1
Thread Status:
This last post in this thread was made more than 31 days old.