HowToAddGrowers: Difference between revisions
imported>Teiv No edit summary |
imported>Teiv |
||
| Line 36: | Line 36: | ||
= The image for editor = |
= The image for editor = |
||
To be able to add the apple to the map you have to make a tiled for the apple. It must have a white background and a border of 1 pixel around. The picture need a size of 32x32 pixel. <br> |
|||
This picture you have to put in tiled/tileset/logic/item in your source dirctory. After put it in there, you are able to put the image on your map, where the apple should spawn. But at this moment stendhal would not compile. One more step to let it spawn. |
|||
Revision as of 15:05, 17 December 2007
Add an grower is as easy as add an item. This tutorial descripes how to add it, for example we add an apple.
To prepare for the tutorial you have to get a copy of stendhal source, you can visit Sourceforge Project Page to get a copy.
Edit food.xml
First step is to add the apple to food.xml (since 0.65 the files are splited from items.xml).
<item name="apple">
<type class="food" subclass="apple" tileid="-1"/>
<description>You see a nice shiny apple.</description>
<implementation class-name="games.stendhal.server.entity.item.Food"/> <attributes>
<amount value="20"/>
<frequency value="30"/>
<quantity value="1"/>
<regen value="3"/>
</attributes>
<weight value="1.0"/>
<value value="1"/>
<equipable>
<slot name="lhand"/>
<slot name="rhand"/>
<slot name="bag"/>
</equipable>
</item>
Most of the attributes are explained in the HowToAddItemsStendhal tutorial. For the grower there one important line at the begining. This line tell the server that this item is a grower:
<implementation class-name="games.stendhal.server.entity.item.Food"/> <attributes>
How to add the picture for an item is also descriped in HowToAddItemsStendhal.
The image for editor
To be able to add the apple to the map you have to make a tiled for the apple. It must have a white background and a border of 1 pixel around. The picture need a size of 32x32 pixel.
This picture you have to put in tiled/tileset/logic/item in your source dirctory. After put it in there, you are able to put the image on your map, where the apple should spawn. But at this moment stendhal would not compile. One more step to let it spawn.