Custom pets

From Heroes of Hammerwatch wiki
Revision as of 18:52, 27 September 2021 by Ziadoma (talk | contribs) (Created page with "You can create custom pets inside you own mod. For more informationen about creating your own mod and the info.xml file Mod_base == File Structure == File:Modfilestructu...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

You can create custom pets inside you own mod. For more informationen about creating your own mod and the info.xml file Mod_base

File Structure

Modfilestructure.png

All of these files can be copied from the games files, after using the Packager. Note if you edit these files and remove the default content, it wont be in the game when you install your mod!

  • info.xml: Information about your own custom mod.
  • icons_pets.png: The icons displayed in the pet shop. This file needs to have the size of X² (32x32, 64x32, 64x64 ...)
  • your_pet.png: Sprites of the custom pet. This file needs to have the size of X²
  • your_pet.unit: Behaviour of the custom pet
  • pets.sval: The available content of the pet shop

Behaviour

The pet behaviour can be defined in the your_pet.unit file. There are two types of pets: walking and flying pets.

Behaviour type

Walking Flying
This line needs to be added before the behaviour
<unit netsync="none" save="false">
<unit netsync="none" save="false" layer="50">
Afterwards the values of the behaviour can be modified
	<behavior class="MiniPetWalking">
		<string name="anim-idle">idle 8</string>
		<string name="anim-walk">walk 8</string>
	
		<float name="speed">5.5</float>
		<float name="idle-speed">4</float>
		
		<int name="range-idle">50</int>
		<int name="range-min-idle">20</int>
		<int name="range-pickup">160</int>

		<int name="pickup-duration">5000</int>
		<int name="idle-duration">2000</int>

		<int name="idle-delay">100</int>
		<int name="pickup-delay">30</int>

		<int name="leash-range">180</int>
	</behavior>
	<behavior class="MiniPetFlying">
		<string name="anim-idle">idle 8</string>
		<string name="anim-walk">walk 8</string>
		
		<float name="speed">4.3</float>
		<float name="idle-speed">2.7</float>
		<float name="turn-speed">5</float>
		
		<int name="pickup-duration">5000</int>
		<int name="idle-duration">750</int>
		
		<int name="leash-range">300</int>
		<int name="range-idle">80</int>
		<int name="range-pickup">200</int>

		<float name="acceleration-duration">250</float>
		<float name="deceleration-duration">750</float>
		<float name="turn-speed-boost">50</float>
	</behavior>

Custom Sprites

The default your_pet.png has the following layout:

Pet sprite layout.png

  • All sprites are 24x24 pixels
  • The first row are the idle animations for all 8 directions
  • Below are 4 frames for each animation
  • You can place your own sprites into this file
  • The layout can be changed and is defined in your_pet.unit file

Animations

After the behaviour the animations are defined in your_pet.unit.