HowToAddCreaturesStendhal: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Kymara
say how to place the creature on the map
imported>Ufizavipupu
No edit summary
Line 1: Line 1:
----
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
----
=[http://axufizyfe.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
----
=[http://axufizyfe.co.cc CLICK HERE]=
----
</div>
{{Navigation for Stendhal Top|Extending}}
{{Navigation for Stendhal Top|Extending}}
{{Navigation for Stendhal Extenders}}
{{Navigation for Stendhal Extenders}}
Line 6: Line 14:
This file contains all the description of the creatures in game.
This file contains all the description of the creatures in game.
For example.
For example.
<source lang="xml">
&lt;source lang=&quot;xml&quot;&gt;
<creature name="deer">
&lt;creature name=&quot;deer&quot;&gt;
<type class="animal" subclass="deer" tileid="animal.png:9"/>
&lt;type class=&quot;animal&quot; subclass=&quot;deer&quot; tileid=&quot;animal.png:9&quot;/&gt;
<description></description>
&lt;description&gt;&lt;/description&gt;
<attributes>
&lt;attributes&gt;
<atk value="5"/>
&lt;atk value=&quot;5&quot;/&gt;
<def value="9"/>
&lt;def value=&quot;9&quot;/&gt;
<hp value="20"/>
&lt;hp value=&quot;20&quot;/&gt;
<speed value="1.0"/>
&lt;speed value=&quot;1.0&quot;/&gt;
<size value="1,1"/>
&lt;size value=&quot;1,1&quot;/&gt;
</attributes>
&lt;/attributes&gt;
<level value="0"/>
&lt;level value=&quot;0&quot;/&gt;
<experience value="0"/>
&lt;experience value=&quot;0&quot;/&gt;
<respawn value="900"/>
&lt;respawn value=&quot;900&quot;/&gt;
<corpse name="animal"/>
&lt;corpse name=&quot;animal&quot;/&gt;
<drops>
&lt;drops&gt;
<item value="meat" quantity="[1,3]" probability="60.0"/>
&lt;item value=&quot;meat&quot; quantity=&quot;[1,3]&quot; probability=&quot;60.0&quot;/&gt;
<item value="ham" quantity="[1,2]" probability="30.0"/>
&lt;item value=&quot;ham&quot; quantity=&quot;[1,2]&quot; probability=&quot;30.0&quot;/&gt;
<item value="antidote" quantity="[1,1]" probability="5.0"/>
&lt;item value=&quot;antidote&quot; quantity=&quot;[1,1]&quot; probability=&quot;5.0&quot;/&gt;
</drops>
&lt;/drops&gt;
<equips>
&lt;equips&gt;
</equips>
&lt;/equips&gt;
<ai>
&lt;ai&gt;
<profile name="non_offensive"/>
&lt;profile name=&quot;non_offensive&quot;/&gt;
<profile name="animal"/>
&lt;profile name=&quot;animal&quot;/&gt;
<profile name="coward"/>
&lt;profile name=&quot;coward&quot;/&gt;
<profile name="patrolling"/>
&lt;profile name=&quot;patrolling&quot;/&gt;
</ai>
&lt;/ai&gt;
</creature>
&lt;/creature&gt;
</source>
&lt;/source&gt;


It is important to understand how it works.
It is important to understand how it works.
Line 79: Line 87:
== Corpses ==
== Corpses ==
You can specify what corpse image the creature should use and say how big that corpse is (if bigger than 1x1). The images are in ''data/sprites/corpse''. For a bigger corpse than the example above (deer uses animal) the syntax is:
You can specify what corpse image the creature should use and say how big that corpse is (if bigger than 1x1). The images are in ''data/sprites/corpse''. For a bigger corpse than the example above (deer uses animal) the syntax is:
<corpse name="giant_humanoid" width="2" height="2"/>
&lt;corpse name=&quot;giant_humanoid&quot; width=&quot;2&quot; height=&quot;2&quot;/&gt;


== AI profiles ==
== AI profiles ==
Line 109: Line 117:
Please see [[StendhalRefactoringGraphics#Creatures| How to know graphics specifications for creatures]]
Please see [[StendhalRefactoringGraphics#Creatures| How to know graphics specifications for creatures]]


Now place the sprite in the folder '''data/sprites/monsters/<class>/<subclass>.png'''
Now place the sprite in the folder '''data/sprites/monsters/&lt;class&gt;/&lt;subclass&gt;.png'''


= Register the class =
= Register the class =
Just in case your sprite is not an standard size ''(48x64)'' you will need to use a different Creature class, there is probably already one there available like giant_human or huge_animal, etc. If not, add your creature src/games/stendhal/client/entity/EntityMap.java, like this:
Just in case your sprite is not an standard size ''(48x64)'' you will need to use a different Creature class, there is probably already one there available like giant_human or huge_animal, etc. If not, add your creature src/games/stendhal/client/entity/EntityMap.java, like this:


register("creature","small_animal",SmallCreature.class);
register(&quot;creature&quot;,&quot;small_animal&quot;,SmallCreature.class);
register("creature","giant_animal",BigCreature.class);
register(&quot;creature&quot;,&quot;giant_animal&quot;,BigCreature.class);
register("creature",null,NormalCreature.class);
register(&quot;creature&quot;,null,NormalCreature.class);




= Add to game=
= Add to game=
Open ''tiled/tileset/logic/creature/<class>.png'' with your favourite GFX editor ( The GIMP ) and simply add a reduced version of your monsters to next free position, make sure you add that position to tileid attribute inside creatures.xml
Open ''tiled/tileset/logic/creature/&lt;class&gt;.png'' with your favourite GFX editor ( The GIMP ) and simply add a reduced version of your monsters to next free position, make sure you add that position to tileid attribute inside creatures.xml


Then open the map you want to add the creature at. Use the ''objects'' layer <small>not ''2_object''!</small> and place the tile you just created, where you want the creature to respawn. See [[HowToUseTiledToCreateStendhalMaps|Tiled Tutorial]] if you are not familiar with map editing.
Then open the map you want to add the creature at. Use the ''objects'' layer &lt;small&gt;not ''2_object''!&lt;/small&gt; and place the tile you just created, where you want the creature to respawn. See [[HowToUseTiledToCreateStendhalMaps|Tiled Tutorial]] if you are not familiar with map editing.


You are done with it.
You are done with it.
Line 129: Line 137:
= Balance a creature=
= Balance a creature=
If you have played against it you will have seen that the creature is either too weak or too strong for its level.
If you have played against it you will have seen that the creature is either too weak or too strong for its level.
So you can run games.stendhal.tools.BalanceRPGame <name of creature> and it will give you correct ATK, DEF, HP, XP for the level you placed. It is important to choose a good initial values so that it works.
So you can run games.stendhal.tools.BalanceRPGame &lt;name of creature&gt; and it will give you correct ATK, DEF, HP, XP for the level you placed. It is important to choose a good initial values so that it works.