Skip to content

Commit

Permalink
docs: Mention marking Nautilus as a dependency (#493)
Browse files Browse the repository at this point in the history
* Mention Nautilus dependency for BepInEx

* Added a reference to the BepInEx docs
  • Loading branch information
Metious authored Oct 25, 2023
1 parent 6bd3362 commit 638fc00
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Nautilus/Documentation/guides/dev-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,10 @@ dotnet new bzmod -n MyBeautifulMod
```

Now you can add more code to the project, then build and put the compiled dll in SubnauticaZero/BepInEx/plugins/.
___

> [!NOTE]
> If you are using an empty template, please ensure that in your entry point class (the class that has a `[BepInPlugin]` attribute, usually called Plugin.cs) Nautilus is marked as a dependency if you use it.
> To add the dependency, simply add the `[BepInDependency("com.snmodding.nautilus")]` attribute at the top of your entry point class.
> You may find an example [here](https://github.com/SubnauticaModding/Nautilus/blob/master/Example%20mod/CustomPrefabExamples.cs#L11).
> For more information, visit the [BepInEx docs](https://docs.bepinex.dev/articles/dev_guide/plugin_tutorial/2_plugin_start.html#specifying-dependencies-on-other-plugins).
6 changes: 6 additions & 0 deletions Nautilus/Documentation/guides/simple-mod.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ MyAwesomeMod/Plugin.cs
more like `com.author.myawesomemod`. To do this, you must open up your project's csproj file (Right Click -> Edit Project File). Once it's open, add this tag to the
uppermost property group: `<BepInExPluginGuid>com.author.modname</BepInExPluginGuid>` and modify that to fit your mod.
> [!NOTE]
> Please ensure that in your entry point class (the class that has a `[BepInPlugin]` attribute, usually called Plugin.cs) Nautilus is marked as a dependency if you use it.
> To add the dependency, simply add the `[BepInDependency("com.snmodding.nautilus")]` attribute at the top of your entry point class.
> You may find an example [here](https://github.com/SubnauticaModding/Nautilus/blob/master/Example%20mod/CustomPrefabExamples.cs#L11).
> For more information, visit the [BepInEx docs](https://docs.bepinex.dev/articles/dev_guide/plugin_tutorial/2_plugin_start.html#specifying-dependencies-on-other-plugins).
This template contains the code of a functional knife that knock-backs enemies on strike. This knife can be found in the Modification station.
Now that we have the code for the knife, we will make our new custom mineral.

Expand Down
5 changes: 5 additions & 0 deletions Nautilus/Documentation/guides/sml2-to-nautilus.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ The root namespace for Nautilus is not the same as SMLHelper 2.0.
<span class="lang-diff-add">+ &lt;RootNamespace&gt;Nautilus&lt;/RootNamespace&gt;</span>
</pre>

## Referencing
In BepInEx, we no longer use a `mod.json` file to determine dependencies. Instead, this is done via the `[BepInDependency]` attribute.
You can mark Nautilus as a dependency to your mod by simply adding the `[BepInDependency("com.snmodding.nautilus")]` attribute at the top of your entry point class. [Example](https://github.com/SubnauticaModding/Nautilus/blob/master/Example%20mod/CustomPrefabExamples.cs#L11)

For more information on the new development setup, please visit our [Development Setup Guide](dev-setup.md).

## Handlers

Expand Down

0 comments on commit 638fc00

Please sign in to comment.