FANDOM


IntroductionEdit

This article serves as a tutorial to adding new buildable objects. Assuming the model and the scene file is already done and/or being repurposed from an existing in-game object, there are three main procedures to making an object available to build from the build menus:

  1. Adding the respective entry in BASEBUILDINGTABLE.MBIN;
  2. Adding the respective entry in NMS_REALITY_GCPRODUCTTABLE.MBIN;
  3. Making the buildable object available to acquire in game.

For the purpose of demonstrating in a more practical form, we shall assume the case of reusing an existing table, which is already in the in-game files but not available to be built, to add to the build menu.

The use of Modding Station is recommended, and shall be used in this article for demonstration when relevant.

Locating BASEBUILDINGTABLE.MBIN and NMS_REALITY_GCPRODUCTTABLE.MBINEdit

Navigate to METADATA\REALITY\TABLES in your unpacked game files and copy the files BASEBUILDINGTABLE.MBIN and NMS_REALITY_GCPRODUCTTABLE.MBIN to your project location. The folder structure will be carried over by Modding Station, otherwise you will need to recreate it manually if you're not using Modding Station. Decompile the files as outlined in Getting Started.

Adding entry in BASEBUILDINGTABLE.MBINEdit

Adding building entries Edit

Navigate to “Objects” nested entry, copy any “GcBaseBuildingEntry.xml” entry and paste it, this will act as the template for the new entry. One entry should have such structure:

   <Property value="GcBaseBuildingEntry.xml">
     <Property name="ID" value="BUILDBED" />
     <Property name="Model" value="TkModelResource.xml">
       <Property name="Filename" value="MODELS/PLANETS/BIOMES/COMMON/BUILDINGS/PARTS/BUILDABLEPARTS/DECORATION/BED.SCENE.MBIN" />
     </Property>
     <Property name="Type" value="GcBaseBuildingObjectTypes.xml">
       <Property name="BaseBuildingObjectType" value="Decoration" />
     </Property>
     <Property name="DecorationType" value="GcBaseBuildingObjectDecorationTypes.xml">
       <Property name="BaseBuildingDecorationType" value="Normal" />
     </Property>
     <Property name="Biome" value="GcBiomeType.xml">
       <Property name="Biome" value="Lush" />
     </Property>
     <Property name="BuildableOnBase" value="True" />
     <Property name="BuildableOnFreighter" value="True" />
     <Property name="BuildableOnPlanet" value="False" />
     <Property name="GlobalLimit" value="0" />
     <Property name="SystemLimit" value="0" />
     <Property name="PlanetLimit" value="0" />
     <Property name="RegionLimit" value="0" />
     <Property name="PerBaseLimits">
       <Property value="0" />
       <Property value="0" />
       <Property value="0" />
     </Property>
     <Property name="CollisionRadiusFactor" value="0.4" />
     <Property name="CheckCollision" value="True" />
     <Property name="CollidesWithPlayer" value="True" />
     <Property name="CanPlaceOnItself" value="True" />
     <Property name="Group" value="PROPS" />
     <Property name="DontStore" value="False" />
     <Property name="CameraRotDeg" value="0" />
     <Property name="ComplexityCost" value="5" />
     <Property name="ForceExtraIdx" value="-1" />
     <Property name="SnappingLimit" value="0" />
     <Property name="GroupSnappingLimit" value="0" />
     <Property name="Hint" value="" />
     <Property name="RemoveGrass" value="True" />
     <Property name="RemoveIfNoNeighbours" value="False" />
     <Property name="ForceCheckPlayerInside" value="False" />
     <Property name="PlayerInsideRadiusFactor" value="1" />
     <Property name="CanChangeColour" value="True" />
     <Property name="CanChangeMaterial" value="True" />
   </Property>

Understanding “GcBaseBuildingEntry.xml” entries Edit

Below are explanations of several more important, or frequently used properties:

  • ID: the ID of the object, each object should have a unique object ID, the length of this value must not exceed 16 characters, for demonstration, it shall be modified to “BUILDTABLE”;
  • Filename: the file location of the object to be added, for this particular case, the location of the object is located at MODELS/PLANETS/BIOMES/COMMON/BUILDINGS/PARTS/BUILDABLEPARTS/DECORATION/TABLE1.SCENE.MBIN, and shall be changed to such;
  • BuildableOnBase, BuildableOnFreighter, BuildableOnPlanet: Boolean properties deciding if the object can be built within planetary player base limits, inside the player freighter base, and outside planetary player base limits (a.k.a in the field).;
  • GlobalLimit, SystemLimit, PlanetLimit, RegionLimit: properties restricting the number of this object which can be built in the entire galaxy, one system, one planet, and one “region” (a general area covering a certain amount of distance), 0 refers to an unlimited amount;
  • PerBaseLimits: a property containing three values, the first value limits the number of this objects which can be built in the planetary player base, second limits that in player freighter, 0 refers to an unlimited amount;
  • CheckCollision: boolean value deciding if the game will also check whether the object can be placed base on scene collision data, rather than just from the mesh itself;
  • Group: property deciding which group the object is put in inside the build menus. For demonstration purposes, the object shall be put in a custom group named ADDIT;

The entry after modification should look like this:

   <Property value="GcBaseBuildingEntry.xml">
     <Property name="ID" value="BUILDTABLE" />
     <Property name="Model" value="TkModelResource.xml">
       <Property name="Filename" value="MODELS/PLANETS/BIOMES/COMMON/BUILDINGS/PARTS/BUILDABLEPARTS/DECORATION/TABLE1.SCENE.MBIN" />
     </Property>
     <Property name="Type" value="GcBaseBuildingObjectTypes.xml">
       <Property name="BaseBuildingObjectType" value="Decoration" />
     </Property>
     <Property name="DecorationType" value="GcBaseBuildingObjectDecorationTypes.xml">
       <Property name="BaseBuildingDecorationType" value="Normal" />
     </Property>
     <Property name="Biome" value="GcBiomeType.xml">
       <Property name="Biome" value="Lush" />
     </Property>
     <Property name="BuildableOnBase" value="True" />
     <Property name="BuildableOnFreighter" value="True" />
     <Property name="BuildableOnPlanet" value="True" />
     <Property name="GlobalLimit" value="100" />
     <Property name="SystemLimit" value="100" />
     <Property name="PlanetLimit" value="100" />
     <Property name="RegionLimit" value="100" />
     <Property name="PerBaseLimits">
       <Property value="50" />
       <Property value="50" />
       <Property value="0" />
     </Property>
     <Property name="CollisionRadiusFactor" value="0.4" />
     <Property name="CheckCollision" value="False" />
     <Property name="CollidesWithPlayer" value="True" />
     <Property name="CanPlaceOnItself" value="True" />
     <Property name="Group" value="ADDIT" />
     <Property name="DontStore" value="False" />
     <Property name="CameraRotDeg" value="0" />
     <Property name="ComplexityCost" value="2" />
     <Property name="ForceExtraIdx" value="-1" />
     <Property name="SnappingLimit" value="0" />
     <Property name="GroupSnappingLimit" value="0" />
     <Property name="Hint" value="" />
     <Property name="RemoveGrass" value="True" />
     <Property name="RemoveIfNoNeighbours" value="False" />
     <Property name="ForceCheckPlayerInside" value="False" />
     <Property name="PlayerInsideRadiusFactor" value="1" />
     <Property name="CanChangeColour" value="True" />
     <Property name="CanChangeMaterial" value="True" />
   </Property>

Adding group entries Edit

Navigate to the nested entry “Groups”, located under “Objects”. Copy a “GcBaseBuildingGroup.xml” entry and paste it. One group entry contains this structure:

   <Property value="GcBaseBuildingGroup.xml">
     <Property name="ID" value="ROOMS" />
     <Property name="Name" value="BUILD_GROUP_ROOMS" />
   </Property>
  • ID: the ID of the group, corresponds to the “Group” property in the building entries;
  • Name: the name of the group, can correspond to the language files for translations in different languages, or named in plain text and appearing in the build menu in the language written.

A modified entry can look like this:

   <Property value="GcBaseBuildingGroup.xml">
     <Property name="ID" value="ADDIT" />
     <Property name="Name" value="Additional Objects" />
   </Property>

Adding entry in NMS_REALITY_GCPRODUCTTABLE.MBINEdit

Copy a “GcProductData.xml” entry and paste it. It is suggested to copy an entry of an existing buildable object, instead of a crafted product, when creating a new buildable object entry for ease of modification. One entry contains this structure: 

   <Property value="GcProductData.xml">
     <Property name="Id" value="BUILDBED" />
     <Property name="Name" value="BLD_BED_NAME" />
     <Property name="NameLower" value="BLD_BED_NAME_L" />
     <Property name="Subtitle" value="VariableSizeString.xml">
       <Property name="Value" value="BLD_BED_SUBTITLE" />
     </Property>
     <Property name="Description" value="VariableSizeString.xml">
       <Property name="Value" value="BLD_BED_DESCRIPTION" />
     </Property>
     <Property name="Hint" value="" />
     <Property name="DebrisFile" value="TkModelResource.xml">
       <Property name="Filename" value="MODELS/EFFECTS/DEBRIS/TERRAINDEBRIS/TERRAINDEBRIS4.SCENE.MBIN" />
     </Property>
     <Property name="BaseValue" value="600" />
     <Property name="Level" value="1" />
     <Property name="Icon" value="TkModelResource.xml">
       <Property name="Filename" value="TEXTURES/UI/FRONTEND/ICONS/BUILDABLE/BUILDABLE.BED.DDS" />
     </Property>
     <Property name="Colour" value="Colour.xml">
       <Property name="R" value="0.172549" />
       <Property name="G" value="0.4862745" />
       <Property name="B" value="0.6235294" />
       <Property name="A" value="1" />
     </Property>
     <Property name="SubstanceCategory" value="GcRealitySubstanceCategory.xml">
       <Property name="SubstanceCategory" value="BuildingPart" />
     </Property>
     <Property name="Category" value="GcProductCategory.xml">
       <Property name="ProductCategory" value="BuildingPart" />
     </Property>
     <Property name="Rarity" value="GcRarity.xml">
       <Property name="Rarity" value="Common" />
     </Property>
     <Property name="Legality" value="GcLegality.xml">
       <Property name="Legality" value="Legal" />
     </Property>
     <Property name="Consumable" value="False" />
     <Property name="ChargeValue" value="0" />
     <Property name="Requirements">
       <Property value="GcTechnologyRequirement.xml">
         <Property name="ID" value="COM1" />
         <Property name="InventoryType" value="GcInventoryType.xml">
           <Property name="InventoryType" value="Substance" />
         </Property>
         <Property name="Amount" value="30" />
       </Property>
     </Property>
     <Property name="Cost" value="GcItemPriceModifiers.xml">
       <Property name="SpaceStationMarkup" value="0" />
       <Property name="LowPriceMod" value="0.25" />
       <Property name="HighPriceMod" value="0.5" />
       <Property name="BuyBaseMarkup" value="0.2" />
       <Property name="BuyMarkupMod" value="0" />
     </Property>
     <Property name="SpecificChargeOnly" value="False" />
     <Property name="NormalisedValueOnWorld" value="0.01190119" />
     <Property name="NormalisedValueOffWorld" value="0.01190119" />
   </Property>

Understanding “GcProductData.xml” entries Edit

Below is a list of essential/ frequently modified properties:

  • Id: ID of the object, corresponds to the ID entry of the respective object in BASEBUILDINGTABLE.MBIN;
  • Name, NameLower, Description: Name of the object in all uppercase, normal form, and its description, can correspond to the language files for translations in different languages, or named in plain text, appears in the build menu;
  • Icon: location of the icon image file, the file must be in DDS format, and must contain an ALL UPPERCASE DDS file extension;
  • SubstanceCategory, ProductCategory: the substance and product category the entry belongs to, as a buildable object, these two properties should have the value of “BuildingPart”;
  • Requirements: the cost of building the object, each ingredient should have its separate entry, a maximum of three types of ingredient can be inputted, the structure is as such:
       <Property value="GcTechnologyRequirement.xml">
         <Property name="ID" value="COM1" />
         <Property name="InventoryType" value="GcInventoryType.xml">
           <Property name="InventoryType" value="Substance" />
         </Property>
         <Property name="Amount" value="30" />
       </Property>
ID” refers to the ID of the type of ingredient, see this table for a list of substances; “InventoryType” refers to the type of substance, it is either “Substance”, generally an element, or “Product”, generally an item; “Amount” refers to the number of ingredient required to build the object, the amount must be larger than 0.

A modified entry can look like this:

   <Property value="GcProductData.xml">
     <Property name="Id" value="BUILDTABLE" />
     <Property name="Name" value="TABLE" />
     <Property name="NameLower" value="Table" />
     <Property name="Subtitle" value="VariableSizeString.xml">
       <Property name="Value" value="Table" />
     </Property>
     <Property name="Description" value="VariableSizeString.xml">
       <Property name="Value" value="A very normal table." />
     </Property>
     <Property name="Hint" value="" />
     <Property name="DebrisFile" value="TkModelResource.xml">
       <Property name="Filename" value="MODELS/EFFECTS/DEBRIS/TERRAINDEBRIS/TERRAINDEBRIS4.SCENE.MBIN" />
     </Property>
     <Property name="BaseValue" value="600" />
     <Property name="Level" value="1" />
     <Property name="Icon" value="TkModelResource.xml">
       <Property name="Filename" value="TEXTURES/UI/FRONTEND/ICONS/BUILDABLE/BUILDABLE.TABLE001.DDS" />
     </Property>
     <Property name="Colour" value="Colour.xml">
       <Property name="R" value="0.172549" />
       <Property name="G" value="0.4862745" />
       <Property name="B" value="0.6235294" />
       <Property name="A" value="1" />
     </Property>
     <Property name="SubstanceCategory" value="GcRealitySubstanceCategory.xml">
       <Property name="SubstanceCategory" value="BuildingPart" />
     </Property>
     <Property name="Category" value="GcProductCategory.xml">
       <Property name="ProductCategory" value="BuildingPart" />
     </Property>
     <Property name="Rarity" value="GcRarity.xml">
       <Property name="Rarity" value="Common" />
     </Property>
     <Property name="Legality" value="GcLegality.xml">
       <Property name="Legality" value="Legal" />
     </Property>
     <Property name="Consumable" value="False" />
     <Property name="ChargeValue" value="0" />
     <Property name="Requirements">
       <Property value="GcTechnologyRequirement.xml">
         <Property name="ID" value="COMRARE1" />
         <Property name="InventoryType" value="GcInventoryType.xml">
           <Property name="InventoryType" value="Substance" />
         </Property>
         <Property name="Amount" value="10" />
       </Property>
     </Property>
     <Property name="Cost" value="GcItemPriceModifiers.xml">
       <Property name="SpaceStationMarkup" value="0" />
       <Property name="LowPriceMod" value="0.25" />
       <Property name="HighPriceMod" value="0.5" />
       <Property name="BuyBaseMarkup" value="0.2" />
       <Property name="BuyMarkupMod" value="0" />
     </Property>
     <Property name="SpecificChargeOnly" value="False" />
     <Property name="NormalisedValueOnWorld" value="0.01190119" />
     <Property name="NormalisedValueOffWorld" value="0.01190119" />
   </Property>

Making the object available in gameEdit

There are multiple ways in which a building blueprint can be acquired in game:

  • Adding the blueprint into DEFAULTSAVEDATA.MBIN and DEFAULTSAVEDATACREATIVE.MBIN, the default save data which automatically gives the blueprint to the player upon loading up the game;
  • Adding an entry into PURCHASEABLEBUILDINGBLUEPRINTS.MBIN, which adds the blueprint into the vendor’s list in the planetary player base;
  • Adding the blueprint into REWARDTABLE.MBIN, which adds the blueprint as a reward from interacting with various objects in game, such as dead sentinels, alien conversations, and custom objects.

Adding entry into DEFAULTSAVEDATA.MBIN and DEFAULTSAVEDATACREATIVE.MBIN Edit

Locate DEFAULTSAVEDATA.MBIN and DEFAULTSAVEDATACREATIVE.MBIN in METADATA\GAMESTATE. Copy both files to your project location, decompile and open either one of the files and search for the nested property “KnownProducts”, copy and paste an “NMSString0x10.xml” entry. Such entry has this structure:

     <Property value="NMSString0x10.xml">
       <Property name="Value" value="COMMODITY1" />
     </Property>

Edit the “Value” value, and copy the entry to the other default save file under the KnownProducts property.

Adding entry into PURCHASEABLEBUILDINGBLUEPRINTS.MBIN Edit

Navigate to METADATA\REALITY\TABLES to find PURCHASEABLEBUILDINGBLUEPRINTS.MBIN. Copy and paste an “NMSString0x10.xml” entry. Refer to the previous section to its structure. Edit the “Value” value.

Note that the game hides every sixth entry of this table. If your added entry is hidden in game, create a dummy entry in NMS_REALITY_GCPRODUCTTABLE.MBIN, and reference it in the slot in PURCHASEABLEBUILDINGBLUEPRINTS.MBIN which would be hidden by the game.

Adding blueprints into REWARDTABLE.MBIN Edit

(Due to the sophistication and many ways of adding entries into REWARDTABLE.MBIN, new entry should be created.)

Finally, Compile Your Mod! Edit

For information on how to compile your mod, check here.