Obenseuer/Making Mods: Difference between revisions

From Stalburg Wiki
Jump to navigation Jump to search
Nextej (talk | contribs)
WIP
 
Nextej (talk | contribs)
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
==Making simple data-driven mods with Lavender for new items and recipes==
==Making simple data-driven mods with Lavender for new items and recipes==
Lavender library allows you to make simple mods without needing any programming knowledge or requiring you to compile the code, that can be easily used with BepInEx launcher. You should start by making a new folder for your mod, where you will place its all contents.
Lavender library allows you to make simple mods without needing any programming knowledge or requiring you to compile the code, that can be easily used with BepInEx launcher. You should start by making a new folder for your mod, where you will place its all contents. To run your mod in game, your custom folder will need to be located in <code>..\Obenseuer\BepInEx\plugins</code>, you can place this folder and work on it there now, or keep it separate and duplicate it to the plugins location whenever you want to test it.


===Mod config===
===Mod config===
Line 19: Line 19:
</pre>
</pre>


* <code>"ModName"</code> - Specifies the internal name of the mod, it should be the same as the parent folder of your mod.
* <code>"ModName"</code> - Specifies the internal name of the mod, this name will be referenced throughout the mod to address various aspects.
* <code>"Name"</code> - Specifies the external name of the mod for the user.
* <code>"Name"</code> - Specifies the external name of the mod for the user.
* <code>"Description"</code> - Specifies the description of what your mod does for the user.
* <code>"Description"</code> - Specifies the description of what your mod does for the user.
* <code>"Author"</code> - Specifies your signature of who made the mod for the user.
* <code>"Author"</code> - Specifies your signature of who made the mod for the user.
* <code>"URL"</code> - Specifies a website URL address for your authorship, can be omitted.
* <code>"URL"</code> - Specifies a website URL address for your authorship and where to look for help with issues, can be omitted.
* <code>"Version"</code> - Specifies the version of the mod for the user. Common formats are Major.Minor.Bugfix order of numbers or Incompatible.Compatible.Bugfix order, however you are not bound to any system and can specify anything of your choosing.
* <code>"Version"</code> - Specifies the version of the mod for the user. Common formats are Major.Minor.Bugfix order of numbers or Incompatible.Compatible.Bugfix order, however you are not bound to any system and can specify anything of your choosing.


Line 40: Line 40:
"ItemFiles": [
"ItemFiles": [
"ExampleItems1.json",
"ExampleItems1.json",
"ExampleItems2.json",
"ExampleItems2.json"
],
],
"RecipeFiles": [
"RecipeFiles": [
"Recipes.json",
"Recipes.json"
],
],
"LavenderAssetFiles": []
"LavenderAssetFiles": []
Line 97: Line 97:
** <code>"name"</code> - Specifies the name of your asset.
** <code>"name"</code> - Specifies the name of your asset.
** <code>"objTexturePaths"</code> - If your asset is a model, specifies the location of textures the model is using.
** <code>"objTexturePaths"</code> - If your asset is a model, specifies the location of textures the model is using.
To use the defined asset for your items or recipes, the address path will follow this formula <code>#lv-''ModName''-''ID''</code>, the ModName is what you defined in datamod.json.

Latest revision as of 21:13, 8 February 2026

Making simple data-driven mods with Lavender for new items and recipes

Lavender library allows you to make simple mods without needing any programming knowledge or requiring you to compile the code, that can be easily used with BepInEx launcher. You should start by making a new folder for your mod, where you will place its all contents. To run your mod in game, your custom folder will need to be located in ..\Obenseuer\BepInEx\plugins, you can place this folder and work on it there now, or keep it separate and duplicate it to the plugins location whenever you want to test it.

Mod config

For Lavender to see your mod, it needs a datamod.json file, which contains all the information about your mod.

To make a datamod.json file, create a blank file using any raw text editor and save it as "datamod.json" inside your mod folder. The structure inside the file follows standard JSON syntax, content of the file needs to be contained inside an open curly bracket { at the beginning and an closed curly bracket } at the end. Each property and each value in the file must be contained between two quotation marks ", between a property and its associated value a colon : must be placed. Each property is separated from the next by a comma , after its value is specified.

An example datamod.json file looks as following:

{
	"ModName": "example",
	"Name": "example",
	"Description": "example",
	"Author": "example",
	"URL": "example",
	"Version": "0.0.1"
}
  • "ModName" - Specifies the internal name of the mod, this name will be referenced throughout the mod to address various aspects.
  • "Name" - Specifies the external name of the mod for the user.
  • "Description" - Specifies the description of what your mod does for the user.
  • "Author" - Specifies your signature of who made the mod for the user.
  • "URL" - Specifies a website URL address for your authorship and where to look for help with issues, can be omitted.
  • "Version" - Specifies the version of the mod for the user. Common formats are Major.Minor.Bugfix order of numbers or Incompatible.Compatible.Bugfix order, however you are not bound to any system and can specify anything of your choosing.

For your mod to be able to use various files and assets, you need to properly specify them in the datamod.json below the previously defined properties. This is done similarly to declaring properties, however those properties can, and will, have multiple values. Before specifying any value for your property, you need open a list of values with an open square bracket at the beginning [, and after defining all the values in a row, a closed square bracket ] at the end. Now you can specify multiple values inside the square brackets, each value separated again by a comma ,.

An example how datamod.json file looks now:

{
	"ModName": "example",
	"Name": "example",
	"Description": "example",
	"Author": "example",
	"URL": "example",
	"Version": "0.0.1"

	"ItemFiles": [
		"ExampleItems1.json",
		"ExampleItems2.json"
	],
	"RecipeFiles": [
		"Recipes.json"
	],
	"LavenderAssetFiles": []
}
  • "ItemFiles" - Specifies the files used for defining your custom items, in the vanilla game defined under Items.json name, but you do not need to use the same naming convention.
  • "RecipeFiles" - Specifies the files used for defining your custom recipes, in the vanilla game defined under Recipes.json name, but you do not need to use the same naming convention.
  • "LavenderAssetFiles" - Specifies the files used for defining all custom images, icons and models, for example named as Assets.json.

Adding new items

Create a new file, named the same as you have defined it in ItemFiles property inside your datamod.json file. Unlike datamod.json, here you will define multiple entries, and as such, all content of this file needs to be contained inside an open square bracket [ at the beginning and an closed square bracket ] at the end.

For a template how item definition looks, you can check Items.json file inside your game files at \Obenseuer\Obenseuer_Data\StreamingAssets.

Adding new recipes

Create a new file, named the same as you have defined it in RecipeFiles property inside your datamod.json file. Unlike datamod.json, here you will define multiple entries, and as such, all content of this file needs to be contained inside an open square bracket [ at the beginning and an closed square bracket ] at the end.

For a template how recipe definition looks, you can check Recipes.json file inside your game files at \Obenseuer\Obenseuer_Data\StreamingAssets.

Adding custom assets

Create a new file, named the same as you have defined it in LavenderAssetFiles property inside your datamod.json file. Unlike datamod.json, here you will define multiple entries, and as such, all content of this file needs to be contained inside an open square bracket [ at the beginning and an closed square bracket ] at the end.

An example assets file looks as following:

[
	{
		"ID": 1,
		"AssetType": "Image",
		"Data": {
			"path": "example.png",
			"name": "ExampleImage"
		}
	},
	{
		"ID": 2,
		"AssetType": "OBJ",
		"Data": {
			"path": "example.obj",
			"name": "ExampleModel",
			"objTexturePaths": [
				"example.png"
			]
		}
	}
]
  • "ID" - Specifies the entry in the list that will be referred to by other files, unlike other values, this is an number and should not use quotation marks ".
  • "AssetType" - Specifies what type your asset is, use:
    • "Image" - for any texture, such as item icons seen in the inventory
    • "OBJ" - for any models, such as an item seen lying on a ground
  • "Data" - Specifies the properties of your assets:
    • "path" - Specifies the location of your asset inside your mod folder, if it is not nested in further folder, it does not need any additioanl specification other than the file name and file type.
    • "name" - Specifies the name of your asset.
    • "objTexturePaths" - If your asset is a model, specifies the location of textures the model is using.

To use the defined asset for your items or recipes, the address path will follow this formula #lv-ModName-ID, the ModName is what you defined in datamod.json.