[DIY] [v8a] More Animals (Horse, Rabbit & Dragonfly)

Post here your released mods

[DIY] [v8a] More Animals (Horse, Rabbit & Dragonfly)

Postby Effix » Wed Dec 12, 2012 3:26 pm

written for Towns v8a

Original graphics by Reiner “Tiles” Prokein - http://www.reinerstilesets.de

Image

In this do-it-yourself modding tutorial we will be adding some animals, mainly to enrich the landscape.
- To not get any false hopes up: the horses are not ridable... tried it like in Jontis' Mount mod but it looks like the horse is riding the Townie instead of the other way around :P (kept a saddle and saddled horse variations in the horses graphics file, maybe useful for something some day)
- The horses have a fancy walking animation
- No new meat drops
- The <!-- More Animals START //--> and END lines are comment lines to help keep track of what belongs to this DIY.


Graphics

Download the graphics files below & copy them to your Towns\data\graphics folder:
all-in-one zip file: http://www.mediafire.com/?ftrrx9zb573s8sb
Or get the individual images if you don't fully trust zip files:
horse.png: http://www.mediafire.com/view/?bwv2sw4hc6hh5bw
rabbit.png: http://www.mediafire.com/view/?7aiazlyhabdmkx1
dragonfly.png: http://www.mediafire.com/view/?4h2udfl4s2cc73v

Towns\graphics.ini

Add to end of file:
Code: Select all
# More Animals START

[rabbit]TILE_X = 0
[rabbit]TILE_Y = 0
[rabbit]TILE_HEIGHT = 64
[rabbit]TEXTURE_FILE = rabbit.png

[rabbit2]TILE_X = 1
[rabbit2]TILE_Y = 0
[rabbit2]TILE_HEIGHT = 64
[rabbit2]TEXTURE_FILE = rabbit.png

[rabbit3]TILE_X = 2
[rabbit3]TILE_Y = 0
[rabbit3]TILE_HEIGHT = 64
[rabbit3]TEXTURE_FILE = rabbit.png

[snowrabbit]TILE_X = 3
[snowrabbit]TILE_Y = 0
[snowrabbit]TILE_HEIGHT = 64
[snowrabbit]TEXTURE_FILE = rabbit.png

[desertrabbit]TILE_X = 4
[desertrabbit]TILE_Y = 0
[desertrabbit]TILE_HEIGHT = 64
[desertrabbit]TEXTURE_FILE = rabbit.png

[dragonfly]TILE_X = 0
[dragonfly]TILE_Y = 0
[dragonfly]TILE_HEIGHT = 64
[dragonfly]ANIMATION_TILES = 2
[dragonfly]ANIMATION_FRAME_DELAY = 4
[dragonfly]TEXTURE_FILE = dragonfly.png

[dragonfly2]TILE_X = 2
[dragonfly2]TILE_Y = 0
[dragonfly2]TILE_HEIGHT = 64
[dragonfly2]ANIMATION_TILES = 2
[dragonfly2]ANIMATION_FRAME_DELAY = 4
[dragonfly2]TEXTURE_FILE = dragonfly.png

[dragonfly3]TILE_X = 4
[dragonfly3]TILE_Y = 0
[dragonfly3]TILE_HEIGHT = 64
[dragonfly3]ANIMATION_TILES = 2
[dragonfly3]ANIMATION_FRAME_DELAY = 4
[dragonfly3]TEXTURE_FILE = dragonfly.png

[horse]TILE_X = 0
[horse]TILE_Y = 0
[horse]TILE_HEIGHT = 64
[horse]ANIMATION_TILES = 6
[horse]ANIMATION_FRAME_DELAY = 4
[horse]TEXTURE_FILE = horse.png

[horse2]TILE_X = 0
[horse2]TILE_Y = 10
[horse2]TILE_HEIGHT = 64
[horse2]ANIMATION_TILES = 6
[horse2]ANIMATION_FRAME_DELAY = 4
[horse2]TEXTURE_FILE = horse.png

[horse3]TILE_X = 0
[horse3]TILE_Y = 20
[horse3]TILE_HEIGHT = 64
[horse3]ANIMATION_TILES = 6
[horse3]ANIMATION_FRAME_DELAY = 4
[horse3]TEXTURE_FILE = horse.png

[rabbitfarm]TILE_X = 5
[rabbitfarm]TILE_Y = 0
[rabbitfarm]TILE_WIDTH = 192
[rabbitfarm]TILE_HEIGHT = 128
[rabbitfarm]TEXTURE_FILE = rabbit.png

[snowrabbitfarm]TILE_X = 5
[snowrabbitfarm]TILE_Y = 4
[snowrabbitfarm]TILE_WIDTH = 192
[snowrabbitfarm]TILE_HEIGHT = 128
[snowrabbitfarm]TEXTURE_FILE = rabbit.png

[desertrabbitfarm]TILE_X = 5
[desertrabbitfarm]TILE_Y = 8
[desertrabbitfarm]TILE_WIDTH = 192
[desertrabbitfarm]TILE_HEIGHT = 128
[desertrabbitfarm]TEXTURE_FILE = rabbit.png

[ui_rabbitfarm]TILE_X = 8
[ui_rabbitfarm]TILE_Y = 0
[ui_rabbitfarm]TILE_WIDTH = 64
[ui_rabbitfarm]TILE_HEIGHT = 64
[ui_rabbitfarm]TEXTURE_FILE = rabbit.png

[ui_snowrabbitfarm]TILE_X = 9
[ui_snowrabbitfarm]TILE_Y = 0
[ui_snowrabbitfarm]TILE_WIDTH = 64
[ui_snowrabbitfarm]TILE_HEIGHT = 64
[ui_snowrabbitfarm]TEXTURE_FILE = rabbit.png

[ui_desertrabbitfarm]TILE_X = 10
[ui_desertrabbitfarm]TILE_Y = 0
[ui_desertrabbitfarm]TILE_WIDTH = 64
[ui_desertrabbitfarm]TILE_HEIGHT = 64
[ui_desertrabbitfarm]TEXTURE_FILE = rabbit.png

# More Animals END



Animal Entities

Towns\data\livingentities.xml

Add to end of file, before final closing tag </livingentities>:
Code: Select all
   <!-- More Animals START //-->
   <rabbit>
      <type>FRIENDLY</type>
      <name esES="Conejo">Rabbit</name>
      <altGraphics>rabbit2</altGraphics>
      <altGraphics>rabbit3</altGraphics>
      <habitat>grass</habitat>
      <habitat>grass1</habitat>
      <habitat>grass2</habitat>
      <habitat>grass3</habitat>
      <habitat>grassnoflower1</habitat>
      <attack>1d59+170</attack>
      <attackSpeed>5</attackSpeed>
      <defense>1d59+170</defense>
      <healthPoints>1d74+213</healthPoints>
      <attackVerb esES="muerde">bites</attackVerb>
      <attackVerbInfinitive esES="morder">bite</attackVerbInfinitive>
      <damage>1d44+128</damage>
      <movePCT>1d2</movePCT>
      <walkSpeed>100</walkSpeed>
      <building>rabbitfarm</building>
      <buildingTime>2880</buildingTime>
      <action>qkillrabbit</action>   
      <facingDirections>true</facingDirections>
      <drop>
         <item>bones</item>
         <PCT>100</PCT>
      </drop>
   </rabbit>
   <snowrabbit>
      <type>FRIENDLY</type>
      <name esES="Zapato de Nieve">Snowshoe</name>
      <habitat>snow</habitat>
      <attack>1d59+170</attack>
      <attackSpeed>5</attackSpeed>
      <defense>1d59+170</defense>
      <healthPoints>1d74+213</healthPoints>
      <attackVerb esES="muerde">bites</attackVerb>
      <attackVerbInfinitive esES="morder">bite</attackVerbInfinitive>
      <damage>1d44+128</damage>
      <movePCT>1d2</movePCT>
      <walkSpeed>100</walkSpeed>
      <building>snowrabbitfarm</building>
      <buildingTime>2880</buildingTime>
      <action>qkillrabbit</action>
      <facingDirections>true</facingDirections>
      <drop>
         <item>bones</item>
         <PCT>100</PCT>
      </drop>
   </snowrabbit>
   <desertrabbit>
      <type>FRIENDLY</type>
      <name esES="Algodón Cola">Cottontail</name>
      <habitat>sand</habitat>
      <attack>1d59+170</attack>
      <attackSpeed>5</attackSpeed>
      <defense>1d59+170</defense>
      <healthPoints>1d74+213</healthPoints>
      <attackVerb esES="muerde">bites</attackVerb>
      <attackVerbInfinitive esES="morder">bite</attackVerbInfinitive>
      <damage>1d44+128</damage>
      <movePCT>1d2</movePCT>
      <walkSpeed>100</walkSpeed>
      <building>desertrabbitfarm</building>
      <buildingTime>2880</buildingTime>
      <action>qkillrabbit</action>      
      <facingDirections>true</facingDirections>
      <drop>
         <item>bones</item>
         <PCT>100</PCT>
      </drop>
   </desertrabbit>
   <dragonfly>
      <type>FRIENDLY</type>
      <name esES="Anisoptera">Dragonfly</name>
      <altGraphics>dragonfly2</altGraphics>
      <altGraphics>dragonfly3</altGraphics>
      <habitat>grass</habitat>
      <habitat>grass1</habitat>
      <habitat>grass2</habitat>
      <habitat>grass3</habitat>
      <habitat>grassnoflower1</habitat>
      <habitat>jungle</habitat>
      <habitat>junglefrog1</habitat>
      <habitat>junglefrog2</habitat>
      <habitat>junglefrog3</habitat>
      <habitat>junglefrog4</habitat>
      <habitat>junglefrog5</habitat>
      <attack>1d59+170</attack>
      <attackSpeed>5</attackSpeed>
      <defense>1d59+170</defense>
      <healthPoints>1d59+170</healthPoints>
      <attackVerb esES="pica">bite</attackVerb>
      <attackVerbInfinitive esES="picar">bite</attackVerbInfinitive>
      <damage>1d44+128</damage>
      <movePCT>30</movePCT>
      <walkSpeed>75</walkSpeed>
      <facingDirections>true</facingDirections>
      <action>qkilldragonfly</action>
   </dragonfly>
   <horse>
      <type>FRIENDLY</type>
      <name esES="Caballo">Horse</name>
      <altGraphics>horse2</altGraphics>
      <altGraphics>horse3</altGraphics>
      <habitat>grass</habitat>
      <habitat>grass1</habitat>
      <habitat>grass2</habitat>
      <habitat>grass3</habitat>
      <habitat>grassnoflower1</habitat>
      <attack>1d59+170</attack>
      <attackSpeed>5</attackSpeed>
      <defense>1d59+170</defense>
      <healthPoints>1d59+170</healthPoints>
      <attackVerb esES="pica">bite</attackVerb>
      <attackVerbInfinitive esES="picar">bite</attackVerbInfinitive>
      <damage>1d44+128</damage>
      <movePCT>1d2</movePCT>
      <walkSpeed>15</walkSpeed>
      <facingDirections>true</facingDirections>
      <action>qkillhorse</action>
      <drop>
         <item>rawdeersteak</item>
         <PCT>15</PCT>
      </drop>
      <drop>
         <item>bones</item>
         <PCT>70</PCT>
      </drop>
   </horse>
   <!-- More Animals END //-->



Rabbit Farms

Towns\data\buildings.xml

Add to end of file, before final closing tag:
Code: Select all
   <!-- More Animals START //-->
   <rabbitfarm>
      <name esES="Granja de conejo">Rabbit farm</name>
      <width>3</width>
      <height>3</height>
      <groundData>1001E0111</groundData>
      <type>SPAWN</type>
      <canBeBuiltUnderground>false</canBeBuiltUnderground>
      <mustBeBuiltOver>humus</mustBeBuiltOver>
      <mustBeBuiltOver>jungle</mustBeBuiltOver>
      <mustBeBuiltOver>grass</mustBeBuiltOver>
      <mustBeBuiltOver>grass1</mustBeBuiltOver>
      <mustBeBuiltOver>grass2</mustBeBuiltOver>
      <mustBeBuiltOver>grass3</mustBeBuiltOver>
      <mustBeBuiltOver>grassnoflower</mustBeBuiltOver>
      <mustBeBuiltOver>grassnoflower1</mustBeBuiltOver>
      <mustBeBuiltOver>grassnoflower2</mustBeBuiltOver>
      <prerequisite>rmwood</prerequisite>
      <prerequisite>rmwood</prerequisite>
      <prerequisiteFriendly>rabbit</prerequisiteFriendly>
      <automatic>true</automatic>
   </rabbitfarm>   
   <snowrabbitfarm>
      <name esES="Granja de Zapato de Nieve">Snowshoe farm</name>
      <width>3</width>
      <height>3</height>
      <groundData>1001E0111</groundData>
      <type>SPAWN</type>
      <canBeBuiltUnderground>false</canBeBuiltUnderground>
      <mustBeBuiltOver>snow</mustBeBuiltOver>
      <prerequisite>rmwood</prerequisite>
      <prerequisite>rmwood</prerequisite>
      <prerequisiteFriendly>snowrabbit</prerequisiteFriendly>
      <automatic>true</automatic>
   </snowrabbitfarm>
   <desertrabbitfarm>
      <name esES="Granja de Algodon Cola">Cottontail farm</name>
      <width>3</width>
      <height>3</height>
      <groundData>1001E0111</groundData>
      <type>SPAWN</type>
      <canBeBuiltUnderground>false</canBeBuiltUnderground>
      <mustBeBuiltOver>sand</mustBeBuiltOver>
      <prerequisite>rmwood</prerequisite>
      <prerequisite>rmwood</prerequisite>
      <prerequisiteFriendly>desertrabbit</prerequisiteFriendly>
      <automatic>true</automatic>
   </desertrabbitfarm>
   <!-- More Animals END //-->



Simple Killing Actions

Towns\data\actions.xml

Add to end of file, before final closing tag:
Code: Select all
   <!-- More Animals START //-->
   <action>
      <id>qkillrabbit</id>
      <name esES="Matar">Kill</name>
      <generatedItem>bones</generatedItem>
      <priorityID>butcheringkilling</priorityID>
      <queue>
         <pickFriendly useSource="true">rabbit,rabbit2,rabbit3,snowrabbit,desertrabbit</pickFriendly>
         <wait>36</wait>
         <destroyFriendly />
         <createItem>bones</createItem>
      </queue>
   </action>
   <action>
      <id>qkilldragonfly</id>
      <name esES="Matar">Kill</name>
      <priorityID>butcheringkilling</priorityID>
      <queue>
         <pickFriendly useSource="true">dragonfly</pickFriendly>
         <wait>12</wait>
         <destroyFriendly />
      </queue>
   </action>
   <action>
      <id>qkillhorse</id>
      <name esES="Matar">Kill</name>
      <generatedItem>rawdeersteak</generatedItem>
      <priorityID>butcheringkilling</priorityID>
      <queue>
         <pickFriendly useSource="true">horse</pickFriendly>
         <wait>36</wait>
         <destroyFriendly />
         <createItem>rawdeersteak</createItem>
      </queue>
   </action>
   <!-- More Animals END //-->



Right Menu: building rabbit farms

Towns\data\menu_right.xml

Find the line for the badgerfarm, add below that line:
Code: Select all
      <!-- More Animals START //-->
      <item code="BUILD" parameter="rabbitfarm" icon="ui_rabbitfarm" />
      <item code="BUILD" parameter="snowrabbitfarm" icon="ui_snowrabbitfarm" />
      <item code="BUILD" parameter="desertrabbitfarm" icon="ui_desertrabbitfarm" />
      <!-- More Animals END //-->



Spawning on new maps

I'm no expert at balancing the amount of animals so feel free to tweak things, see the below as example values. Not all types of animals spawn on all maps, that's also a matter of taste.

Add the bits below to the end of the mentioned files, again before the final closing tags:

Towns\data\campaigns\c1\desert\gen_livingentities.xml
Code: Select all
   <!-- More Animals START //-->   
   <add>
      <entity>desertrabbit</entity>
      <qtty>25</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>
   <add>
      <entity>dragonfly</entity>
      <qtty>10</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>
   <!-- More Animals END //-->


Towns\data\campaigns\c1\jungle\gen_livingentities.xml
Code: Select all
   <!-- More Animals START //-->
   <add>
      <entity>dragonfly</entity>
      <qtty>40</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>
   <!-- More Animals END //-->


Towns\data\campaigns\c1\mixed\gen_livingentities.xml
Code: Select all
   <!-- More Animals START //-->
   <add>
      <entity>rabbit</entity>
      <qtty>15</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>
   <add>
      <entity>snowrabbit</entity>
      <qtty>5</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>   
   <add>
      <entity>desertrabbit</entity>
      <qtty>5</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>      
   <add>
      <entity>dragonfly</entity>
      <qtty>15</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>
   <add>
      <entity>horse</entity>
      <qtty>10</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>
   <!-- More Animals END //-->


Towns\data\campaigns\c1\normal\gen_livingentities.xml
Code: Select all
   <!-- More Animals START //-->
   <add>
      <entity>rabbit</entity>
      <qtty>25</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>   
   <add>
      <entity>dragonfly</entity>
      <qtty>35</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>
   <add>
      <entity>horse</entity>
      <qtty>20</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>
   <!-- More Animals END //-->


Towns\data\campaigns\c1\snow\gen_livingentities.xml
Code: Select all
   <!-- More Animals START //-->
   <add>
      <entity>snowrabbit</entity>
      <qtty>30</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>
   <add>
      <entity>horse</entity>
      <qtty>15</qtty>
      <pointx>1d200-1</pointx>
      <pointy>1d200-1</pointy>
      <level>1d11</level>
   </add>
   <!-- More Animals END //-->



That should be it, let me know if I missed anything.

Hope you'll enjoy it, have fun!
User avatar
Effix
 
Posts: 178
Joined: Mon Jun 18, 2012 11:18 am
Location: The Netherlands

Return to Released mods

Who is online

Users browsing this forum: No registered users and 4 guests