BlockCategories

From Space Engineers Wiki
< Modding‎ | Reference‎ | SBC
Jump to navigation Jump to search

BlockCategories are the categories shown in the list on the left side of the G-menu in Space Engineers. Blocks are roughly categorized into one or multiple fitting ones in order to make them easier for players to find.

Wrapper & Entry Example

<?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">
    <CategoryClasses>
        <!-- One or more BlockCategory entries are placed here. -->
    </CategoryClasses>
</Definitions>
A typical BlockCategories.sbc entry
        <Category xsi:type="MyObjectBuilder_GuiBlockCategoryDefinition">
            <Id>
                <TypeId>GuiBlockCategoryDefinition</TypeId>
                <SubtypeId/>
            </Id>
            <DisplayName>DisplayName_Category_Production</DisplayName>
            <Name>Production</Name>
            <StrictSearch>true</StrictSearch>
            <ItemIds>
                <string>Refinery/LargeRefinery</string>
                <string>Refinery/LargeRefineryIndustrial</string>
                <string>Refinery/Blast Furnace</string>
                <string>Assembler/BasicAssembler</string>
                <string>Assembler/LargeAssembler</string>
                <string>Assembler/LargeAssemblerIndustrial</string>
                <string>Projector/LargeProjector</string>
                <string>OxygenGenerator/(null)</string>
                <string>SurvivalKit/SurvivalKit</string>
                <string>SurvivalKit/SurvivalKitLarge</string>
            </ItemIds>
        </Category>
This is the entry for the BlockCategory Production, containing Refineries, Assemblers, O2 Generators, etc.

Elements

Note that BlockCategories are not differentiated by their SubtypeId but by their Name. Furthermore, redefining them in your mod works to add your own ItemIds but does not allow you to change the other variables (StrictSearch / AvailableInSurvival).
Element Description

DisplayName

String: RESX Reference or Name

The reference to the RESX entry for the localized ingame name of the BlockCategory as shown in the G-menu or a plaintext name, if RESX is not used.

Name

String: Identifier

This is the unique identifier by which this BlockCategory is differentiated from others.

StrictSearch

Boolean: true / false

By default, if a block is part of a BlockVariantGroup, it will be displayed in any category the first block in the group is part of. If this element is set to true, this is prevented.

SearchBlocks

Boolean: true / false

Whether the contents of the category should show up as search results or not.

IsShipCategory

Boolean: true / false

Determines whether the category appears as its own category even in the Hotbar Config, the alternate G-menu that appears when seated on a grid. Defaults to false and any category not setting it to true will have its blocks put into the generic Blocks-category in the seated G-menu.
Only very specific categories have this set to true. It should not be used in a normal case.

IsBlockCategory

Boolean: true / false

This defaults to true. It marks a category that contains blocks that are placeable in world.

IsToolCategory

Boolean: true / false

Blocks placed in a category with this element set to true are generally weapons or ship tools whose actions can be triggered with right and left click, with the exception of if the category also defines IsShipCategory = false, in which case it is used for character tools and weapons.

ShowAnimations

Boolean: true / false

It’s currently not entirely clear what effect this has, or if it has an effect at all.

IsAnimationCategory

Boolean: true / false

This is only used for the category containing all the emotes and character animations.

AvailableInSurvival

Boolean: true / false

Whether the items registered to this category should be available if the world is in survival mode.
Note that this only relates to the world setting, and is not affected by a player having access to Creative Mode Tools while the world is in Survival.

ShowInCreative

Boolean: true / false

Whether the blocks registered to this category should be available if the world is in creative mode.

ItemIds

Subelement: string

This element can contain one or multiple subelements called strings, which define single entries into the category.
Note that these entries are additive, which means that you will not have to include all entries in the vanilla BlockCategory if you’d like to add your own. You can just redefine the category and only include the string-entries you’d like to add to the existing category.

A string-entry consists of two parts combined with a / into one String:

  • TypeId - The TypeId of the item is the first part.
  • SubtypeId - The SubtypeId of the item is the second part.