Modding:Basic Item: Difference between revisions

From Vintage Story Wiki
no edit summary
No edit summary
No edit summary
Line 55: Line 55:


Our wand is still rather useless, so it might be a good idea to add our wand some mining functionality. How it works? We the property "miningspeedbytype" we can define the mining speed for each material. Here is a list of all [[Block Materials|block materials]].
Our wand is still rather useless, so it might be a good idea to add our wand some mining functionality. How it works? We the property "miningspeedbytype" we can define the mining speed for each material. Here is a list of all [[Block Materials|block materials]].
The number indicates how fast the tool is able to mine the block, while <code>1</code> is the default value. <code>time to mine = block resistance / miningspeed</code>. Meaning a speed of <code>2</code> is twice as fast the default speed of one. So our tool is seven times faster than using the hand.


A pickaxe looks like this:
A pickaxe looks like this:
Line 157: Line 159:
== Texture Overlays ==
== Texture Overlays ==


As everybody knows programmers are lazy, so instead of drawing a texture for each variant of our items, we can use overlays instead, which will make it a lot easier.
As everybody knows programmers are lazy, so instead of drawing a texture for each variant of our item, we can use overlays instead, which will make it a lot easier.
 
These are the overlays for each type: [[File:Wand-overlay-axe.png]] [[File:Wand-overlay-pickaxe.png]] [[File:Wand-overlay-shovel.png]]. All we have to do now is to change the base texture to back to the original wand texture and add an overlay texture.
 
<syntaxhighlight lang="json">
texture: {
base: "tool/wand/wand",
overlays: [ "tool/wand/wand-overlay-{tooltype}" ],
},
</syntaxhighlight>
 
and this is the result:
 
[[File:2017-02-09 17-30-34.png|700px]]
 
== Download ==
 
You can download the mod to test it out yourself: [http://wiki.vintagestory.at/images/e/ec/MyAdvancedWandMod.zip MyAdvancedWandMod.zip]
Confirmedusers, editor, Administrators
886

edits