Skip to content

Instantly share code, notes, and snippets.

@fre-sch
Last active April 10, 2024 14:25
Show Gist options
  • Save fre-sch/ea74bc201be01c8e656991baacfc9702 to your computer and use it in GitHub Desktop.
Save fre-sch/ea74bc201be01c8e656991baacfc9702 to your computer and use it in GitHub Desktop.
Starfield guide for creating new ship parts.

Adding New ship part to Starfield using xEdit

Tools

To edit ESM files you need compatible xEdit build. That means version 1.4.4r or later (October 2023). Do NOT use versions 1.4.4c or older.

After downloading extract the ZIP file, then rename the EXE file "xEdit64.exe" to "SF1xEdit64.exe". 64-bit version is recommended, and to work on Starfield files executable needs to start with "SF1".

Double click the "SF1xEdit64.exe" then let it work on first run to index the data, this will take 10 minutes or little bit more. It will let you know in the bottom status bar when it's done. Following starts will take 10-40 seconds.

ESM - Preparation

  • Start by choosing an existing ship part available in the game that is similar to the desired new part, like an existing engine, hab, docker, structural, etc.

  • In the left pane expand [00] Starfield.esm tree then go into Constructible Object (COBJ), and sort by middle column, then scroll to co_SM*

  • Locate the base record for this selected ship part, these are usually named in the pattern co_SMS_<Category>_<Manufacturer>_<PartName>, for example co_SMS_Struct_Deimos_Hull_A [COBJ:0022D0FE].

  • In the left panel of xEdit, right-click on the row of your selected record, and use "Copy as override into ..." and create an override in your ESM. This will become a real copy later.

  • Using "Copy as override into ..." for the first time will pop up a warning that "You are about to edit a module file.", if you're sure, answer by clicking "Yes I'm absolutely sure"

  • You will be asked to create new file, so put a checkmark into the box next to <new file>.esm and click OK, give it a descriptive name like "Struct_Tutorial_NewPart", and select OK again. You will see the right pane changing to showing two sets of data side by side, left one is original [00]Starfield.esm and the right one is your new file eg. [02]Struct_Tutorial_NewPart.esm

  • In the right panel of xEdit, locate the CNAME data (row header CNAM - Created Object), and jump to the CNAME linked object by holding CTRL and Left-Clicking the CNAME value, this is either going to be a FormID List (FLST) or a Generic Base Form (GBFM), you will see that in the top text box that shows path of the record, eg. [00] Starfield.esm (DC45FBDF) \ Generic Base Form \ 0022D126 <SMS_Struct_Deimos_Hull_A> so if you see "Generic Base Form" as part of path you will be sure you are in the right place. Ideally you should base your first part on a COBJ that links to only a GBFM. As an example, for co_SMS_Struct_Deimos_Hull_A [COBJ:0022D0FE] the link is SMS_Struct_Deimos_Hull_A [GBFM:0022D126]

  • Now with a GBFM selected in the left panel, right-Click it and again choose "Copy as override into ..." and create an override in your existing ESM by placing checkmark next to your ESM file name and pressing OK. This too will become a real copy later.

  • Within the GBFM data in the right panel, follow this object path and locate the Pack-in. Components \ Component \ Component Data - Form Links \ Linked Forms \ Linked Form \ FLFM - Linked Form. Keep in mind your part has multiple components, you need to find one that contains FLFM - Linked Form row. Now use CTRL Left-Click again to jump to the Pack-in (PKIN). In the example, this would be ShipPI_SMOD_Struct_Deimos_Hull_A [PKIN:00232930]. Again you can check in the path textbox at top that your path includes Pack-In and you're in a good place.

  • As of xEdit 4.1.5 RC1, Pack-ins cannot be overriden, so here you will use "Copy as new record into ..." to copy this into your ESM. Again, right click the record in the left panel, then pick "Copy as new record into ...". You will have to provide a new name for this pack-in at this point. Let's keep with the naming pattern of ShipPI_SMOD_<Category>_<Manufacturer>_<PartName> and name this new part for example ShipPI_SMOD_Struct_Tutorial_NewPart. After giving it new name, press OK, and again place checkmark next to your ESM file and confirm with OK.

  • Next in the Pack-in data in the right panel, CTRL Left-Click the CNAM linked CELL, row header CNAM - Cell. For the example, this would be PackInShipPISMODStructDeimosHullAStorageCell [CELL:0023297B].

  • Now in the left panel, Right-Click row of the the selected CELL, and this time choose "Deep copy as override into ..." to create an override in your ESM. Deep copy must be used, as CELL is a nested data structure, and we need all its children. Again, select your ESM and confirm with OK to copy into it.

  • Continuing in the left panel, expand the CELL, and expand the Persistent or Temporary children. Look for any CELL child node that contains an MSTT and select it. Those will be listed in left panel as eg. Placed Object and in Name column it will start with SMOD_.... Make sure to expand "Name" column so you can see it all. Note that some parts can have multiple MSTT subrecords, but for now focus on the ones named like SMOD_ ... [MSTT: xxxxxxxx]. Then in the right panel, locate row with header "NAME - Base" and use CTRL Left-Click to go to this Moveable Static (MSTT) record. Example for the Deimos part cell is SMOD_Struct_Deimos_Hull_A [MSTT:002392E9].

  • Again you can check you're in the correct place as path text box will show "Moveable Static" as part of the path. Right-click the MSTT in the left panel and use "Copy as override into ..." to create yet another override in your ESM. Check your ESM file and confirm with OK.

  • Finally, look in the right panel of the MSTT data for the row "SNTP - Snap Template", and once again CTRL Left-Click this to locate the Snap Template (STMP). In the example, this is ShipSnap_SMOD_Generic_1x1x1_All01 [STMP:00059B01].

  • Right-click the selected STMP in the left panel, and once again use "Copy as override into ..." to create an override in your ESM. Again check your file and confirm with OK. And path should contain "Snap Template" in the text box at the top.

Congratulations, you have finished the first phase of preparing to create a new ship part!

Finalizing the part data

  • In the left panel, collapse the Starfield.esm tree. The next steps only involve working with your ESM. So expand your custom .esm in the tree, it should start with [02]...esm if this is the only ESM file being edited.

  • Locate the Constructible Object (COBJ), expand it, and select the override in the left panel in your ESM. Then in the right panel, locate "EDID - Editor ID" and set a new value in your override. I suggest using the same pattern as vanilla files co_SMS_<Category>_<Manufacturer>_<PartName>. For example change co_SMS_Struct_Deimos_Hull_A to co_SMS_Struct_Tutorial_NewPart. To edit, right click the value and pick "Edit", in the pop-up box change the name, and confirm by clicking OK.

  • Still in the data for the same COBJ override, locate the field SNAM - Menu Sort Order and set a new value. If this is not changed, it will not appear as new part, but instead replace an existing part. In the example, change it from 6.0 to 6.5 placing this new part just after the "Deimos Hull A Part". To enable editing either double-click or right-click and pick Edit, it will edit in-place.

  • Locate the Generic Base Form (GBFM) override in the left panel in your ESM, expand the tree and select the record. Then in the right panel, locate "EDID - Editor ID" and set a new value in your override. Again follow the pattern of names. For example let's rename SMS_Struct_Deimos_Hull_A to SMS_Struct_Tutorial_NewPart. To enable editing you need to right click and choose Edit in the right-click menu.

  • Still in the GBFM data, locate the value of this path GBFM \ Components \ Component \ Component Data - Fullname \ FULL - Name and change it. In this example change it to Tutorial New Part. To enable editing you need to right click and choose Edit in the right-click menu. This is later shown in the builder, and will help identify the new part made with this process.

  • While still having the GBFM override selected, edit and override the path: Components \ Component \ Component Data - Form Links \ Linked Forms \ Linked Form \ FLFM - Linked Form and point it to the Pack-in named ShipPI_SMOD_Struct_Tutorial_NewPart, by using the Pinning Button in the toolbar of the right panel. To do that, first select the "FLFM - Linked Form" row, then click the pin icon in the top left of the right panel (next to "Filter by Name"), then expand the "Pack-In" tree of your ESM in the left panel, and finally drag'n'drop your PKIN with EditorID ShipPI_SMOD_Struct_Tutorial_NewPart into the "FLFM - Linked Form" value field. You will see it change the value to that of your custom Pack-in. Click the Pinning Button again to unpin the right panel.

  • Locate the "Movable Static" (MSTT) override in the left panel in your ESM, expand it and select the record. In the right panel, locate "EDID - Editor ID" and set a new value in your override. For example, rename SMOD_Struct_Deimos_Hull_A to SMOD_Struct_Tutorial_NewPart. To enable editing you need to right click and choose Edit in the right-click menu.

  • Locate the "Snap Template" (STMP) override in the left panel in your ESM, expand it and select the record. In the right panel, locate "EDID - Editor ID" and set a new value in your override. For example, rename ShipSnap_SMOD_Generic_1x1x1_All01 to ShipSnap_SMOD_Struct_Tutorial_NewPart. To enable editing you need to right click and choose Edit in the right-click menu.

  • Finally select the "File Header" of your ESM in the left panel, then double-click and copy the value of "Next Object ID" in the right panel.

  • Now in the left panel, select the CELL override, the main one with a FormId (so NOT the Persistent/Temporary children!). Press F2 on the keyboard and in the prompt paste the value of "Next Object ID" you copied before. Replace the first three digits (eg $00) with the two digits 02 and confirm with OK. Another window will pop-up, make sure to check the boxes only for your new ESM! And confirm again with OK (twice).

  • In the left panel, expand all the children of the CELL, and multi-select them using SHIFT Left-Click. Press F2 on the keyboard, again new window will pop up, place a checkmark to select your ESM in the prompt and confirm with OK.

  • In the left panel with SHIFT Left-Click, multi-select your COBJ override, your GBFM override, your MSTT override and your STMP override and press F2, again selecting your ESM in the prompt and confirm.

Congratulations, now you have prepared the ESM data for a new ship part!

Final notes

At this point you can begin changing the NIF in MSTT, customizing the Snaps in the STMP, and editing names and values in your GBFM (like health, mac power, mass, and so on).

As of xEdit 4.1.5 RC1 this guide cannot be applied to any GBFM that contains REFL data, since its structure and use is unknown. Make sure to check the GBFM you want to use as base doesn't contain REFL data. You will have to select GBFM record, and in left pane look for row with header "REFL". If it's empty you're good!

This guide can also be used for ship parts with interiors, except then the GBFM links to two PKINs, each with their own CELL. Just follow the steps for copying PKIN and CELL, but each PKIN and each CELL linked in the GBFM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment