HowToAddCreaturesStendhal: Difference between revisions

Content deleted Content added
imported>Ufizavipupu
No edit summary
imported>Madmetzger
Undo revision 11779 by Ufizavipupu (Talk)
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 Extenders}}
Line 14 ⟶ 6:
This file contains all the description of the creatures in game.
For example.
&lt;<source lang=&quot;"xml&quot;&gt;">
&lt;<creature name=&quot;"deer&quot;&gt;">
&lt;<type class=&quot;"animal&quot;" subclass=&quot;"deer&quot;" tileid=&quot;"animal.png:9&quot;"/&gt;>
&lt;<description&gt;&lt;></description&gt;>
&lt;<attributes&gt;>
&lt;<atk value=&quot;"5&quot;"/&gt;>
&lt;<def value=&quot;"9&quot;"/&gt;>
&lt;<hp value=&quot;"20&quot;"/&gt;>
&lt;<speed value=&quot;"1.0&quot;"/&gt;>
&lt;<size value=&quot;"1,1&quot;"/&gt;>
&lt;</attributes&gt;>
&lt;<level value=&quot;"0&quot;"/&gt;>
&lt;<experience value=&quot;"0&quot;"/&gt;>
&lt;<respawn value=&quot;"900&quot;"/&gt;>
&lt;<corpse name=&quot;"animal&quot;"/&gt;>
&lt;<drops&gt;>
&lt;<item value=&quot;"meat&quot;" quantity=&quot;"[1,3]&quot;" probability=&quot;"60.0&quot;"/&gt;>
&lt;<item value=&quot;"ham&quot;" quantity=&quot;"[1,2]&quot;" probability=&quot;"30.0&quot;"/&gt;>
&lt;<item value=&quot;"antidote&quot;" quantity=&quot;"[1,1]&quot;" probability=&quot;"5.0&quot;"/&gt;>
&lt;</drops&gt;>
&lt;<equips&gt;>
&lt;</equips&gt;>
&lt;<ai&gt;>
&lt;<profile name=&quot;"non_offensive&quot;"/&gt;>
&lt;<profile name=&quot;"animal&quot;"/&gt;>
&lt;<profile name=&quot;"coward&quot;"/&gt;>
&lt;<profile name=&quot;"patrolling&quot;"/&gt;>
&lt;</ai&gt;>
&lt;</creature&gt;>
&lt;</source&gt;>
 
It is important to understand how it works.
Line 87 ⟶ 79:
== 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:
&lt;<corpse name=&quot;"giant_humanoid&quot;" width=&quot;"2&quot;" height=&quot;"2&quot;"/&gt;>
 
== AI profiles ==
Line 117 ⟶ 109:
Please see [[StendhalRefactoringGraphics#Creatures| How to know graphics specifications for creatures]]
 
Now place the sprite in the folder '''data/sprites/monsters/&lt;<class&gt;>/&lt;<subclass&gt;>.png'''
 
= 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:
 
register(&quot;"creature&quot;",&quot;"small_animal&quot;",SmallCreature.class);
register(&quot;"creature&quot;",&quot;"giant_animal&quot;",BigCreature.class);
register(&quot;"creature&quot;",null,NormalCreature.class);
 
 
= Add to game=
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 &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.
Line 137 ⟶ 129:
= 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.
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.