Modding:Basic Item: Difference between revisions

From Vintage Story Wiki
no edit summary
No edit summary
No edit summary
Line 12: Line 12:
== The Texture ==
== The Texture ==


This is the texture we gonna use [[File:Wand.png]]. In order to use it we need to place it inside the assets folder of the [[Vintagestory folder]]. Therefore the path should look like this: <code>assets/textures/items/tool/wand/wand.png</code>.
This is the texture we gonna use [[File:Wand.png]]. Now we need to create the following folders inside our workspace <code>assets/mywandmod/textures/items/<code>, copy the texture in there and rename it to <code>wand.png</code>.


== The Json File ==
== The Item 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 <code>assets/itemtypes/tool/wand.json</code>.
To create the actual wand need to create a json file inside <code>assets/mywandmod/itemtypes/</code> in your workspace. In this example we name it <code>wand.json</code>. This file contains the basic properties of your item.


The content of this json file should look as it follows:
The content of this json file should look as it follows:
Line 23: Line 23:
code: "wand",
code: "wand",
creativeinventory: { "general": ["*"] },
creativeinventory: { "general": ["*"] },
texture: { base: "tool/wand/wand" }
texture: { base: "wand" }
}
}
</syntaxhighlight>
</syntaxhighlight>


* '''code''': A unique identifier for your item. If you plan a larger mod, it is suggested to prefix your modname to the identifier.
* '''code''': A unique identifier for your item.
* '''creativeinventory''': The creative inventory tabs the itemshould be shown in (currently only 1 tab available)
* '''creativeinventory''': The creative inventory tabs the itemshould be shown in (currently only 1 tab available)
* '''textures''': What textures to apply.
* '''textures''': What textures to apply.


== Testing ==
== Naming the Block ==


Now we got everything ready to run our first test. You should be able to find the added item in the creative inventory.
To give the block a proper name, we need to create another json file and save it inside a new created folder <code>assets/mywandmod/lang/en.json</code>
 
[[File:2017-01-30 13-59-27.png|700px]]
 
== Naming the Item ==


To give the item a proper name, you currently have to manually add a line like this in the file <code>assets/lang/en.json</code>
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
"item-wand": "Wand",
{
"block-wand": "Wand"
}
</syntaxhighlight>
</syntaxhighlight>


A better way of handling naming and translation will be added once its desired.
== Testing/ Distribution ==


== Distributing a mod ==
There is only one thing left. We need to create a zip file of the assets folder inside your workspace. Either you use an external program (such as WinRAR or 7Zip) or you right-click the <code>assets</code> folder and hit '''Send To''' -> '''Compressed (zipped) folder'''. Eventually you can rename the zip file to <code>MyWandMod.zip</code>. The zip file can be either used for testing purposes or you can send it to other people so they can use it as well.


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:
[http://wiki.vintagestory.at/images/e/ec/MyWandMod.zip MyWandMod.zip]


[http://wiki.vintagestory.at/images/e/ec/MyWandMod.zip MyWandMod.zip]
To install the mod, navigate to the [[VintageStory Folder]] and place it inside the mods folder.
 
Now we got everything ready to run our first test. You should be able to find the added item in the creative inventory.


A proper mod manager will be added to the game once there is a few serious mods out there (go bug tyron about it ;-) ).
[[File:2017-01-30 13-59-27.png|700px]]


= Advanced Properties =
= Advanced Properties =
Confirmedusers, editor, Administrators
886

edits