Modding:Basic Item

From Vintage Story Wiki
Revision as of 13:06, 30 January 2017 by CreativeMD (talk | contribs)

This tutorial should introduce you into the basic of adding an item to the game using JSON files. If you want to add a item with functionality you should check out the tutorial for Advanced Items. There is a full list of all properties which can be defined inside the json file Item Json Properties. Adding a block to the game is rather similar, so if you have done that already most of the following steps should be known to you.

A Simple Item

So, the first thing we going to need is an idea. What does this game need. Wait i got it ... the game needs an overpowered wand.

The Texture

This is the texture we gonna use: Wand.png. In order to use it we need to place it inside the assets of the Vintagestory folder. Therefore the path should look like this: assets/textures/items/tool/wand/wand.png.

The Json File

Now we need to let the game know if its existence. We can accomplish that by creating a json file and placing it inside assets/itemtypes/tool/wand.json.

The content of this json file should look as it follows:

{
	code: "wand",
	creativeinventory: { "default": ["*"] },
	texture: { base: "tool/wand/wand" }
}
  • code: A unique identifier for your item. If you plan a larger mod, it is suggested to prefix your modname to the identifier.
  • creativeinventory: The creative inventory tabs the itemshould be shown in (currently only 1 tab available)
  • textures: What textures to apply.

Testing

Now we got everything ready to run our first test. You should be able to find the added item in the creative inventory.

2017-01-30 13-59-27.png

Naming the Item

To give the item a proper name, you currently have to manually add a line like this in the file assets/lang/en.json

	"item-wand": "Wand",

A better way of handling naming and translation will be added once its desired.

Distributing a mod

The current modding system does not yet support mod-specific asset folders. The current way of doing it is to create a zip file a user can extract into his game folder that will extract the files into the right folders. Example:

File:MyWandMod.zip

A proper mod manager will be added to the game once there is a few serious mods out there (go bug tyron about it ;-) ).

Advanced Properties

Mining Properties

Variants

Texture Overlays