HowToAddCreaturesStendhal: Difference between revisions

From Arianne
Jump to navigation Jump to search
imported>Oslsachem
imported>Oslsachem
(No difference)

Revision as of 20:46, 30 March 2006

You can add new creatures to game in a few very simple steps:

Edit creature.xml

This file contains all the description of the creatures in game. For example.

<creature name="deer">
	<type class="animal" subclass="deer" tileid="36"/>
	<attributes>
		<atk value="5"/>
		<def value="5"/>
		<hp value="20"/>
		<speed value="1"/>
		<size value="1,2"/>
	</attributes>
	<level value="0"/>
	<experience value="0"/>
	<drops>
		<item value="meat" quantity="[1,4]" probability="80"/>
		<item value="ham" quantity="[1,2]" probability="40"/>
	</drops>
	<equips>
                <slot name="rhand" item="leather_skin"/>
	</equips>
	<ai>
		<profile name="animal"/>
		<profile name="non_ofensive"/>
		<profile name="coward"/>
	</ai>
</creature>

It is important to understand how it works.

We must give a name to the creature and it is done in the creature tag. Then we specify the class and the subclass on the type tag. If you check the way sprites are structure at client you will realize that it is in a similar fashion to:

 sprites/
     monsters/
         class/
             subclass.png


The next attribute inside type tag is tileid that points to the position (starting from 1) of this monster sprite in the zelda_objects.png file.

Inside the attributes tag you can specify the attributes the entity has:

  • ATK it is a value proportional to the damage the creature can do.
  • DEF it is a value proportional to how much damage the creature can block.
  • HP is the health measure
  • Speed it is how fast creature moves. Range from 0 to 1.
  • Size it is the size of the creature in tiles: usually 1x2

Now the level and experience tags. The level is used by the balancer application and the players to measure a creature (because they don't know ATK, DEF or HP values ). The experience determine the reward the player will get by killing this creature.

Now the drops tag specify what the creature drops when it is killed. Each of the item has a probability of being dropped (probability attribute) and the quantity of it that may be dropped (quantity attribute)

Aditionally you can equip items at a creature slots:

  • rhand
  • lhand
  • armor
  • head
  • legs
  • feet

It is a good idea not to equip creatures ( because they take more memory ) if it is possible.

AI is useless right now dont worry about it, just copy and paste the data.

Add GFX

Now you need to find a nice sprite for your monster. Most RPGMaker 2000 sprites works for stendhal. But they are in 24x32 size. We need to scale it using scale2x to get the best quality possible to 48x64. Either use scale2x or send us the original sprite and we will scale it.

Now place the sprite in the folder data/sprites/monsters/<class>/<subclass>.png

See also How to know graphics specifications for creatures

Edit GameObjects

Just in case your sprite is not an standard size (48x64) you will need to use a different Creature class.

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


Add to game

Open tiled/zelda_objects.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

You are done with it. Now let's play.

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 <creature name> 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.



Back to stendhal main wiki page