NoMansSky:Tutorials/Adding New Buildable Objects

From Step Mods | Change The Game
< NoMansSky:Tutorials
Revision as of 19:44, July 26, 2020 by TechAngel85 (talk | contribs) (Created page with "__NOTITLE__ {{NMSPage|contentTitle=Tutorials}} == Introduction == This article serves as a tutorial to adding new buildable objects. This means that we will create a custom ob...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction[edit | edit source]

This article serves as a tutorial to adding new buildable objects. This means that we will create a custom object and make it appear in the build menus. It is possible to add custom models, but for the sake of this tutorial we will make reuse a table object that already exists in-game resources but not normally available to be built.

There are three steps to follow in order to make an object available to build from the build menus:

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

The use of NMS Modding Station is recommended, and shall be used in this article for demonstration when relevant. If you haven't set it up already, make sure you do so as explained in Accessing Game Assets.

Locating BASEBUILDINGTABLE.MBIN and NMS_REALITY_GCPRODUCTTABLE.MBIN[edit | edit source]

First, these files need to be copied to a Project folder. This can be done manually, however, entire folder structure will be carried over when using NMS Modding Station. If you are not using NMS Modding Station, ensure to manually recreate the folder structure.

  1. Create a new project in NMS Modding Station. Call it whatever you prefer (e.g. TestTable).
  2. From the Unpacked Game Files tab, navigate to METADATA\REALITY\TABLES
  3. Select BASEBUILDINGTABLE.MBIN and NMS_REALITY_GCPRODUCTTABLE.MBIN
  4. Right-click on them and select [Copy to Project Files].

Now that the files are copied to your mod folder, the MBIN files need to be decompiled as outlined in Accessing Game Assets.

(Step 1) - Adding entry in BASEBUILDINGTABLE.MBIN[edit | edit source]

We are now ready to edit the decompiled files. We will start from BASEBUILDINGTABLE.MBIN (which will now be decompiled as BASEBUILDINGTABLE.exml). The objective is to duplicate the structure from an existing object already present in the exml file, and edit the parameters to create a custom one.

Creating a building entry[edit | edit source]

  1. Open BASEBUILDINGTABLE.exml with the text editor of your choice (Notepad++ is recommended).
  2. Navigate to the “Objects” nested entry (which should be around line 20)
  3. Select the entire content of the first “GcBaseBuildingEntry.xml” entry, and then paste it in order to create a duplicate.
    This duplicate will act as the template for our new entry we will use for our custom buildable table.
    The entry should look something like this:

<Property value="GcBaseBuildingEntry.xml">

 <Property name="ID" value="W_WALL" />
 <Property name="HasProduct" value="True" />
 <Property name="SnapPoints" value="TkModelResource.xml">
   <Property name="Filename" value="MODELS/PLANETS/BIOMES/COMMON/BUILDINGS/PARTS/BUILDABLEPARTS/BASICPARTS/BASIC_WALL.SCENE.MBIN" />
 </Property>
 <Property name="Model" value="TkModelResource.xml">
   <Property name="Filename" value="MODELS/PLANETS/BIOMES/COMMON/BUILDINGS/PARTS/BUILDABLEPARTS/BASICPARTS/MESHES/WOOD/BASIC_WALL.SCENE.MBIN" />
 </Property>
 <Property name="InactiveModel" value="TkModelResource.xml">
   <Property name="Filename" value="MODELS/PLANETS/BIOMES/COMMON/BUILDINGS/PARTS/BUILDABLEPARTS/BASICPARTS/MESHES/WOOD/BASIC_WALL_LOD.SCENE.MBIN" />
 </Property>
 <Property name="Type" value="GcBaseBuildingObjectTypes.xml">
   <Property name="BaseBuildingObjectType" value="BuildingFoundation" />
 </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="RegionSpawnLOD" value="2" />
 <Property name="BuildableOnBase" value="True" />
 <Property name="BuildableOnFreighter" value="False" />
 <Property name="BuildableOnPlanet" value="False" />
 <Property name="BuildableUnderwater" value="True" />
 <Property name="GlobalLimit" value="0" />
 <Property name="SystemLimit" value="0" />
 <Property name="PlanetLimit" value="0" />
 <Property name="RegionLimit" value="0" />
 <Property name="PlanetBaseLimit" value="0" />
 <Property name="FreighterBaseLimit" value="0" />
 <Property name="BaseLayoutRadius" value="2" />
 <Property name="CheckCollision" value="True" />
 <Property name="CollisionScale" value="0.5" />
 <Property name="CollidesWithPlayer" value="True" />
 <Property name="CanPlaceOnItself" value="True" />
 <Property name="Group" value="BASIC_W" />
 <Property name="DontStore" value="False" />
 <Property name="ComplexityCost" value="920" />
 <Property name="InactiveComplexityCost" value="290" />
 <Property name="ForceExtraIdx" value="-1" />
 <Property name="GroupSnappingLimit" value="0" />
 <Property name="CanChangeColour" value="True" />
 <Property name="CanChangeMaterial" value="False" />
 <Property name="CanPickUp" value="False" />
 <Property name="ScanRadius" value="0" />
 <Property name="RemovesAttachedDecoration" value="True" />
 <Property name="EditsTerrain" value="False" />
 <Property name="BaseTerrainEditShape" value="Cube" />
 <Property name="TerrainEditBaseYOffset" value="0" />
 <Property name="TerrainEditTopYOffset" value="0" />
 <Property name="TerrainEditBoundsScalar" value="1" />

</Property> Template:NMSPageClose