HowToAddGrowers

From Arianne
Revision as of 11:56, 17 December 2007 by imported>Teiv
Jump to navigation Jump to search

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