How to add custom Creatures - dkfans/keeperfx GitHub Wiki

Introduction

This page will explain how to add a downloaded creature to your game. Do this if:
a) You're a mapmaker and want to include a new creature on your map.
b) You just like a creature from the workshop and you want to include it in your own game.

In case of scenario B, please consider downloading a map with this creature already included instead. Creatures posted on the workshop are for use by mapmakers. If you insist on adding it to your game anyway, please read on.

Overview

Creatures are added to your game by name. It is important to consistently use this name in all locations. This wiki page will assume you will add a unicorn. But if you add a different creature, change where it says unicorn to the name of your creature instead.

To add a creature to your game these things are needed:

  1. Place unicorn.cfg in the CREATURES_LOCATION.
  2. Place unicorn.zip in the CONFIGS_LOCATION.
  3. Add UNICORN to the Creatures list in creature.cfg in the CONFIGS_LOCATION.
  4. Add a lair to objects.cfg in the CONFIGS_LOCATION.
  5. Add the display name to the language specific String dat file in the [strings] location.
  6. The unicorn needs to be added to the level script of every map you want it to appear on, in every campaign you want it.

Information on how files are stacked in keeperfx, can be found here.

Adding it to your game

Note: If you add the creature to the entire game, instead of just to your own map or campaign, you will need to redo some of these steps each time you update to a new alpha patch.

1) From your download, find unicorn.cfg and place it into the /creatrs/ folder inside your keeperfx directory. You can further edit this file to tweak the stats and abilities of the unicorn to your liking.
2) From your download, find unicorn.zip and place it into the /fxdata/ folder inside your keeperfx directory. Do NOT unzip it further, keeperfx will read the zip file directly. This is the file where all Sprites (images) are stored.
3) Open /fxdata/creature.cfg with a text editor. Add the creature name in capitals to the end of the list of creatures. Like this:

Creatures = WIZARD BARBARIAN ARCHER MONK DWARFA KNIGHT AVATAR TUNNELLER WITCH GIANT FAIRY THIEF SAMURAI HORNY SKELETON TROLL DRAGON DEMONSPAWN FLY DARK_MISTRESS SORCEROR BILE_DEMON IMP BUG VAMPIRE SPIDER HELL_HOUND GHOST TENTACLE ORC FLOATING_SPIRIT TIME_MAGE DRUID BIRD MAIDEN SPIDERLING UNICORN

If you want to (also) add it to a specific campaign that already has custom creatures, find the creature.cfg specific to this campaign and add it there too/instead. 4) Open /fxdata/objects.cfg with a text editor and add the lair object to the bottom. If the object is provided with the download, use it. Otherwise it should be something like this:

[object250]
Name = LAIR_UNICORN
Genre = LAIR_TOTEM
AnimationID = UNICORN_LAIR
AnimationSpeed = 12
Size_XY = 0
Size_Z = 0
MaximumSize = 300
DestroyOnLava = 0
DestroyOnLiquid = 0
RelatedCreature = UNICORN
Health = 0
FallAcceleration = 0
LightUnaffected = 0
LightIntensity = 0
LightRadius = 0
LightIsDynamic = 0
DrawClass = 2
Persistence = 2
Immobile = 0
Properties = EXISTS_ONLY_IN_ROOM DESTROYED_ON_ROOM_CLAIM DESTROYED_ON_ROOM_PLACE
UpdateFunction = UPDATE_OBJECT_SCALE

Be sure the number in [object250], in this example 250, is unique.

5) Download the String editor from the workshop. Use it to open fxdata/gtext_eng.dat in case you are playing in English, or another gtext file if you are not.

To this file, add the name of your choosing. This can be 'Unicorn' in your language, but it may also be 'Narwhal`, whatever you want to show up in game. Remember the number of the string you add.

Open /fxdata/unicorn.cfg with a text editor and find. NameTextID = near the top. Put in the string number there.

6) Now decide which maps you want the unicorn to appear on. They need to be added to the creature pool of those maps, and be made available to the player.

If you want to add unicorns to Tickle, open /campgns/keeporig/map00008.txt with a text editor, and find the correct locations to add these 2 lines:

ADD_CREATURE_TO_POOL(UNICORN,10)

CREATURE_AVAILABLE(ALL_PLAYERS,UNICORN,1,0)

You can also open maps in the Unearth level editor and simply place down some unicorns.

Adding it to your campaign

Adding the creature to a specific campaign or mappack is the recommended way to add new creatures. Adding it to single maps is possible too. Understanding how KeeperFX stacks files/configs is helpful, see here.

In your campaign config file you will find the locations for each of the files.

1) From your download, find unicorn.cfg and place it into the CREATURES_LOCATION folder. You can further edit this file to tweak the stats and abilities of the unicorn to your liking.

2) From your download, find unicorn.zip and place it into the CONFIGS_LOCATION folder. Do NOT unzip it further, keeperfx will read the zip file directly. This is the file where all Sprites (images) are stored.

3) Make a creature.cfg file in the CONFIGS_LOCATION and make sure it has the Creatures list with the your creature name included.Add the creature name in capitals to the end of the list of creatures. Like this:

Creatures = WIZARD BARBARIAN ARCHER MONK DWARFA KNIGHT AVATAR TUNNELLER WITCH GIANT FAIRY THIEF SAMURAI HORNY SKELETON TROLL DRAGON DEMONSPAWN FLY DARK_MISTRESS SORCEROR BILE_DEMON IMP BUG VAMPIRE SPIDER HELL_HOUND GHOST TENTACLE ORC FLOATING_SPIRIT TIME_MAGE DRUID BIRD MAIDEN SPIDERLING UNICORN

4) Make an objects.cfg file in the CONFIGS_LOCATIONadd the lair object. If the object is provided with the download, use it. Otherwise it should be something like this:

[object250]
Name = LAIR_UNICORN
Genre = LAIR_TOTEM
AnimationID = UNICORN_LAIR
AnimationSpeed = 12
Size_XY = 0
Size_Z = 0
MaximumSize = 300
DestroyOnLava = 0
DestroyOnLiquid = 0
RelatedCreature = UNICORN
Health = 0
FallAcceleration = 0
LightUnaffected = 0
LightIntensity = 0
LightRadius = 0
LightIsDynamic = 0
DrawClass = 2
Persistence = 2
Immobile = 0
Properties = EXISTS_ONLY_IN_ROOM DESTROYED_ON_ROOM_CLAIM DESTROYED_ON_ROOM_PLACE
UpdateFunction = UPDATE_OBJECT_SCALE

Be sure the number in [object250], in this example 250, is unique and also does not overwrite an object from fxdata/objects.cfg you will use on your campaign. The exact name to use for the AnimationID should be provided on the download, if not, find it in the sprites.json inside unicorn.zip.

5) Download the QUICK to Pot to DAT tool from the workshop and use it on your campaign maps. Once it created a .pot file for you, edit it with a text editor and add a string for your creature to it. This file may be used to translate your campaign, including your unicorn.

This string is the display name of your choosing and does not need to be Unicorn. It can be any string of your choosing. Remember the number of the string you add.

Open the unicorn.cfg again and on NameTextID = add the string number.

6) Now decide which maps you want the unicorn to appear on. If you restart unearth and open a map from your campaign you can place the unicorn from there. You can also make them available through script like other units by using the name UNICORN. Be sure that inside your unicorn.cfg file, the name matches:

[attributes]
Name = UNICORN

Other names, like AUNICORN would fail. Be sure to correct this to UNICORN and post your complaint on the workshop where you downloaded this creature.