HowToAddItemsStendhal: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Blacklads |
imported>Hendrik Brummermann added link to setup a development environment |
||
| Line 3: | Line 3: | ||
You can add new item to game in a few very simple steps: |
You can add new item to game in a few very simple steps: |
||
== Preparation == |
|||
| ⚫ | |||
| ⚫ | |||
Setup a development environment as described in [[Stendhal on Eclipse]]. |
|||
| ⚫ | |||
| ⚫ | |||
The file contains all the description of the items in game. |
The file contains all the description of the items in game. |
||
Lets start with how to do weapons, for example in swords.xml: |
Lets start with how to do weapons, for example in swords.xml: |
||
| Line 144: | Line 148: | ||
</source> |
</source> |
||
= Add Grammar = |
== Add Grammar == |
||
Item names should be short and enough to identify the item, but in spoken and written English there may be some extra words associated with saying the item. For example, Carmen should offer to sell ''100 bottles of potion'' not ''100 potion''. (Add npc text example here?) |
Item names should be short and enough to identify the item, but in spoken and written English there may be some extra words associated with saying the item. For example, Carmen should offer to sell ''100 bottles of potion'' not ''100 potion''. (Add npc text example here?) |
||
| Line 169: | Line 173: | ||
{{TODO|The new structure needs documentation on the different options for register, registerEnd and registerPrefix.}} |
{{TODO|The new structure needs documentation on the different options for register, registerEnd and registerPrefix.}} |
||
= Add to game= |
== Add to game== |
||
==Dropped by creature== |
===Dropped by creature=== |
||
Creatures can drop items, see [[HowToAddCreaturesStendhal]]. |
Creatures can drop items, see [[HowToAddCreaturesStendhal]]. |
||
==Add to map or grower== |
===Add to map or grower=== |
||
You may wish to add items to a map (for player to pick up or harvest). You can either add to zone by creating a java file (good for one - off items like the poison and scroll of Haizen's table in his hut) or add using tiled which is more work initially but allows you to add to the objects layer in tiled again and again in future. (Good for iron ore to collect from the ground, herbs etc). This needs a whole tutorial on spawners (also knows as growers), please see [[HowToAddGrowers]]. |
You may wish to add items to a map (for player to pick up or harvest). You can either add to zone by creating a java file (good for one - off items like the poison and scroll of Haizen's table in his hut) or add using tiled which is more work initially but allows you to add to the objects layer in tiled again and again in future. (Good for iron ore to collect from the ground, herbs etc). This needs a whole tutorial on spawners (also knows as growers), please see [[HowToAddGrowers]]. |
||
==Sold by NPC== |
===Sold by NPC=== |
||
If the NPC is not already created, you can [[Stendhal NPC Coding|code a new NPC]]. Then you will need to add a seller behaviour to your NPC, which should be covered separately. Until that is done, look at Seller examples such as Margaret in Semos Tavern in your source code. The file is [http://arianne.cvs.sourceforge.net/viewvc/arianne/stendhal/src/games/stendhal/server/maps/semos/tavern/BarMaidNPC.java?view=markup src/games/stendhal/server/maps/semos/tavern/BarMaidNPC.java]. If you have any problems with the NPC understanding the item name, you might like to check [[How to test NPC Parser]]. |
If the NPC is not already created, you can [[Stendhal NPC Coding|code a new NPC]]. Then you will need to add a seller behaviour to your NPC, which should be covered separately. Until that is done, look at Seller examples such as Margaret in Semos Tavern in your source code. The file is [http://arianne.cvs.sourceforge.net/viewvc/arianne/stendhal/src/games/stendhal/server/maps/semos/tavern/BarMaidNPC.java?view=markup src/games/stendhal/server/maps/semos/tavern/BarMaidNPC.java]. If you have any problems with the NPC understanding the item name, you might like to check [[How to test NPC Parser]]. |
||
==Produced by NPC== |
===Produced by NPC=== |
||
If the NPC is not already created, you can [[Stendhal NPC Coding|code a new NPC]]. You will need to add a Producer behaviour to your NPC, which should be covered separately. Until that is done, look at Producer examples such as Arlindo in Ados Bakery in your source code. The file is [http://arianne.cvs.sourceforge.net/viewvc/arianne/stendhal/src/games/stendhal/server/maps/ados/bakery/BakerNPC.java?view=markup src/games/stendhal/server/maps/ados/bakery/BakerNPC.java]. If you have any problems with the NPC understanding the item name, you might like to check [[How to test NPC Parser]]. |
If the NPC is not already created, you can [[Stendhal NPC Coding|code a new NPC]]. You will need to add a Producer behaviour to your NPC, which should be covered separately. Until that is done, look at Producer examples such as Arlindo in Ados Bakery in your source code. The file is [http://arianne.cvs.sourceforge.net/viewvc/arianne/stendhal/src/games/stendhal/server/maps/ados/bakery/BakerNPC.java?view=markup src/games/stendhal/server/maps/ados/bakery/BakerNPC.java]. If you have any problems with the NPC understanding the item name, you might like to check [[How to test NPC Parser]]. |
||
==Item Quests and Quest Rewards== |
===Item Quests and Quest Rewards=== |
||
Perhaps you will want your NPC to equip the player with an item as part of a quest, see [[HowToCreateQuests]]. You can also add your items to either the [[StendhalQuest#Daily_Item_Quest|Daily Item quest]] or the [[StendhalQuest#Kirdneh_Museum_needs_help.21|Weekly item quest]], which are related to the appearance around the world (e.g. rare item?). |
Perhaps you will want your NPC to equip the player with an item as part of a quest, see [[HowToCreateQuests]]. You can also add your items to either the [[StendhalQuest#Daily_Item_Quest|Daily Item quest]] or the [[StendhalQuest#Kirdneh_Museum_needs_help.21|Weekly item quest]], which are related to the appearance around the world (e.g. rare item?). |
||