ZT2 Download Library Wiki
Advertisement

This article will teach you the basics of ZT2 files, including how they work and how to edit them, from modifying mods to your liking, to creating new content.

Basics[]

Needed programs[]

These are the different programs you will need to be able to edit ZT2 files at all. Mandatory programs you will absolutely need if you want to do anything, while optional programs will be needed if you want something more specific, such as editing models and textures.

Mandatory programs[]

Any zipping program:
Options: Winzip, Winrar, 7-Zip
We use any of these to open compressed files which contain other files or folders inside (.z2f, .zip, .rar, .z2s).

Any text editor:
Options: Windows Notepad, Word, Notepad++, Visual Studio Code
We use any of these to open and edit text files, which is the majority of files (.xml, .beh, .tsk, .bfm, .bfmat, .txtkeys, .lua). Most text editors have a built-in search function (often Ctrl + F) which can be useful to look for the text of interest.

Optional programs[]

Any image editor:
Options: Adobe Photoshop (.dds plug-in), GIMP (.dds plug-in), Paint.net , Krita, others
We use any of these to edit texture files, including skins and icons (.dds). Depending on the program of your choice, you might need some addon or plugin to be able to open .dds files. Alternatively, you can use the lightweight program DXTBmp to convert other image formats such as .bmp into .dds.

Nifskope
We use this program to view model files (.nif) and make minor edits to them.

Blender
We use this program with community-made add-ons to view model files (.bfb for 2.79 or .nif for 2.8) and edit or create new models.

Type of files[]

File extension Description Program used to open it
.z2f ZT2 file, placed in ZT2 folder to add content to the game. Contains folders inside. Zipping program
.zip Compressed file, contains files inside Zipping program
.rar Compressed file, contains files inside Zipping program
.z2s Saved ZT2 file (map)
  • ZT2 (playing)
  • Zipping program (checking contents)
.xml
  • AI files containing info about entity
  • Language files
  • Others
Text editor
.beh Contains entity behaviors (actions). It is an extension of the XML format. Text editor
.tsk Contains entity tasks (context about executing actions). It is an extension of the XML format. Text editor
.bfm Links model and animations Text editor
.bfmat Links texture to model (.bfb only). It is an extension of the XML format. Text editor
.txtkeys Animation info (e.g. sound, item spawn). It is an extension of the XML format. Text editor
.lua Lua script file, used for defining functions. Zoo Tycoon 2 uses a modified Lua 5.0.2 interpreter. Text editor
.nif Model file
  • Nifskope (viewing, minor edits)
  • Blender 2.49 (editing)
.bfb Model file Blender 2.78+ with BFB scripts
.bf Animation file Blender 2.78+ with BFB scripts
.dds Texture file (image) Image editor
.mp3 Compressed audio file (sound) Audio editor (must be mono and in 16-bit)
.wav Audio file (sound) Audio editor (must be mono and in 16-bit)

Opening ZT2 files[]

The first time you open a new file extension (like .z2f) with these programs, you will need to:

1. Right click the file, go to Open with…
2. Choose your program of choice
3. Browse for it if not on the list. If you check the box to “always use this app to open this kind of file!, the icons will change to match your zipping program and you will be able to open them by just double-clicking in the future.

Opening z2f first time

Opening a .z2f for the first time using winrar.

Please note that you will not be able to save changes on a file if it's in the ZT2 folder (as it's a program folder). First move the file to your desktop or any other folder, edit it, and then move it back to your ZT2 folder.

.z2f file structure[]

A .z2f file is essentially a .zip (compressed file) with folders inside it. These folders follow a certain structure to organize text, model and texture files for the game to read them. When you want to edit something, you need to know where to find it. This is a general layout, most .z2f files will only contain a smaller number of only relevant folders (for example, a typical single animal file only contains ai, entities, lang and ui, and their respective subfolders).

 ai
   tasks
     animals/guests/objects/etc 
➔ Here you will find behaviors (.beh) and tasks (.tsk) , meaning actions done by animals and guests (such as eating or drinking), and relating to certain objects (like using a certain shelter, building or toy).
 biomes
➔ Here you will find the main coding and texture files for biomes.
 effects
➔ Here you will find particle effects applied to entities. These include wind, glowing, fog, reflections, and water ripples.
 entities
  devobj
➔ Here you will find developer objects.
  objects
   enrichment/fences/foliage/rocks/scenery/eggs etc.
    ai
➔ Here you will find the ai files (.xml) containing basic information for objects, such as fences being see through, objects being water placeable, foliage and rock biomes, etc.
    (Object codename)
➔ Here you will find folders for each object containing models (.bfb or .nif) and textures (.dds).
     Materials
➔ The Materials folder is only present when there is a .bfb model, and contains the .bfmat text files linking textures to it.
  sound
➔ Here you will find .xml files linking animations and sounds, e.g. playing a roar sound when the animal roars.
  transportation
➔ Here you will find coding for vehicles, tracks, stations and gates (e.g. jeep, skytram).
  units
   animals
    ai
➔ Here you will find the main animal ai files (.xml) containing their basic information, from taxonomy to diet, conservation status, biome, etc.
    (Animal codename)
➔ Here you will find models (.nif or .bfb), texture files (.dds), the .bfm files, and, if applicable, animations (.bf) and sound files (.wav), in their separate “sound” folder.
     Materials      ➔ The Materials folder is only present when there is a .bfb model, and contains the .bfmat text files linking textures to it.
   guests
   staff
lang
 Number code, e.g. 1033
➔ Here you will find language files, containing all text shown in-game, from entity names to zoopedia entries and interface text. The number code denotes game language, 1033 being the code for English.
locations
➔ Here you will find location files (.xml), which contain the basic information of world map locations used by animals, foliage, and certain other objects like the geyser and tar pit.
maps
 default
➔ Here you will find files for maps used for the Challenge and Freeform modes, including the image they use for the selection menu and data for what entities exist on the map when first opening it.
 scenario
➔ Here you will find maps used for the Scenario mode, including the image they use for the selection menu and data for what entities exist on the map when first opening it.
scenario
 campaign
➔ Here you will find the layout for scenarios, which tells the game how they’re presented in the scenario selection menu.
 goals
➔ Here you will find the coding that tells the game what objectives need to be completed to progress through a scenario in Scenario Mode.
  challenge
➔ Here you will find the coding that tells the game what objects need to be completed to beat a challenge in Challenge Mode.
  scripts
ui
 fx
  selection
➔ Here are the selection icons (.dds) shown on the floor when selecting an animal in-game.
 icon_maplocations
➔ Here are the map location icons (.dds) shown in the animal buying menu, information panel and zoopedia.
 loading
➔ Here are loading bar images (.dds) shown randomly when a map is loading.
 mainmenu
➔ Contains the images used as randomly set backgrounds when on the main menu.
 sound
➔ Contains the config.xml file, which determines in-game sounds, from object placement to main menu music.
 template
➔ Contains the purchaseicon.xml file, determining the small expansion icons shown at the top left corner of entity icons in the buying panel.
 zoopedia
  entries
➔ Here are simple text files that make zoopedia articles functional and direct to their correct section (e.g. animals, foliage, etc.).
world
 ambients
➔ Here you will find the coding that tells the game what ambients appear in certain types of maps (ex. rock crabs will spawn in benthic and coastal maps)
 soundtags
➔ Here you will find the coding that tells the game what ambient sounds play in certain types of maps (ex. sparrow and tumbleweed sounds play in savannah maps)
xpInfo
➔ This folder contains .xml files used for expansion icons to show up in the main menu. Some usermade expansions include their own icons as well.
shared
➔ Shared folders can be located inside any folder (or none) and simply contain assets such as skins or models used by multiple entities. For example, a shared subfolder under the animals folder contains a teeth texture used by various animals. Some vanilla animals like the African wild dog and Przewalski’s wild horse have their main textures stored here too.


Codenames[]

A codename is the name that an entity (object, animal, etc.) uses in its coding files. They can’t have any special characters or spaces. Official animal codenames use the species name first, such as TigerBengal or BearPolar. For usermade content, codenames have some variation since they depend entirely on the creator, but they will usually follow this convention.

If you are editing the coding of an existing entity, you have to make sure to keep the codename consistent through all files, or it won’t work properly.

File order[]

When adding content to the game, you should always keep in mind that .z2f files are read in alphabetical order, and if two of them contain files with the same name, the last one read is the one that will take effect in-game. This is how remakes, reskins and other edits to original and usermade content work.

For example, let’s say we have two files, one reskins the lion to have a red skin, the other to have a blue skin, like this:

BlueLion.z2f

RedLion.z2f

Because Red is at the bottom in alphabetical order, when opening the game the lion will be red. If we want it to be blue, we have to rename the BlueLion file so it is below RedLion in alphabetical order. The easiest way to do it is to add “z” at the start, like this:

RedLion.z2f

zBlueLion.z2f

Now the lion will look blue in-game. This is something you have to keep in mind as often different .z2f files will contain the same files which can cause conflicts. At the same time this allows you to add edits (such as reskins) in separate files, instead of directly editing the original file, which can be useful in case you want to revert the change and have your original lion skin back.

XML hierarchy[]

One thing to note when editing .xml files, is that changes on an upper level affect all files on a lower level, and also, changes on a lower level override changes on the upper level. To explain this, let’s look at the structure of the adult male lion as an example. At the top of Lion_Adult_M.xml, you will see this tree:

<BFTypedBinder binderType="Lion_Adult_M">
  <types>
    <entity>
      <actor>
        <animal>
          <Mammalia>
            <Carnivora>
              <Felidae>
                <Lion>
                  <Lion_Adult>
                    <Lion_Adult_M/>
                  </Lion_Adult>
                </Lion>
              </Felidae>
            </Carnivora>
          </Mammalia>
        </animal>
      </actor>
    </entity>
  </types>
...

You can see that Mammalia is a sublevel of animals, Carnivora is a sublevel of Mammalia, etc. Likewise, Lion_Adult is a sublevel of Lion. This means that anything we code on Lion.xml, will affect all lions (adult male, adult female, young male and young female, and more if existing), but if we code something else on Lion_Adult_M.xml, it will overwrite the coding above it, for adult males only.

So following the colored example above: if we make the lion use a blue skin in Lion.xml, all lions will be blue. But if we then also code Lion_Adult_M.xml to use a red skin, then the result will be blue females and young, and a red adult male.

In object-oriented programming terms: the XML files contain class definitions and the types element defines the whole inheritance chain of the class.

Useful websites[]

xml validation
A very useful website to quickly check for syntax mistakes in xmls and other text files before or after you edit them. A faulty file can result in animals not appearing ingame, crashing the game, having no name, or otherwise not working properly.
To use, simply copy and paste your text from a .xml, .beh or .tsk and click Validate. If you get "No errors were found", you're good. If there is an error in the file, click on the red X icon to find the problematic line and review it.

Text Compare
A simple website where you can paste the text from two files to compare differences. Very useful when you are looking through multiple versions of the same file, such as in hacks or remakes, or at a version of a file that is working versus one which is not.

Free Online Audio Converter
If you want to add new sounds to the game, you can use this website to convert them so they will properly play in-game (set channels to Mono and quality to 16).

General file editing[]

Finding files[]

If you are editing user-made content then finding them is pretty simple, just locate the .z2f file you downloaded and ignore this section. However, finding original game files can be more difficult as they are spread between multiple files, and depending on your game version (5 discs, Zookeeper Collection or Ultimate Collection), names will be different.

Also note that for Zookeeper Collection and 5 discs, the lowest files on the list often contain patched or updated versions of files (e.g. variants, sick and dirty skins, updated behaviors from newer expansion packs, etc.), so it’s in your best interest to find the most up to date version to edit.

File layout (Ultimate Collection)[]


x300_000.z2f - ZT2 files
x301_000.z2f - ES, AA, MM files
x302_000.z2f - EA files

File layout (Zookeeper Collection)[]


x001_000.z2f - ZT2 patch 1
x003_000.z2f - ZT2 patch 3
x120_000.z2f - ZT2 patch 5
x120_100.z2f - ES patch 2
x121_000.z2f - AA patch 1
x150_000.z2f - ZT2 files
x151_000.z2f - ES, AA files
x200_000.z2f - MM files
x200_100.z2f - ZT2 patch 6
x201_100.z2f - ES patch 3
x201_110.z2f - AA patch 2
x202_000.z2f - MM patch 1
x210_00.z2f - EA files

File layout (5 disc version)[]


ai.z2f - ZT2 ai files
awards.z2f - ZT2 award files
biomes.z2f - ZT2 biome files
config.z2f - ZT2 config files
entities.z2f - ZT2 entities files
lang.z2f - ZT2 lang files
location.z2f - ZT2 location files
maps.z2f - ZT2 map files
photoch.z2f - ZT2 photo challenge files
scenario.z2f - ZT2 scenario files
shared.z2f - ZT2 general shared files
sound.z2f - ZT2 sound files
ui.z2f - ZT2 ui files
world.z2f - ZT2 world files
x001_000.z2f - ZT2 patch 1
x002_001.z2f - ZT2 patch 2
x003_000.z2f - ZT2 patch 3
x100_000.z2f - ES files + ZT2 patch 4
x101_000.z2f - ES patch1
x110_000.z2f - AA files
x120_000.z2f - ZT2 patch 5
x120_100.z2f - ES patch 2
x121_000.z2f - AA patch 1
x200_000.z2f - MM files
x200_100.z2f - ZT2 patch 6
x201_100.z2f - ES patch 3
x201_110.z2f - AA patch 2
x202_000.z2f - MM patch 1
x210_00.z2f - EA files

If you are loking for bonus download files (Black leopard, Asian elephant, scenery packs etc.), those are located in a different folder: C:\ProgramData\Microsoft Games\Zoo Tycoon 2\downloads

Extracting .z2f files[]

As stated above, .z2f files are simply a collection of zipped folders. If you want to extract the contents, simply open a file with your zipping program of choice and either right click it and extract, or drag the contents out of the zipped folder, much like a regular .zip file.

Creating .z2f files[]

There are several ways to create a .z2f file, all have the same result. Always making sure the folder structure is correct, as having extra or missing folders will make the file not work properly.

Option 1: Create .z2f from existing folders.

With this method, we will do most of the editing on the regular file browser, and only use our zipping program to create a .z2f file at the end. Once you're done, select all your topmost level folders (ai, entities, units, lang, etc.) and right click, and use your zipping program to add them to a new archive. Make sure the file format is .zip (not .rar or anything else), and on the new file name, write .z2f at the end before clicking OK.

Creating z2f

Creating a .z2f file from existing folders using 7-Zip. Other zipping programs are very similar.

Option 2: Create a .zip and rename it.

Follow these steps:

Option 3: Use an existing .z2f file

Not very elegant, but you can simply take an existing .z2f file, delete its contents and rename it, to get an empty .z2f file. You can then start making the appropiate folders inside, much like in option 2.

Creating a Patch/Hack[]

Because of how .z2f files are read, it's possible to make modifications such as changing an animal's size, biome, etc. without actually editing the original file (see File order section for more info), which are usually referred to as "patches" or "hacks". This is often desirable if you want to a) modify base game content without touching base game files, b) create a patch that can be moved removed or added back as you please, or c) create a file for sharing which does not include the original work.

Follow any of the options above to create a new .z2f file. After that, get the appropiate files from your base animal (or item). If it's usermade it will be easy to locate, if you are editing base game content see Finding files section on where to locate them.

For example, let's say we want to resize the adults of the original Carnotaurus, and we have Zoo Tycoon 2: Ultimate Collection. Following the finding files section, we will find the EA animal files in a file called x302_000.z2f in ur ZT2 folder. To resize the adult, we will need all Adult xmls (since this animal has sexual dimorphism; male and female are different sizes), and since it has Supers, we also want to edit those. Following the .z2f file structure, we will find the animal's xmls in entities/units/animals/ai.

We can now edit these xml files to our liking using our text editor of choice. Following the resizing example, we would edit the animal's ingame scale, (See Resizing section). After we're done, we add these edited xmls to the appropiate folder route (again; entities/units/animals/ai) in our new .z2f file. Then we can move this file to our ZT2 folder to try the changes in-game - don't forget to add enough zzzz so your patch is after the original file in alphabetical order, otherwise the game will not read your edits.

Combining and splitting files[]

You can merge and extract contents from .z2f files. This can be useful in case you want to have all animals or objects of a certain kind in a single file, or if you want to extract a single item of interest from a bigger pack and you’re not interested in the rest. Please note that merging files can be a lot of work to undo, so saving the original separate .z2f files somewhere is recommended.

Splitting files[]

To extract content from a bigger file, the simplest solution is to duplicate the file, and then on the new one delete everything that you do not want on it. Most file and folder names are pretty self-explanatory, you can also look at the file structure above if you're not sure where to find certain files.

Here is an example of file splitting. In this scenario we want to isolate only the Shoebill stork from the Aves pack, which also contains several other animals and objects:

Basic splitting[]

These are the absolute minimum steps to remove content from a bigger file. The animals or items you remove will no longer appear ingame, but there will be some leftover files. This is only recommended to do for files that add new content to the game.

Advanced splitting[]

This method will delete all unnecessary files. You will need to go through more folders and delete more files, but the benefit is the resulting file will be smaller and less prone to cause conflicts. Because of this, this is the most desirable method, and in particular recommended when you are dealing with remakes or hacks that affect base game content or other mods.

Alternatively, instead of deleting you can extract only the files of interest from the original file and zip them into a new .z2f, you just need to make sure you’re not missing any of the needed files or the new file might not work properly.

Merging files[]

To merge two files, it’s even easier, you can simply open both .z2f files at the same time and drag the contents of one into the other so they are combined.

Here is an example of file merging. In this scenario we want to merge a Black-backed Jackal and a Spotted Hyena, both standalone animals, into the same file.

Alternatively you can also extract contents from both, combine their folders, and rezip them into a new .z2f as explained above.

Combining hacks/patches[]

Often you will find two files, such as hacks, patches, variants, etc., that edit the same file and as such conflict with eachother. Often you can combine these in a single file to have both effects ingame. For example, let's say we have both a biome hack and a variant for Ring-tailed Lemur (Aurora Designs).

Open both .z2f files and look for the conflicting file (a file that exists in both .z2f files). In the example we can see both edit the main .xml of the animal (entities/units/animals/ai/LemurRingtailed.xml).

Create a new .z2f and merge the two .z2f files, but keep the conflicting .xmls in mind.

Now open both .xml files (from the original biome hack and variant) and compare their text. To do this, you can use the website [1]. It will highlight the differences between them.

Text Comparison

Using text-compare.com to compare two text files.

Now on your new file, add the changes from the second .xml file, using the text comparison as a guide. In the example above, we will change the text on the left (variant), moving primary="true" from scrub to tropicaldryforest, so it matches the text on the right (the biome hack). Thus we will end up with a file that includes both the variant and the biome change.

Language files[]

Language or lang files are .xml files that contain all text displayed in-game, from what entities are called in the menus, descriptions, Zoopedia entries, to interface text, animal and guest actions, etc. Zoo Tycoon 2 supports a variety of languages, which are noted by the following folder names which consist of a decimal Windows Locale Code (LCID, inside the lang folder:

For a full list of locale IDs see: w:c:zt2modding:Locale ID.

  • 1028 - Chinese
  • 1031 - German
  • 1033 - English
  • 1036 - French
  • 1040 - Italian
  • 1041 - Japanese
  • 1042 - Korean
  • 1043 - Dutch
  • 1045 - Polish
  • 1046 - Portuguese (Brazil)
  • 1053 - Swedish
  • 2070 - Portuguese (Portugal)
  • 3082 - Spanish

If you want to change an animal or object’s in-game name, you simply need to edit the appropriate lang file, found in lang/(LCID).

A common issue with ZT2 mods is that some of them are textless in-game. This is usually because they are missing a language file in your game language, or have none at all. You can solve this by adding it for your game language.

If the original file already has a lang folder with one or more language codes inside it (usually they will have 1033 which is English, and/or the creator’s own language), you can simply duplicate the folder and rename it to your game’s language code. This will make the text show up in-game, but it will still be in its original language. If you want it in a different language, you will have to open the .xml file and manually translate it.

If there is no lang file at all, you can create the needed folders and copy a working lang file from a different entity, then simply replace the codename and display text.

XML Validation[]

Validating an xml means making sure that the coding syntax is correct on an xml (and also other text files such as .beh, .tsk and .bfm). For example, if you have this:

<b>Text<b>

It would be incorrect, as the correct syntax is this (note the / before the second b):

<b>Text</b>

These simple mistakes can make the game not recognize the file at all, resulting in entities being missing, invisible, unmoving or unnamed, among other issues.

Thankfully you don't have to manually check for these mistakes, as several tools can do it for you. A simple method is using the following website: https://www.xmlvalidation.com/

Just paste your text there (or upload the file). You can use this example lang file text to try it out:

   <entityname>
      <TigerBengal>Bengal Tiger</TigerBengal>
      <TigerBengal_stt>Bengal tiger</TigerBengal_stt>
      <TigerBengal_lower>the Bengal tiger</TigerBengal_lower>
      <TigerBengal_ltt>
         <color r="255 g="248" b="178">
            <b>Bengal Tiger</b>
         </color>
         <br/>
         Click here to select and place a Bengal tiger.
      </TigerBengal_ltt>
   </entityname>

If there is a mistake, you will see an error message such as the following:

XML Validation ex

You will see a description of the problem and its location. Click the red X icon to jump to the location, then look for the issue.

In the example, the problem is a missing " after 255, so we add it and validate again, until the website says "No errors were found".

Please note that xml validation cannot detect all problems in an xml. For example, if you misspell a model name (e.g. linking to TigrBengal instead of TigerBengal), this method won't detect it, as the syntax is still correct.

What files to validate[]

Problem File(s) to validate
Entity doesn't show up in buying panel Codename.xml (and subsequent xmls)
Birth/hatching crashes the game Codename_Young.xml (and subsequent xmls)
Entity is invisible Codename.xml, Codename.bfm
Animal doesn't move Codename.beh, Codename.tsk
Animal performs only basic behaviors Codename.tsk
Name is missing Lang files
Zoopedia is missing Lang files
Animal is silent Sound xml

But of course, validating more files never hurts.

Other methods for validating[]

You can also try opening the xml file with an internet browser (e.g. Google Chrome), and you will get an error message if there is a mistake in the file.

If you are using Notepad++, you can also use the plugin "XML Tools" to validate xml files.

Product filter[]

The expansions in Zoo Tycoon 2 use different filters to designate which expansion something comes from. Here’s a list of recognized product filters in the vanilla game:

  • Zoo2 - Zoo Tycoon 2 Content
  • Downloads - Downloaded Content
  • EndangeredSpecies - Endangered Species Content
  • CP1 - African Adventure
  • PDLC1 - Dino Danger Pack
  • Marine - Marine Mania
  • Extinct - Extinct Animals

Many mods use custom product filters, which have their own lang files for recognition. Some modders will include the filter-text by itself to minimize the space a pack uses.

If there is no product filter, the content will appear under the Zoo Tycoon 2 Content filter.

Animal editing[]

Change biome compatibility and main biome[]

Go to entities/units/animals/ai and open Codename.xml

Search for: primary="true"

You will see a list like this one:

 <alpine sensitivity="10" primary="true"/>
 <borealforest sensitivity="2"/>
 etc.

In this example the animal's main biome is alpine. To change it to boreal, we would remove primary="true" from alpine, and add it to boreal. If you want your animal to be fully satisfied in the new biome, also change the sensitivity to 10. (-10 is completely red, 0 is almost yellow, 10 is completely happy).

The result would be:

 <alpine sensitivity="10" />
 <borealforest sensitivity="10" primary="true"/>

If you want to add custom biomes, look for the biome codenames in the mod files, and add them to the biome list.

Please note that this will not affect the biome shown in the Zoopedia, which is edited in the lang file.

Resizing[]

Go to entities/units/animals/ai

You will need to edit different xmls depending on the animal you are editing. Normally you will use Codename_Adult.xml or Codename.xml, and Codename_Young.xml (+ more if custom life stages, or multiple models). But if male and female use different models or are a different size, you will need to open Codename_Adult_F.xml and Codename_Adult_M.xml. Also, Super animal xmls always include a scale.

Look for: BFActorComponent

You will find a line similar to this:

 <BFActorComponent actorfile="entities/units/animals/Codename/Codename_Adult_F.bfm" scale="0.8"/>

Change the number in scale="X" for a bigger or smaller number. It might take some trial and error until the animal is the size you want. Repeat the process for all other xml files which include this line.

Change in-game name[]

You can do this to either change the animal's name to something else, or translate it if you edit the rest of the text as well.

Go to lang/(number code for your language)

Open the .xml file inside, usually it will be called Codename_strings.

You will see something like this:

      <Codename>In-game Name</Codename>
      <Codename_stt>In-game name</Codename_stt>
      <Codename_lower>the in-game name</Codename_lower>
      <Codename_ltt>
         <color r="255" g="248" b="178">
            <b>In-game name</b>
         </color>
         <br/>
         Click to select and then place a in-game name.

You will need to change the in-game name. Don't touch the codename.

Some lang files also include the name for items related to the animal (such as eggs or gifts).

If you wish you can also edit the Zoopedia text, which will either be in the same file below this text, or in a different file called Codename_entries. Please note that the conservation status, biome, location, etc. in the Zoopedia will need to be edited separately from the data in the main xml.

Change conservation status[]

Go to entities/units/animals/ai and open Codename.xml

Search for: s_Endangerment=

Change the conservation status between "" to one of the following:

  • LowRisk
  • Vulnerable
  • Endangered
  • Critical
  • Extinct

Change fame level requirement[]

Go to entities/units/animals/ai and open Codename.xml

Search for: f_adoptRarity=

Change the number between "" according to the following table:

Zoo Fame Stars adoptRarity number
.5 1
1 20
1.5 30
2 40
2.5 50
3 60
3.5 70
4 80
4.5 90
5 100

Change price[]

Go to entities/units/animals/ai and open Codename.xml

Search for: ZTEconomyComponent cost=

Change the number between "" to the price you want. For reference, here are the default prices depending on fame requierement. Note that extinct animals are more expensive at the same fame level:

Fame requirement Price Price (extinct)
.5 1250 3000
1 2000 5500
1.5 3000 7500
2 5500 10000
2.5 7500 15000
3 10000 20000
3.5 15000 35000
4 20000 45000
4.5 35000 60000
5 50000 80000

Change codename[]

Changing an animal's codename can be useful to:

  • Create a new separate entity from it that does not conflict with the original
  • Solve conflicts between two mods using the same codename
  • Change its position in the buying panel
  • Turn a new animal into a remake (or viceversa)
    • Please note, if you want the animal to be a remake, will need to change the its codename so it matches perfectly with the official animal's codename (for example, a tiger remake would need too be recoded exactly as TigerBengal).

To change the codename, follow these steps:

  • 1. Go to ai/tasks/animals:
    • Rename Codename.beh and Codename.tsk.
    • Open both .beh and .tsk with a text editor and replace the old codename with the new one.
  • 2. Go to entities/units/animals:
    • Rename the Codename folder.
    • Open that folder, rename all files inside (.nif or .bfb, .bfm, .dds) with the new codename.
    • Open the .bfm with a text editor and replace the codename inside as well.
      • Note: For remakes, if the base animal uses a .bfb model and the new model is a .nif, you will need to rename the .nif to something else (such as CodenameRemake), then also change it to match on the .bfm. The rest of the coding can stay the same.
    • 2.5 If the model is a .bfb file, go to entities/units/animals/Codename/Materials (this folder does not exist for .nif files)
      • DO NOT rename the .bfmat file, but open it. Look for this line <param name="Texture0" type="texture"> and change the name to match the skin (without .dds at the end).
  • 3. Go to entities/units/animals/ai:
    • Rename all xml files with the new codename.
    • Open all xml files with a text editor and replace the codename inside as well.
  • 4. Go to lang/(language number code)
    • Rename the xml(s) inside, open it and also replace the codename inside, and change the in-game name if you wish.
    • Note: For remakes you can simply delete the lang folder, it will use the base game files.
  • 5. Go to ui/zoopedia/entries
    • Rename Codename_entries, open it and also replace the codename inside.
    • Note: For remakes you can simply delete the ui folder, it will use the base game files.

Change space requirements[]

Note: If you are just looking to remove space requirements from your animals, there are mods available that do so for all animals, such as Happy Animals Hack (Thom) and Placement Hack (Collar), so consider them instead.

Go to entities/units/animals/ai/Codename.xml

Look for: f_Required

For terrestrial animals, edit the following:

 f_RequiredInitialSpace="X" f_RequiredAdditionalSpace="X"

For tank animals, edit the following:

f_RequiredInitialTankSpace="X" f_RequiredAdditionalTankSpace="X" f_RequiredTankDepth="X"

Numbers represent in-game grid squares. Intitial space refers to the space needed for the first animal in the exhibit, and additional space refers to the extra space needed starting from the second animal.

Change diet[]

Go to entities/units/animals/ai/Codename.xml

You will find one or more tags relating to diet, for example

b_Carnivore="true"

Follow the table below to add or remove items from the animal's diet.

Food Type Tag
Apples b_Frugivore="true"
Bamboo b_BambooEater="true"
Bananas b_Frugivore="true"
Berries b_BerriesEater="true"
Branches b_Folivore="true"
Chum b_MarineCarnivore="true"
Cycad Leaves b_Folivore="true"
Dinosaur Meat b_Carnivore="true"
Eucalyptus b_EucalyptusEater="true"
Fish (land) b_Piscivore="true"
Fish (water) b_MarinePiscivore="true"
Grass b_Graminivore="true"
Hay b_Granivore="true"
Honey b_HoneyEater="true"
Insects b_Insectivore="true"
Jellyfish b_JellyfishEater="true"
Lettuce b_Ambivore="true"
Meat b_Carnivore="true"
Roots b_Radicivore="true"
Seaweed b_Fucivore="true"
Shellfish b_Cancrivorous="true"
Shrimp b_Crustacivore="true"
Squid b_SquidEater="true"
Zooplankton b_Planktivore="true"

Please note that these will affect only the "animal food" eaten by the animal. It won't affect the usage of enrichment food items like the beef shank or apple treat, or food-related behaviors such as hunting or grazing.

Change movement or speed[]

Do this to change how fast or slow an animal moves in-game.

Go to Codename.xml

Search for: BFLocoAnimate

Below it you will see something like this:

<slow name="Walk" />

Add animSpeed="X" (you don't need to add it if it was already present). Then change X to a number. Default is 1 so make it smaller than 1 to make the animal slower, and bigger to make the animal faster, like so:

<slow name="Walk" animSpeed="1.1" />

Repeat for the rest of the animations present (Stalk, Run, Walk, Swim, etc.).

Adjust needs[]

You can adjust animal needs such as hunger, social, etc. so that they rise and lower faster or slower. This allows you to customize your animals (so that more social animals interact more with others, less active animals rest more, etc.) or fix some issues.

Go to entities/units/animals/ai/Codename.xml

Search for BFAINeedAdjusts

If you see something like this, edit it to add the needs and numbers you want.

 <BFAINeedAdjusts social="0"/>

If that line is not present in the xml, add it yourself before the </BFAIEntityDataShared> line.

For reference, these are the default values:

hunger="0.33" thirst="0.33" rest="0.33" bathroom="0" hygiene="0" exercise="0.33" lifespan="0.0075" privacy="-0.01" reproduction="0.25" social="0.33" stimulation="0.33" breath="-0.50"

0 means no change over time, positive number means rise over time, negative means lower over time. A bigger number means a faster change.

See here for a more in depth explanation of what every need does.

Remove unwanted behaviors[]

If you want to stop an animal from doing certain actions (for example, fighting eachother), follow these steps.

Go to ai/tasks/animals/Codename.tsk

Look for the action you want to remove. Most of them have pretty straightforward names (e.g. "InviteFight").

Delete everything from <BFAITaskTemplate Name= until the next </BFAITaskTemplate>.

Keep in mind the following:

  • You do not need to touch the .beh file to stop animals from doing actions, editing the .tsk is enough. If a behavior is not linked in the .tsk, it won't be used even if it's in the .beh.
  • Actions related to using items often work differently. In those cases you will usually need to remove b_(Item)User from the main .xml file to stop the animal from using it.
  • Some actions are located in other .tsk files, notably those basal to all animals (located in animal.xml) and general predator/prey interactions (located in predator_prey.tsk).

Variants[]

There are several ways to code variant skins, so please see this in-depth guide if you want to add, remove or change the probability of variants.

Animal reproduction[]

Reproduction chance[]

This affects how content an animal needs to be in order to mate.

Go to ai/tasks/animals/Codename.tsk

Search for InviteReproduction

Now some lines below, look for something like this:

 <BFAIEvalData needPointsGood="50">
 <BFAIAttributeFloatMap reproduction="-40"/>

Change the number in needPointsGood=, as a reference 50 is used for easy to breed common animals, and 100 is the hardest.

Pregnancy chance[]

This affects the probability that a female animal becomes pregnant after mating.

Go to ai/tasks/animals/Codename.tsk

Search for t_Pregnant1

You will see a line similar to this:

 <BFAIToken Name="t_Pregnant1" GiveTo="target" Timeout="-1" Chance="75"/>

Change the number in Chance= to the percentage you want, 0 being 0%, 100 being 100%.

Pregnancy time[]

This affects how long an animal will be pregnant before giving birth or laying eggs.

Go to ai/tasks/animals/Codename.tsk

Search for: Timein=

You will see a line similar to this:

 <BFAIToken Name="t_Pregnant" GiveTo="subject" Timein="101.26" Timeout="-1" OnlyOne="true" RetainOnFailure="true"/>

Change the number in Timein=. One in-game day is roughly 24 units.

Number of young[]

This affects how many young or eggs appear when the animal gives birth or lay eggs, respectively.

Go to ai/tasks/animals/Codename.beh

Search for: <Birth> or <LayEgg>, depending on the animal

You will see a line similar to this:

 <BFBehRandomSet minPlays="1" maxPlays="3">

Change the numbers, minPlays is the minimum number and maxPlays is the maximum number. So in the example above the animal can produce 1, 2, or 3 young/eggs randomly.

Note that some animals, for example those with a Super version, might have multiple Birth/LayEgg behaviors for you to edit.

Further reading[]

You can read more in-depth tutorials on editing certain aspects at the tutorial and resources sections of multiple ZT2 forums, such as:

See also this frequent download problems list, which can help fixing other issues.

Credits[]

This article was written by Lgcfm, Mjmannella and Zt-freak. Thanks to Horse14t for some screenshots.

Some of the information above has been compiled from forums and other websites.

Advertisement