BlockVariantGroups Tutorial

This tutorial teaches you how to add a block to one of the block “scroll groups” marked with + in the G-menu (called BlockVariantGroup or BVG) and also explains how to create your own such group. The relevant reference page for this tutorial is .


I. Adding to a BlockVariantGroup

Navigate to your game’s installation directory and into the Data-subfolder. There you will find the file named BlockVariantGroups.sbc. Copy it into your mod’s Data-folder.

Open the file in Visual Studio Code. Within the element BlockVariantGroups you'll see individual BlockVariantGroup-entries defined. Search for the groupyou want to add your block(s) to either by looking at their Subtype or the individual block entries. Once you’ve found the BVG you want, delete all other groups from the file.

Next, you create entries for each of the blocks you want to add to the group under Blocks. Note that the first entry in the list defines the block that is shown on the “face” of the group, marked with the + and the order in which they are listed in the BVG corresponds to the order of the entries under Blocks. An entry for a block consists of the following:

<Block Type="MyObjectBuilder_CubeBlock" Subtype="LargeBlockArmorBlock" />

Type is your block’s TypeId with MyObjectBuilder_ added to the front of it.

Subtype is the same as your block’s SubtypeId.

Note that BVGs are non-additive. This means that you have to redefine the entire BlockVariantGroup and all its entries if you would like to extend one that exists in the base game. It also means that if two mods edit the same group, the one higher in the mod list will entirely overwrite the one lower in the list.

As an example of amending an existing BVG, I’m going to use my conveyor expansion mod. Below you’ll see an example of a BVG I have adjusted, which is the ConveyorThickGroup that is essentially the large grid and medium size small grid conveyor group:

<?xml version="1.0" encoding="utf-8"?> <Definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <BlockVariantGroups> <BlockVariantGroup> <Id Type="MyObjectBuilder_BlockVariantGroup" Subtype="ConveyorThickGroup" /> <Icon>Textures\GUI\Icons\Cubes\ConveyorTube.dds</Icon> <DisplayName>DisplayName_ConveyorTube</DisplayName> <Description>Description_ConveyorTube</Description> <Blocks> <Block Type="MyObjectBuilder_ConveyorConnector" Subtype="ConveyorTube" /> <Block Type="MyObjectBuilder_ConveyorConnector" Subtype="ConveyorTubeCurved" /> <Block Type="MyObjectBuilder_Conveyor" Subtype="ConveyorTubeT" /> <Block Type="MyObjectBuilder_Conveyor" Subtype="AQD_LG_ConveyorX" /> <Block Type="MyObjectBuilder_Conveyor" Subtype="AQD_LG_ConveyorJunctionTubes" /> <Block Type="MyObjectBuilder_ConveyorSorter" Subtype="LargeBlockConveyorSorter" /> <Block Type="MyObjectBuilder_ConveyorConnector" Subtype="ConveyorTubeMedium" /> <Block Type="MyObjectBuilder_ConveyorConnector" Subtype="ConveyorTubeCurvedMedium" /> <Block Type="MyObjectBuilder_Conveyor" Subtype="SmallShipConveyorHub" /> <Block Type="MyObjectBuilder_ConveyorConnector" Subtype="ConveyorFrameMedium" /> <Block Type="MyObjectBuilder_Conveyor" Subtype="SmallBlockConveyorConverter" /> <Block Type="MyObjectBuilder_ConveyorSorter" Subtype="MediumBlockConveyorSorter" /> </Blocks> </BlockVariantGroup> </BlockVariantGroups> </Definitions>

Start up the game and add your mod to a savegame. Then load it and check your G-menu and the BVG you altered. The group should now show up with your added blocks:


II. Creating a new BlockVariantGroup

In some cases, you might want to create your own BVG instead of extending an existing one. To do that, navigate to your game’s installation directory and into the Data-subfolder. There you will find the file named BlockVariantGroups.sbc. Copy it into your mod’s Data-folder.


Troubleshooting

The BVG cannot be moved to the hotbar / is blocked

Blocks do not appear in the correct position within the BVG

My block does not appear in the BVG it was added to

Learnings

How to add a block to an existing BVG in the G-menu

 

Prerequisites

 

Overview

 

Related