FANDOM


How to make a compatibility patch for two mods editing PLANETBUILDINGTABLE.exml Edit

By theFisher86


Many mods use the open "slot" for "None" in the PlanetBuildingTable to spawn their custom models.  This is a great way to do except it's not expandable using PlanetBuildingTable as there are limited "slots."  

By utilizing the method described below you can make two mods compatible with each other without too much effort.


Step One Edit

It'd probably be best to start with the vanilla PlanetBuildingTable file.


Add a Reference to a CustomModel that we'll be building to the slots you want to spawn ALL of the objects in.  Basically what we're doing here is instead of spawning your object directly into the PlanetBuildingTable.

We're going to spawn a spawner which will use a scenegraph to spawn the objects from the multiple mods.  Then if you need to add another mod to the compatibility patch you'll add that via the spawner instead of PlanetBuildingTable.


Here's an example of just the Traders section where I added the spawner:

 <Property name="Traders" value="GcBuildingFilenameList.xml">
 
 <Property name="BuildingFiles">
 
 	<Property name="None" value="GcBuildingFilename.xml">
 
 	  <Property name="LSystem" value="" />
 
 	  <Property name="Scene" value="CUSTOMMODELS/RRO-Constructs_Spawner/RRO-Constructs_Spawner.SCENE.MBIN" />
 
 	  <Property name="UnderwaterLSystem" value="" />
 
 	  <Property name="UnderwaterScene" value="CUSTOMMODELS/RRO-Constructs_Spawner/RRO-Constructs_Spawner.SCENE.MBIN" />
 
 	</Property>

Step Two Edit

Create the spawner and add references to the mods scenes there.

Make a new file.  I'd recommend following the naming pattern I used: MOD1-MOD2_Spawner.SCENE.exml

Paste this into the file.  It includes "slots" for 5 "picks" or models which will spawn in there.  Delete or add as needed.

!!!Keep in mind that the "slots" ID names have a 16 character limit.

<Data template="TkSceneNodeData">
  <Property name="Name" value="CUSTOMMODELS\RRO-Constructs_Spawner\RRO-Constructs_Spawner" />
  <Property name="Type" value="MODEL" />
  <Property name="Transform" value="TkTransformData.xml">
    <Property name="TransX" value="0" />
    <Property name="TransY" value="0" />
    <Property name="TransZ" value="0" />
    <Property name="RotX" value="0" />
    <Property name="RotY" value="0" />
    <Property name="RotZ" value="0" />
    <Property name="ScaleX" value="1" />
    <Property name="ScaleY" value="1" />
    <Property name="ScaleZ" value="1" />
  </Property>
  <Property name="Attributes">
    <Property value="TkSceneNodeAttributeData.xml">
      <Property name="Name" value="GEOMETRY" />
      <Property name="AltID" value="" />
      <Property name="Value" value="CUSTOMMODELS\CONSTRUCTSPAWNER\CONSPAWNERX.GEOMETRY.MBIN" />
    </Property>
    <Property value="TkSceneNodeAttributeData.xml">
      <Property name="Name" value="NUMLODS" />
      <Property name="AltID" value="" />
      <Property name="Value" value="1" />
    </Property>
  </Property>
  <Property name="Children">
    <Property value="TkSceneNodeData.xml">
      <Property name="Name" value="_PICK_0" />
      <Property name="Type" value="REFERENCE" />
      <Property name="Transform" value="TkTransformData.xml">
        <Property name="TransX" value="0" />
        <Property name="TransY" value="0" />
        <Property name="TransZ" value="0" />
        <Property name="RotX" value="0" />
        <Property name="RotY" value="0" />
        <Property name="RotZ" value="0" />
        <Property name="ScaleX" value="1" />
        <Property name="ScaleY" value="1" />
        <Property name="ScaleZ" value="1" />
      </Property>
      <Property name="Attributes">
        <Property value="TkSceneNodeAttributeData.xml">
          <Property name="Name" value="SCENEGRAPH" />
          <Property name="AltID" value="" />
          <Property name="Value" value="CUSTOMMODELS\CONSTRUCTSPAWNER\NONPROCS.SCENE.MBIN" />
        </Property>
      </Property>
      <Property name="Children" />
    </Property>
    <Property value="TkSceneNodeData.xml">
      <Property name="Name" value="_PICK_1" />
      <Property name="Type" value="REFERENCE" />
      <Property name="Transform" value="TkTransformData.xml">
        <Property name="TransX" value="0" />
        <Property name="TransY" value="0" />
        <Property name="TransZ" value="0" />
        <Property name="RotX" value="0" />
        <Property name="RotY" value="0" />
        <Property name="RotZ" value="0" />
        <Property name="ScaleX" value="12" />
        <Property name="ScaleY" value="12" />
        <Property name="ScaleZ" value="12" />
      </Property>
      <Property name="Attributes">
        <Property value="TkSceneNodeAttributeData.xml">
          <Property name="Name" value="SCENEGRAPH" />
          <Property name="AltID" value="" />
          <Property name="Value" value="CUSTOMMODELS\CONSTRUCTFTPROCSPIRE\CONSTRUCTFTPROCSPIRE.SCENE.MBIN" />
        </Property>
      </Property>
      <Property name="Children" />
    </Property>
    <Property value="TkSceneNodeData.xml">
      <Property name="Name" value="_PICK_2" />
      <Property name="Type" value="REFERENCE" />
      <Property name="Transform" value="TkTransformData.xml">
        <Property name="TransX" value="0" />
        <Property name="TransY" value="0" />
        <Property name="TransZ" value="0" />
        <Property name="RotX" value="0" />
        <Property name="RotY" value="0" />
        <Property name="RotZ" value="0" />
        <Property name="ScaleX" value="1" />
        <Property name="ScaleY" value="1" />
        <Property name="ScaleZ" value="1" />
      </Property>
      <Property name="Attributes">
        <Property value="TkSceneNodeAttributeData.xml">
          <Property name="Name" value="SCENEGRAPH" />
          <Property name="AltID" value="" />
          <Property name="Value" value="MODELS/PLANETS/BIOMES/COMMON/BUILDINGS/LUNAR/LUNARPROC.SCENE.MBIN" />
        </Property>
      </Property>
      <Property name="Children" />
    </Property>
    <Property value="TkSceneNodeData.xml">
      <Property name="Name" value="_PICK_3" />
      <Property name="Type" value="REFERENCE" />
      <Property name="Transform" value="TkTransformData.xml">
        <Property name="TransX" value="0" />
        <Property name="TransY" value="0" />
        <Property name="TransZ" value="0" />
        <Property name="RotX" value="0" />
        <Property name="RotY" value="0" />
        <Property name="RotZ" value="0" />
        <Property name="ScaleX" value="1" />
        <Property name="ScaleY" value="1" />
        <Property name="ScaleZ" value="1" />
      </Property>
      <Property name="Attributes">
        <Property value="TkSceneNodeAttributeData.xml">
          <Property name="Name" value="SCENEGRAPH" />
          <Property name="AltID" value="" />
          <Property name="Value" value="METADATA/SIMULATION/SOLARSYSTEM/BIOMES/RAYROD/OBJECTS/E3BUILDINGS/E3BUILDINGS.SCENE.MBIN" />
        </Property>
      </Property>
      <Property name="Children" />
    </Property>
    <Property value="TkSceneNodeData.xml">
      <Property name="Name" value="_PICK_4" />
      <Property name="Type" value="REFERENCE" />
      <Property name="Transform" value="TkTransformData.xml">
        <Property name="TransX" value="0" />
        <Property name="TransY" value="0" />
        <Property name="TransZ" value="0" />
        <Property name="RotX" value="0" />
        <Property name="RotY" value="0" />
        <Property name="RotZ" value="0" />
        <Property name="ScaleX" value="1" />
        <Property name="ScaleY" value="1" />
        <Property name="ScaleZ" value="1" />
      </Property>
      <Property name="Attributes">
        <Property value="TkSceneNodeAttributeData.xml">
          <Property name="Name" value="SCENEGRAPH" />
          <Property name="AltID" value="" />
          <Property name="Value" value="MODELS/PLANETS/SNOW/WRECKS/GIANTWRECKEDSHIP.SCENE.MBIN" />
        </Property>
      </Property>
      <Property name="Children" />
    </Property>
  </Property>
</Data>

Step Three Edit

Make the Descriptor File.  Name it MOD1-MOD2_Spawner.DESCRIPTOR.exml.  Again, this includes slots for 5 "picks" feel free to add or delete as necessary.

You can change the "Chance" section if you'd like some models to be more prevalent than others.

There's more information on Descriptor Files available on the NMS Modding Wiki here: http://nmsmodding.wikia.com/wiki/DESCRIPTOR_Files

<Data template="TkModelDescriptorList">
  <Property name="List">
    <Property value="TkResourceDescriptorList.xml">
      <Property name="TypeId" value="PICK" />
      <Property name="Descriptors">
        <Property value="TkResourceDescriptorData.xml">
          <Property name="Id" value="_PICK_0" />
          <Property name="Name" value="_PICK_0" />
          <Property name="ReferencePaths">
            <Property value="NMSString0x80.xml">
              <Property name="Value" value="CUSTOMMODELS\CONSTRUCTSPAWNER\NONPROCS.SCENE.MBIN" />
            </Property>
          </Property>
          <Property name="Chance" value="0" />
          <Property name="Children" />
        </Property>
        <Property value="TkResourceDescriptorData.xml">
          <Property name="Id" value="_PICK_1" />
          <Property name="Name" value="_PICK_1" />
          <Property name="ReferencePaths">
            <Property value="NMSString0x80.xml">
              <Property name="Value" value="CUSTOMMODELS\CONSTRUCTFTPROCSPIRE\CONSTRUCTFTPROCSPIRE.SCENE.MBIN" />
            </Property>
          </Property>
          <Property name="Chance" value="0" />
          <Property name="Children" />
        </Property>
        <Property value="TkResourceDescriptorData.xml">
          <Property name="Id" value="_PICK_2" />
          <Property name="Name" value="_PICK_2" />
          <Property name="ReferencePaths">
            <Property value="NMSString0x80.xml">
              <Property name="Value" value="MODELS/PLANETS/BIOMES/COMMON/BUILDINGS/LUNAR/LUNARPROC.SCENE.MBIN" />
            </Property>
          </Property>
          <Property name="Chance" value="0" />
          <Property name="Children" />
        </Property>
        <Property value="TkResourceDescriptorData.xml">
          <Property name="Id" value="_PICK_3" />
          <Property name="Name" value="_PICK_3" />
          <Property name="ReferencePaths">
            <Property value="NMSString0x80.xml">
              <Property name="Value" value="METADATA/SIMULATION/SOLARSYSTEM/BIOMES/RAYROD/OBJECTS/E3BUILDINGS/E3BUILDINGS.SCENE.MBIN" />
            </Property>
          </Property>
          <Property name="Chance" value="0" />
          <Property name="Children" />
        </Property>
        <Property value="TkResourceDescriptorData.xml">
          <Property name="Id" value="_PICK_4" />
          <Property name="Name" value="_PICK_4" />
          <Property name="ReferencePaths">
            <Property value="NMSString0x80.xml">
              <Property name="Value" value="MODELS/PLANETS/SNOW/WRECKS/GIANTWRECKEDSHIP.SCENE.MBIN" />
            </Property>
          </Property>
          <Property name="Chance" value="0" />
          <Property name="Children" />
        </Property>
      </Property>
    </Property>
  </Property>
</Data>

Step Four Edit

Turn everything into an MBIN, pak it up with a filename that will put it at the bottom of the load order (zzzYouModNameHere.pak) and enjoy your success!