Spaceflight Simulator Wiki
Spaceflight Simulator Wiki
Advertisement

Custom Parts (or Part Packs) are a type of game mod that add a new part created by the author. Part packs and other mods can be downloaded by one and installed into one's game to modify a specific aspect of the game for user quality of life or novelty.

Do note that custom parts, and all other mods (texture packs, etc.) require the Steam/PC release to work.
Questions may be asked in the Comments section of this article or the Modding Channel in the Official SFS Discord.

Resources/Dependencies[]

Custom Part packs require the following to be downloaded and installed on one's computer or PC. These are the requirements for Windows 10/11 computers, other operating systems have been ignored.

Installation and Set Up[]

Follow these steps to ensure you have done the process correctly.

Unity and Unity Hub Setup[]

  1. Install the Unity Hub program by clicking on the execute file.
  2. Make an account for it and add a free license.
  3. To make/add the license, open the Unity Hub and log in.
  4. In the top left corner of the Unity Hub and click on Manage Licenses.
  5. Click on Add and select Get a free personal license and agree to it.
  1. Set up Unity 2021.3.11 with the set up program.
  2. Extract the SFS Modding Toolkit from its .zip file.
  3. Open Unity Hub and click on Add at the top right corner of the Unity Hub window.
  4. Open it in Unity and wait for it to load.
  1. When Unity opens, click on Assets on the top menu bar.
  2. Click on Import Package and click on Custom Package.
  3. Find the Odin Inspector product or trial that you downloaded and open it.
  4. Wait for it to load and agree to the EULA if you purchased Odin Inspector.
  5. Close out of the product tutorial windows.

GitHub Setup[]

See here.

Image Source: Picospace Discord Server.

Glossary[]

This article uses several new words that you may not know. The following list gives a simple definition of each word.

  1. Prefab - Any custom part that you make. They will usually look like blue cubes viewed at an angle or show their contents when viewed in the menu.
  2. Part - Any component that can be interacted with and used to create a rocket, craft or structure.
  3. Path - Any set of folders you must click on to get to a specific folder or location. They are marked in this article with italics and > symbols, symbolizing the next step needed.
  4. Hierarchy - The hierarchy is the list of components that make up a custom part. The hierarchy is located on the left side of the screen.
  5. Child - A child is any element under another element in the hierarchy.
  6. Parent - A parent is any element above another element in the hierarchy.
  7. Modloader - The tab and space in the SFS main menu screen that allows mods to be toggled on and off.
  8. Unity - The mod creation program that is version 2021.3.11.
  9. Unity Hub - This is where you Unity project lives.
  10. Odin Inspector - This program creates Unity's user friendly UI that you use to create your parts.

Rules of Thumb[]

Anecdotal advice from modders with past experience.

  • To allow parts to attach to one another, check the Attachment Surfaces box in the Custom Pipe (Script) module.
  • If you are making a part in your pack that is a duplicate of another commonly recreated part, add a distinguishing feature to the prefab name so that mod conflicts do not happen.

Creating a Simple Decorative Part From Scratch[]

This is how you can create a simple decorative part from scratch. This section was sourced from 105Code's amazing tutorial about making a custom part.

For more complex parts such as engines, please see the more detailed, appropriate sections below.

  1. Right click the screen and make a new folder. You may name this folder what every you would like. This is where all your future custom parts should go.
  2. Open the folder, right click and create a prefab. Name this prefab whatever you would like.
  3. Once you are done, double click the prefab to enter the editing screen.
  4. You must head over to the "Add Components" button and type in to add the following:
    1. Variables Module (allows one to store variables e.g. fuel, mass, etc.)
    2. Orientation Module (rotation of items in-game)
    3. Part Components or Part (Script) (this is the description, display name, mass, CoM, etc.)
  5. In the Parts (Script), input your part's display name and description. The prefab file name will be the code name for your part.
  6. In the Variables section of the Part (Script), add a variant and add a tag. Then choose a part category for your part to go in.
  7. Go all the way to the top of the screen, near your part's name (not the display name) and click on the Layers button. Choose 8: Parts.
  8. Exit the part and click on the part again. It should highlight it blue. Go to the bottom of the screen and click on AssetBundle. Create an AssetBundle name.
  9. Add a category. To do this move to the Parts (Script) module and find the Variants section. Click the plus sign next to it. It will add another Variants tier. Click the plus sign on this one. When an item drops down, find Tags and click on the plus sign next to it. When the next tier drops down, click on the input bar next to the word Tag. Select a part category. Confused? Click this. The Priority is the order that the part comes in. It is ordered greatest to least. Select 0 for no preference.
  10. On the top, far left hand side of the screen, find the prefab in the Hierarchy and right click it. Create an Empty. Name this GameObject something. Then move to the far right of the screen. It should look like the menu you originally started out with. Add the following components:
    1. Simple Pipe (Script) (adds the variables visible when blueprint editing, controls colliders and important things like Base Depth)
    2. Pipe Mesh (Script) (Your part's texture and color)
    3. Base Mesh (Mesh Filter)
    4. Mesh Renderer
    5. Polygon Collider (Script) (Controls the part colliders)
  11. In the Polygon Collider put the Simple Pipe (Script) into the input bar that says Polygon. Select an Impact Tolerance or the velocity needed to break the part. Low is below ~5 m/s, Medium is below ~15 m/s, High is greater than ~15m/s and less than ~45 m/s and Wheel is the impact tolerance of a wheel, about 45 m/s. If you want a part to have different collision tolerance, uncheck the physics collider in parts module and use Collider Module and select appropriate tolerance.
  12. In the Simple Pipe change the value in the Width_a to 1, in Width_b change it to 1, in Height_a keep it at 0 and in Height_b change it to 1.
  13. In the Pipe Mesh chose a color texture and a shape texture. In the Pipe Data input bar, drag your Simple Pipe into it.
  14. Your part should appear on screen. (if you followed correctly)
  15. Right click the large grey menu area near your part's prefab. Hover over Create and press Pack Data at the top of the selection. Name the Pack Data.
  16. Into the Pack Data input your pack's display name (what it will be called in the Modloader), the version of your pack (if its the first version put v1.0.0), the description (explain what your pack is and what it includes here) and the author (your personal pseudonym or nickname should work). Select Show Icon if you plan of adding an icon to your pack. If you chose that, click the grey frame and choose an image. Scroll down to the I's and find the default icon images.
  17. Head all the way up to the top menu and press on SFS. Click Build Pack then a window should appear.
  18. Fill in the Output File Name (what the .pack file will be called). Drag the Pack Data into the input bar below the Output File Name bar and above the Display Name bar. The rest of the bars should be filled in when you add the Pack Data. Select the correct AssetBundle and select Windows and MacOS to build. Then press Build Mod.
  19. Once the file explorer window appears, press the Cancel button.
  20. Click on the large grey area near your part's prefab and the Pack Data and right click it. Select Show in Explorer. Once the window opens, navigate the following path Assets>ModBuilder. Your pack will be inside the ModBuilder folder.
  21. Select the pack that has the .pack file type. If it has .pack in the file name then do not load it into the game.
  22. Drag the pack into your Parts folder and restart Spaceflight Simulator.
  23. Once the game opens, make sure there isn't an error. If there is, restart the process or try to troubleshoot the issue with Odin's error detection system (visible as the red triangles at the bottom left hand corner of the editor screen). If there is no error, continue to the Modloader and activate your mod. If its already activated, go to the world you want to test your mod on.
  24. Find your custom part in the part category you put it in and play around. If it breaks, go to the error codes section of this article or attempt to resolve the problem yourself or with assistance from other modders.

Creating a Custom Engine[]

Tools
Tools
Work in progress
This page is under construction, and some information is currently not present.
You can contribute by expanding it.

It is highly recommended to use a stock engine then modify it to suit your needs. This saves tons of time. Note: This section is not done yet. To avoid confusion, do not follow the steps written.

  1. Create a new folder in the Resources folder. This is where your custom engine will reside.
  2. Click on the Engines folder or follow the path Resources>Parts>Engines.
  3. Find the engine prefab you want to use as a starting guide by clicking on it and exiting it. The prefab should turn blue, then use ctrl+c and ctrl+v to copy/paste the engine into your new folder.
  4. Make sure that you did not take the original engine and instead took a duplicate of it.
  5. Modify the engine prefab's name by right clicking it and selecting Rename. Click the grey area when you are done. This name will be the file name of the prefab and the name you will see when blueprint editing.
  6. Head to the right side of the screen.
  7. In the top righthand corner of the screen, change the engine's display name (e.g. from Hawk Engine to Tutorial Engine) and its description.
  8. In the Variables Module you can check or uncheck whether you want the engine to be automatically on, if it has heat or if the engine has any gimbal.
  9. In the Flow Module you can change what resource it uses and what percent it uses it at.
  10. In the Engine Module you can change the thrust, efficiency (Isp), gimbal and heat.
  11. In the Audio Module you can change the sound the engine makes when it is turn on as well as the sound's pitch, whether is plays when the engine is started and whether it loops or not.
  12. The Move Module can be used for many things, mainly animating and creating extendible nozzle extensions. The animation time can also be changed. A section dedicated to the specific module is coming soon.
  13. The Magnet Module is used for creating the blue part snap features that help bring two parts together. Modify the x and y coordinates to put the part snap in a different place.

Manipulating the Engine[]

Tools
Tools
Work in progress
This page is under construction, and some information is currently not present.
You can contribute by expanding it.

To change the looks of an engine you can follow the following numbered list. Note: This section is not done yet. To avoid confusion, do not follow the steps written.

  1. Three components of an engine exist. The base, nozzle and pipes. The base is the part of the engine that attaches to the fuel tank and is usually stationary when the engine is gimballed. The nozzle is where the thrust vector emerges from. The plume and heatbox are also located in the nozzle. The pipes are decorative, redundant parts of the engine that are any components that do not have a purpose.
  2. When clicking a component, the right side will contain nearly everything that will help modify each part of the engine. The plume and heatbox get their own sections.
  3. In Transform you will find the position, rotation and scale factors. Make the x position negative to move the component to the left and make it positive to move it to the right. Keep at zero to keep centered. Make the y position negative to move the component down and make it positive to keep centered. The z position is irrelevant. To change the rotation, change the z value. Positive to rotate toward the right and negative to rotate toward the left. Increase the x scale to widen the component and increase the y scale to lengthen the component and vice versa. The z value is irrelevant, but its recommended to keep it at 0.
  4. In the Custom Pipe (Script) one will find a series of check boxes near the top of the module. These checkboxes are not commonly used but it is recommended to check all the boxes besides the attachment surfaces box unless you plan to add the Magnet Module. Below these is the Base Dept input box. When one wants a component to appear "above" another component, increase the base depth to put it in the foreground. When one wants the component to appear "behind" another component, decrease the base depth to put the component in the background. Below the base depth are the points. These are all the points and vertices that make up the component since all components are 2D polygons. These points also make up the component's collider or hitbox. Below the points is the grid size which modifies how small each snap position is. Ideally set this number to 0.01 if you are looking for precise movement,
  5. In the Pipe Mesh will be the color of the part. Once can apply a default color and shape texture by clicking on the color and shape texture drop-down menus. A custom color can be chosen by clicking on the bottom option in the script called Color. When the input bar is clicked, the same color wheel and bar will appear similar to the one discussed in the section below.

Plumes[]

The plume is oftentimes the most striking part of an engine, and also oftentimes the most broken and misunderstood part of engine creation. Watch this video and this video all by Picospace for other tutorials/guides besides this one.

  1. Click on the part of the plume you want to edit and right click it. In the dropdown menu, select Toggle Active State to turn on the plume.
  2. To the right will be that part of the plume.
  3. In Transform one will find the position, rotation and scale factors. Make the x position negative to move the component to the left and make it positive to move it to the right. Keep at zero to keep centered. Make the y position negative to move the component down and make it positive to keep centered. The z position is irrelevant. To change the rotation, change the z value. Positive to rotate toward the right and negative to rotate toward the left. Increase the x scale to widen the component and increase the y scale to lengthen the component and vice versa. The z value is irrelevant, but its recommended to keep it at 0.
  4. In the Sprite Renderer is what one can use to edit shape of the plume. These are known as the Sprites. They can be changed from RCS_Exhaust_0 which is a RCS plume, Engine_Exhaust_0 to 2, Engine_Exhaust_Half and Exhaust Sharp_0 to 2. Choose a different sprite to get different effects. For example, the RCS_Exhaust_0 sprite can be good for replicating turbulence in your engine plume.
  5. In the Color section of the Sprite Renderer one can change the color, opacity, intensity and saturation of the engine plume. Turn the color wheel to choose a different color and move the dot in the shade square to get different shades of that color. Move the R, G, and B sliders to add or subtract red, green or blue respectively. Move the A slider to change the opacity ranging from transparent to opaque. Click the Hexadecimal input bar to type in your own color in hex code form. Click the grey dropdown menu below the color wheel to select a different color model such as HSV.
  6. To animate your plume, add the Flame Randomizer which will move your plume up, down, left and right how many meters you put into it via the x and y values.
  7. Before building your pack, go to the Flame Holder which should be above your plume components in the hierarchy. Click on the Move Module and in the Animation Elements section, click the plus mark and choose the element type to be Sprite Color then drag your plume from the hierarchy into the Sprite Renderer input bar. Click on the Gradient bar and head to the large color rectangle. On the top are two black and grey pointers. Drag the black pointer to the far left of the rectangle and drag the grey pointer to the far right of the rectangle. One can also click on the pointer and in the Position input bar, input a percent value. 0% is far left, transparent and 100% is far right, opaque. Click on the black rectangle and drag the alpha slider to as transparent as needed. Click on the grey slider and change the alpha to as opaque as one may want.
  8. On the bottom of the color rectangle there are two sliders. Change both sliders to the color of your plume component and slide both to the far left and right sides of the rectangle. To change the color of the pointers, click on then or click on the small color rectangles below the pointers and next to the Location input bar. Copy/paste your plume component's hex code into the Hexadecimal input bar.
  9. Repeat step number 8 for every one of your plume's components.
  10. Right click on the Flame component in the hierarchy and click on the Toggle Active State option near the bottom of the dropdown menu. This prevents your engine plume from being on when in the build screen or when not on.

Engine Heat[]

The engine's heatbox (or heat hitbox) is an area at the base of the nozzle in which an object comes into contact with it, the part in contact will be heated until it melts and is destroyed. The heatbox can be edited in the Heat Hitbox component in the hierarchy. This video by Picospace also covers engine heatboxes.

  1. Click on the Heat Holder component in the hierarchy and toggle it by right clicking and selecting Toggle Active State. This will show a green outline that is the heatbox of the engine.
  2. In Transform you will find the position, rotation and scale factors. Make the x position negative to move the heatbox to the left and make it positive to move it to the right. Keep at zero to keep centered. Make the y position negative to move the heatbox down and make it positive to keep centered. The z position is irrelevant. To change the rotation, change the z value. Positive to rotate toward the right and negative to rotate toward the left. Increase the x scale to widen the heatbox and increase the y scale to lengthen the heatbox and vice versa. The z value is irrelevant, but its recommended to keep it at 0.
  3. Moving the green borders of the heatbox can also increase or decrease the size and width of the heatbox.
  4. Move the heatbox down, away from the engine bell a small distance to make sure that it doesn't burn the engine when activated.
  5. When done modifying the heatbox, right click the Heat Holder again and select Toggle Active State. This will prevent the engine from burning things before the engine is activated.

The Modules[]

Tools
Tools
Work in progress
This page is under construction, and some information is currently not present.
You can contribute by expanding it.

This section covers the main modules that one may encounter when modding. Note: each list of the functions of the modules are in order from top to bottom of the module.

The transform is a very simple module that dictates the location of any element in the hierarchy. Changing the x, y and z coordinates for each value changes the element's location in that manner.

The Part (Script) contains the bare bones of the custom part and includes the display name (name displayed in the build screen), part description (description that is under the part stats), mass, location of the center of mass and part category (under Variants>Variants>Tags). All of these values (in exception of the center of mass location, orientation, variables module and part data) should be filled in.

The orientation module should be kept as is.

The variables module adds certain variables to a part (for example engine_on). For engines, the throttle variable should not be checked in the save column and its value should be set to 0. The engine_on, heat_on_for_creative_use, and gimbal_on should all be checked off in the save column and heat_on_for_creative_use, and gimbal_on should be checked off in the value column. Custom variables can be added, though this is not discussed in the tutorial and will not be covered.

The Simple Pipe (Script) is a module that allows one to toggle on and off whether the part has attachment points, drag surfaces, a build collider (prevents clipping), physics collider (collisions and friction) and whether or not the part can be clicked and highlighted in the build screen. The base depth allows a part to appear in front of or behind another element, which can be very useful when making a complex engine. The depth multiplier adds depth to an element.

The Pipe Mesh (Script) dictates the color texture and shape texture of a part. Custom colors can also be chosen from the Color input bar. More importantly, this module has the Generate Mesh button to reload the part mesh after one modifies it.

The skin module is mostly irrelevant to this discussion but does allow the display names of the default part textures (while blueprint editing) to be changes. By default these are set to simple underscores.

The magnet module is used for creating the blue part snap features that help bring two parts together. Modify the x and y coordinates to put the part snap in a different place.

The adapt module and adapt trigger module should be kept as is.

The resource module shows what resource type is stored in the part. Wet mass and Dry mass percent control the wet mass of the part and the dry mass of the part respectively. Resource percent controls the percentage of resource stored in the part (1 is 100% and 0 is 0%). Check Show description to show values in the build screen [checked by default].

The Polygon Collider (Script) is a module that allows one to change a parts impact tolerance. The tolerance can be changed from Low to the highest, Wheel. The other values are mostly irrelevant to this discussion and to avoid confusion will not be covered.

The mass module is a module that allows a resource density to be set, though this does not really work in practice. Keep this module as is.

The Custom Surfaces (Script) is a module allows attachment points and drag surfaces to be added. This module should be kept as is.

The flow module allows you to select the type of the fuel (Liquid_Fuel is default), the Flow Percent is essentially the multiplier coefficient of how much fuel should be consumed when accounted with isp and thrust [Default is 1], Source Search Module tells us where the game should look to find an appropriate source for the fuel type [Surface is Default], The Surface section (Under Source Search Module) tells us what surface needs to attach to appropriate source so engine can be used [The Engine Prefab that you are currently using is the default value], and flow type dictates whether to drain or fill the engine with the appropriate fuel source [Default value is negative as engines use fuel].

The engine module contains the thrust values in tons, the position of the normal of the thrust, the isp of the engine, the position of the thrust, the source of the thrust, the gimbal toggle, the source of gimballing, whether the engine is on or off when first placed in build menu [not ticked by default], the output value of thrust [0 is default as engine should be set to off by default], whether heat damage due to the engine is on and what child the heat holder hitbox is. Set old mass to the mass of the engine you had set in the Part module.

The torque module allows the engine to apply a force such that it rotates a rocket. Torque Enabled just tells us of engine has the ability to apply a rotational force [gimbal_on with it being ticked is default]. Torque tells us the amount of force in kN that the engine applies [Set it to a value of your choice multiplied by throttle so your torque force can change with thrust level] and show description just shows us the description of torque as it is not ticked by default.

The audio module allows a sound effect to be chosen and how its volume in-game is set. The pitch should be set to 1, unless you want the part to sound like an Eldritch horror. Play on start shows that the sound will begin as soon the physics mode loads. This should be unchecked. Loop allows the part sound to loop forever as long as the part is in an active state,

The flame randomizer is a module that randomizes the movement of the parts in an engine plume. The x and y values indicate the min/max movement of the plume elements. Add this module directly to the plume element of to a parent plume element.

The Mesh Renderer, Base Mesh (Mesh Filter) and Pipe Surface (Script) should be kept as is since they control some important stuff that should not really be altered.

Move Module[]

Tools
Tools
Work in progress
This page is under construction, and some information is currently not present.
You can contribute by expanding it.

The move module allows for parts to be transformed. Rotation Z allows for the parts to be rotated "parallel" to the camera (Imagine someone was waving their hand at you). Scale allows you to transform the size of an object in both X and Y dimensions.

To be added to move module: Position . Centre Of Mass .Centre Of Drag . Sprite Colour . Image Colour . Active . Inactive . Sound Volume . Anchored . Position . Rotation XY . Float Variable . Bool Variable .

Diagnosing Error Codes[]

As a general rule of thumb, check each prefab before building the mod to prevent extra headaches. Odin Inspector's built in bug finder (Validator) can also help detect bugs. Using SFS's F1 menu is also a very effective way of determining an issue.

Odin Inspector is not fool proof and occasions where it fails to detect something missing it could be in the: Skin Module, the Mesh in the Base Mesh being empty (unless child of that pipe/polygon is grayed out or inactive) or the Fragments section in Split Module.

Object Reference Not Set to an Instance of an Object[]

If you load SFS with your mod and the "Object Reference Not Set to an Instance of an Object" error appears, it means that you have left something blank in a script in a prefab. (e.g. You forgot to add the engine plumes to the Flame Holder move module), which meant that value in the Transform is blank. Sometimes this error can also appear out of thin air, with no apparent mistake or human error in sight. This is often very frustrating for new modders.

Index was Out of the Bounds of the Array[]

If you get the "Index was Out of the Bounds of the Array" error it is to do with the part priority of the prefab in game. This is a more rare message than the above and the "best" way is to try having a non negative part priority value.

Stack Overflow[]

If you get a "Stack Overflow" error in Unity, it is most likely to do with a pipe/polygon (simple or custom) having a weird UV value (UV is the x and y coordinate of a point). The best thing is to try pressing ctrl+z to try revert to the step that caused it. If Unity freezes or if it is stuck in a loop, restart the program and try the above step. If it still doesn't work, then you may have to delete the pipe/polygon module causing the issue and make a blank one.

Triangles Failed To Set[]

If you get a "Triangles Failed To Set" error in Unity, it is due to do with a pipe/polygon (simple or custom) having a UV value such that your triangles array has an integer that is greater than or equal to mesh*vertices*length.[1] The best thing to do is every time you create a new point, press the Generate Mesh button. If it causes the above error, right click on the point that created the error and delete that point. This is also a rare error in Unity. If it still doesn't work, then you may have to delete the pipe/polygon module causing the issue and make a blank one. Also make sure that the Transform of the child that the pipe/polygon module and all of the "parents" (aka above child) have 0 x, y and z rotation and 1 for x, y and z scale (if parts in game after you have pressed launch appear weird, try making z scale 0 if you are also using xy rotation)

Adding MacOS/Windows Compatibility[]

To add MacOS or Windows compatibility to your mod follow the following steps. The following section was sourced from Dahzito's Custom Part Tutorial which itself is based off of this tutorial.

  1. Load the Unity Hub.
  2. When loaded, click on the Installs tab on the left hand side.
  3. In the Installs tab, select the All tab (should be opened automatically).
  4. Find 2021.3.11f1 and click on the small cog.
  5. Select Add modules.
  6. Add Mac Build Support (Mono) for Mac support and add Universal Windows Platform Build Support for Windows support.
  7. Restart Unity and Unity Hub to enable the modules.

Importing Custom Modules[]

Custom modules may be made and added to the default to add features otherwise unsupported by the SFS Modding Toolkit. To add a custom module, follow the following steps. Warning: Consider backing-up your Unity assets before importing custom modules as they can easily break your Unity. This can be done by copying all of your assets and putting them in a separate folder.

  1. Download the custom modules.
  2. Unzip them.
  3. Open Unity.
  4. Head to Assets on the top menu.
  5. Click on Import New Asset.
  6. Import the unzipped modules.
  7. They should appear in the Assets folder on the very left slide menu.
  8. Find the Scripts folder and click on it.
  9. Click on the Parts folder.
  10. There will be multiple folders arrange from Color to VFX.
  11. Take your imported modules and place them in the correct folder. Warning: Use trial and error to find the correct placement.
  12. Restart Unity.
  13. Test the imported modules by heading to an asset and adding the module. If it doesn't load then repeat step 11.
  14. Your custom module should be functional now.

As per custom module creation, I am not aware of that currently. It requires C# knowledge and Visual Studio.

Video Guides, Servers, etc[]

A concise list of all video guides and tutorials mentioned in this article. The list also mentions several Discord servers that may have helpful members to aid you.

Basic Modding[]

  1. A playlist by 105code. Covers basic modding and custom part creation.
  2. A video by Picospace. Covers the same topic as the above.

Engines[]

  1. A livestream by Picospace. Covers how one can make a custom engine.
  2. A video by Picospace. Covers heatboxes.
  3. A video by Picospace. Covers engine plumes.
  4. A livestream by Picospace. Covers plumes as well.

Servers[]

  1. SFS Discord Server. Also tons of modders, great place to announce mods to the community.
  2. SFS Forum. Not a server but this is where you can post your mod to the public. Tons of people to help.

Bibliography[]

Advertisement