Jump to content
Toggle menu
  • 64 articles
  • 37 files
  • 9 users
  • 4.6K edits
Shroudforge
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Build your first mod: Difference between revisions

From Shroudforge
Create English ShroudForge Wiki article
 
Marked this version for translation
 
Line 13: Line 13:
<translate>
<translate>


<!--T:1-->
This beginner guide takes about 10–15 minutes. You need a text editor. You do not need prior programming experience.
This beginner guide takes about 10–15 minutes. You need a text editor. You do not need prior programming experience.


<!--T:2-->
A mod package has one required information file, a Lua file for the instruction in this example, and an optional settings file:
A mod package has one required information file, a Lua file for the instruction in this example, and an optional settings file:


<!--T:3-->
* <code>mod.json</code> describes the mod, its version, and the capabilities it requests.
* <code>mod.json</code> describes the mod, its version, and the capabilities it requests.
* <code>src/mod.lua</code> contains the Lua code.
* <code>src/mod.lua</code> contains the Lua code.
* <code>extended.mod.json</code> is optional. It can define player-facing settings.
* <code>extended.mod.json</code> is optional. It can define player-facing settings.


== 1. Make a folder for the mod ==
== 1. Make a folder for the mod == <!--T:4-->


<!--T:5-->
Open your Enshrouded game folder, then open its <code>mods</code> folder. Make a new folder called <code>yourname.first-mod</code>.
Open your Enshrouded game folder, then open its <code>mods</code> folder. Make a new folder called <code>yourname.first-mod</code>.


<!--T:6-->
<pre>
<pre>
mods/yourname.first-mod/
mods/yourname.first-mod/
Line 32: Line 37:
</pre>
</pre>


== 2. Add mod.json ==
== 2. Add mod.json == <!--T:7-->


<!--T:8-->
Create <code>mod.json</code> in the new folder. Change the ID, name, author, and description to match your mod.
Create <code>mod.json</code> in the new folder. Change the ID, name, author, and description to match your mod.


<!--T:9-->
<pre>
<pre>
{
{
Line 51: Line 58:
</pre>
</pre>


<!--T:10-->
The <code>id</code> should uniquely identify the package. The <code>name</code> is the display name. Leave <code>version</code> as <code>1.0.0</code> for this example. The empty <code>capabilities</code> and <code>dependencies</code> lists are enough for this example.
The <code>id</code> should uniquely identify the package. The <code>name</code> is the display name. Leave <code>version</code> as <code>1.0.0</code> for this example. The empty <code>capabilities</code> and <code>dependencies</code> lists are enough for this example.


<!--T:11-->
See [[mod.json]] for the fields and the canonical schema.
See [[mod.json]] for the fields and the canonical schema.


== 3. Add the Lua instruction ==
== 3. Add the Lua instruction == <!--T:12-->


<!--T:13-->
Inside the <code>src</code> folder, create <code>mod.lua</code> and add this line:
Inside the <code>src</code> folder, create <code>mod.lua</code> and add this line:


<!--T:14-->
<pre>
<pre>
shroudforge.log.info("My first mod loaded")
shroudforge.log.info("My first mod loaded")
</pre>
</pre>


<!--T:15-->
This sends a message to the ShroudForge log.
This sends a message to the ShroudForge log.


== 4. Find the mod in the game ==
== 4. Find the mod in the game == <!--T:16-->


<!--T:17-->
Start Enshrouded. Press <kbd>F9</kbd> to open the Mods window. Your mod should appear in the list. Press <kbd>F10</kbd> to open the messages and look for <code>My first mod loaded</code>.
Start Enshrouded. Press <kbd>F9</kbd> to open the Mods window. Your mod should appear in the list. Press <kbd>F10</kbd> to open the messages and look for <code>My first mod loaded</code>.


<!--T:18-->
If ShroudForge cannot find the mod, check that its folder is inside the game's <code>mods</code> folder. Downloaded mods can use different folder layouts, so follow their creator's instructions.
If ShroudForge cannot find the mod, check that its folder is inside the game's <code>mods</code> folder. Downloaded mods can use different folder layouts, so follow their creator's instructions.


== Next steps ==
== Next steps == <!--T:19-->


<!--T:20-->
Add player-facing switches or sliders with [[extended.mod.json]]. For Lua modding concepts, continue with [[Modding with Lua]]. Use the [https://bonsaibauer.github.io/shroudforge/en/#api searchable Lua API reference] for exact function documentation.
Add player-facing switches or sliders with [[extended.mod.json]]. For Lua modding concepts, continue with [[Modding with Lua]]. Use the [https://bonsaibauer.github.io/shroudforge/en/#api searchable Lua API reference] for exact function documentation.



Latest revision as of 00:15, 18 November 2026


The ShroudForge Modloader can show a mod's settings and status.


This beginner guide takes about 10–15 minutes. You need a text editor. You do not need prior programming experience.

A mod package has one required information file, a Lua file for the instruction in this example, and an optional settings file:

  • mod.json describes the mod, its version, and the capabilities it requests.
  • src/mod.lua contains the Lua code.
  • extended.mod.json is optional. It can define player-facing settings.

1. Make a folder for the mod

Open your Enshrouded game folder, then open its mods folder. Make a new folder called yourname.first-mod.

mods/yourname.first-mod/
├── mod.json
└── src/
    └── mod.lua

2. Add mod.json

Create mod.json in the new folder. Change the ID, name, author, and description to match your mod.

{
  "$schema": "https://shroudforge.net/schemas/1.8.0/manifest.schema.json",
  "id": "yourname.first-mod",
  "name": "My First Mod",
  "version": "1.0.0",
  "authors": ["Your name"],
  "description": "Writes a message.",
  "license": null,
  "icon": null,
  "capabilities": [],
  "dependencies": []
}

The id should uniquely identify the package. The name is the display name. Leave version as 1.0.0 for this example. The empty capabilities and dependencies lists are enough for this example.

See mod.json for the fields and the canonical schema.

3. Add the Lua instruction

Inside the src folder, create mod.lua and add this line:

shroudforge.log.info("My first mod loaded")

This sends a message to the ShroudForge log.

4. Find the mod in the game

Start Enshrouded. Press F9 to open the Mods window. Your mod should appear in the list. Press F10 to open the messages and look for My first mod loaded.

If ShroudForge cannot find the mod, check that its folder is inside the game's mods folder. Downloaded mods can use different folder layouts, so follow their creator's instructions.

Next steps

Add player-facing switches or sliders with extended.mod.json. For Lua modding concepts, continue with Modding with Lua. Use the searchable Lua API reference for exact function documentation.