Our addons work this standard mods. Besides the About
and GameData
folders, we are proving our additional two folders that you can use to mod the game: Scripts
and Content
. Scripts folder is being used to hold all of the custom code and Content is designed to hold custom content i.e. asset bundles (more about that here).
To get basic addon with simple plugin, follow these steps:
- Make sure that you have Visual Studio 2019 installed with C# support. You can also install
Visual Studio Tools for Unity
, this will come in handy later, when you will want to debug your addon. Additionally it will be helpful, if you know how to make standard mods - read this. - Clone Stationeers.Addons repository using git or download it using Download button, open the resulting folder.
- Open Source/Stationeers.VS.props file, and edit the path, to where your game is installed.
- Copy ExampleMod from
Source/ExampleMods
intoSource/MyMods/
directory. - Rename copied directory to whatever name you want, let's keep it simple, and call it MyFirstAddon.
- Rename
ExampleMod.csproj
toMyFirstAddon.csproj
andExampleMod.csproj.user
toMyFirstAddon.csproj.user
. - Open
MyFirstAddon.csproj
file in your favorite text editor (not IDE!). - Change these two lines:
to
<RootNamespace>ExampleMod</RootNamespace> <AssemblyName>ExampleMod-Debug</AssemblyName>
<RootNamespace>MyFirstAddon</RootNamespace> <AssemblyName>MyFirstAddon-Debug</AssemblyName>
- Go back to the Source folder and open
Stationeers.Addons.sln
solution file. - Click RMB on "My Mods" folder in solution, select
Add > Existing Project...
, locate your addon C# project (MyFirstAddon.csproj). - Rename
ExampleMod.cs
toMyFirstAddon.cs
, as this will be your entry point. You should also change the namespace to. - To check if your addon is working, go to
C:\Users\%username%\Documents\My Games\Stationeers\
and openmods
folder (you can safely create it, if it's missing). Create folder named like your Addon and copyAbout
,Content
,GameData
andScripts
. And that's it. - At this point, you have the ability to start writing the code. Check MyFirstAddon.cs for ideas. Have fun.
- Useful links:
- Debugging addons
- Creating custom content (Coming soon)
- Overloading methods (Coming soon)
- Harmony documentation - Use it for patching the game's code at runtime.
- dnSpy - for browsing the game's source code.
By default, addons are only compiled once at start up. Starting the game with the --live-reload
option will enable a new shortcut, Ctrl+R
, to recompile and reload addons. You can add the option in the game's properties in Steam.
With live reload enabled, be mindful of the plugin lifecycle - not disposing a resource created by an addon in its Unload
method might lead to unexpected behaviours.
We are supporting workshop! Yes! It's as simple as publishing your mod (created in step 11 above) to the workshop!
But please, make sure that people know that it's an addon and not a standard mod by following these steps:
- If you have custom thumbnail - include the addon overlay.
- Add this text to the workshop description at the end:
This mod requires Stationeers.Addons, read how to install it here: https://github.com/Erdroy/Stationeers.Addons
And that is it :)
Note: After publishing your addon for the first time, you have to copy mods/MODNAME/About/About.xml
file back to your Visual Studio project (replace the file), as it now has WorkshopHandle
tag and it is needed to update the adddon later!
Stationeers.Addons is not affiliated with RocketWerkz. All trademarks and registered trademarks are the property of their respective owners.
Stationeers.Addons (c) 2018-2022 Damian 'Erdroy' Korczowski & Contributors