Tutorial Animals Scripting Zoo Tycoon 2 Archived

Coding Skin Variants and Rarity

Published
15/11/2026
History
History
Reading time
3 min read
Views
2 views
Comments
0 comments
Like
Originally published by Danny Elfmaniac on Northern Skies in August 2012.
On this page

Difficulty: Medium/Hard

Introduction

Ever wondered why the RR zebra’s white variant does not show up as often as the other skins? Why some downloaded animals have a dozen of different skins, when the default is coded to only have a main skin and four varients?

Personally, I absolutely *LOVE* a lot of skins to my animals, even though it kind of takes a lot of “unnecessary” files space…

Note

I also hope you can code varients already (adding _1, _2 and so after the main skins name).

Enough of that blubber-blabber-bloof, let’s get on with it, shall we?

Step 1: Finding the files

Yes, I’m very basic in those things x3

But really, you’ll need the animal’s main .xml file. It’s found in:

entities > units > animals > ai > MainAnimalName_Adult

Step 2: The code and where to place it

The code we need to add is this:

<weights>
    <base weight="(Insert Number Here)" />
    <variant extension="1" weight="(Insert Number Here)" />
    <variant extension="2" weight="(Insert Number Here)" />
    <variant extension="3" weight="(Insert Number Here)" />
</weights>

The code needs to be placed under two lines that looks like this:

<instance>
    <BFAITextureController currState="well" defaultState="well">

This piece of code is often found in the middle of the .xml when you scroll down, if you don’t find it, keep looking!

Step 3: How to change the code to fit your varients

Adding More Variants

For more varients to be added, you have to add the

<variant extension="2" weight="(Insert Number Here)" />

line more times and change the first number to the next number after it (if the line is marked with 3, you’ll have to put 4 in the next line).

Setting Variant Weights

Now for the (Insert Number Here) thing, remove that and add a number there.

Important

Now it’s time for math, because all numbers there MUST BECOME 100 WHEN YOU ADD THEM. Nothing more, nothing less than 100.

So if you have three varients (and a main skin, of course) and want all the skins to appear as much, all the numbers have to be 24 (24x4=100).

Creating Rare Variants

Now, let’s pretend that variant 1 is an albino skin, and you don’t want it to appear as much as the others, you have to change the number to something lower.

For example 10, but then you also have to increase the other numbers. So if you have as many varients as the first example, the other numbers will be 30 (30 plus 10 plus 30 plus 30 = 100).

Tip

You can always experiment with the numbers, they don’t have to be even, as long as their total sum is 100.

The skins can also be as rare as down to the number 1, or as common as the number 99, but it’s nothing I recommend.

Final Outcome

Now you have learned how to code how much varients shows up; by adding variant code line and changing the numbers, but also how to add more varients by adding the variant code line. So, now you’ll be able to see a lot of varients on your animals C:

(I really don’t have a pic of this sadly. Also, I can be pretty bad at explaining things sometimes, do not hesitate to PM me if you don’t understand anything.)

Comments 0

Log in to join the conversation.

No comments yet.

Loading the history…
Tutorial Archived

Language Coding

by CougertheShark

Learn to translate Zoo Tycoon 2 animal names and Zoopedia entries using language XML files.

  • Zoo Tycoon 2
  • Scripting
Reading time
8 min
Comments
0
Tutorial Archived

Easy Coding Tutorial

by Hendrix

Learn to code, organize, and zip custom animals for Zoo Tycoon 2.

  • Zoo Tycoon 2
  • Animals
  • Scripting
Reading time
3 min
Comments
0
Tutorial Archived

Hygeine Coding and Invisible Poop

by Ghost

Learn to disable animal cleaning and make animal waste invisible and odorless.

  • Zoo Tycoon 2
  • Animals
  • Scripting
Reading time
2 min
Comments
0

Modal Title