You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

For a fence, you will need entities, lang and ui folders, just like many other ZT2 projects. Download the attatched file at the bottom of this tutorial to get the folder template for your fence.

First, we shall gather the files we need for the color=green]entities[/color] folder. You will need to go to your Zoo Tycoon 2 directory (which by default is C:\Program Files\Microsoft Games\Zoo Tycoon 2). There, we need to decide what expansion pack the fence you want to base your project on is from. According to the list below, open the required file in WinRAR, WinZip or any other zip program:

Original ZT2 (No Expansions): entities.z2fEndangered Species (and original ZT2 if you have expansions): x100_000.z2fAfrican Adventures: x110_000.z2fMarine Mania: x200_000.z2fExtinct Animals: x210_000.z2f

You will need to navigate through to the fences by clicking entities > objects > fences. Now we shall retrieve the AI files. Open the ai folder, and look for your base. For example, I want to make a fence from the wooden slat fence, I will need to look for the files named woodslat. Below you can see that I have highlighted the files I need to extract:

As you can see, I have selected three files for the ai, a normal XML, a _broken XML and a gate XML. These three files have to work together to make your fence. Extract these files and place them in your template in the entities > objects > fences > ai folder.

Now, return to the open .z2f. You will now need to go back one and find the folders for your base fence, so for my example I need to find these two folders below:

As you can see, you have to extract a normal folder and a gate folder for each fence. (Windowed fences can be made independantly from the normal fence, but usually use the same gate files.) Copy the contents of these folders into the codename andcodenamegate folders respectively.

Now you have all the files to start making your fence - let's get coding!

Step Two: Coding the AI Files

First, rename the XML files that you put in your ai folder. I would keep it simple, following the codename.xml, codenamegate.xml and codename_broken.xml conventions. Once that is done, open up the codename.xml in Notepad.

The basic idea is, as usual, to click Edit > Replace, and replace the base fence's codename with your own! Just be careful, as many of the base fences have silly codenames with tags on the end identifying their theme (such as _df, _st, _jt) which means you may have to run the Replace for both the original codename with and without these tags on the end just to make sure.

Save and close, and open up the codename_broken.xml. You need to follow the same proceedure as before, replacing the base codename with your codename, but watch out for these areas where your codename should not have "_broken" in it:

Now save and close. Finally, open the codenamegate.xml. Again, same proceedure applies, replacing the base with your codename. Pay attention to making sure that the s_Broken="codename_broken" is there, as well as not changing the the icon link where it says:

This ensures it uses the default staffgate icon. Now all that is done, save and close. Well done, you've done half the coding!

Step Three: Coding the Model and Skinning

Now open yourcodename folder, and you should see a large collection of files (either NIFs or BFBs, depending on which expansion you are using). Either way, you need to rename all these files, replacing the codename_df (or whatever tag it uses) with your codename. This is easiest achieved with a mass file renaming tool such as ReNamer. Once that is done, you can skin your project in whatever is your preferred manner. If the skins for your fence are not present in that folder, sometimes you need to open up the NIF or Materials files (whichever you have) to find the names of the skins that the fence has. In that case, you may have to hunt around in the entities.z2f or whichever .z2f you took your base files from in the Shared folder to find the skins. If you find your skins in a Shared folder, you may need to make your own Shared folder in the template.

Once you have skinned your project and renamed the DDS files, you can start coding your Materials files or NIFs. Simply open them in a hex editor/Notepad for the Materials files, Search for the original codename's skin, and replace that name with your new skin's name, and save. This is quite time consuming as you may have many NIFs or Materials files. If you have BFBs, make sure that your Materials files are renamed and that those name changes are reflected inside the BFB.

Once done, you can now move on to the gate folder, and repeat again. The only difference is that you have a BFM to code, which you do by opening in Notepad and replacing the all the codenames. Well done, now all the coding should be complete!

Step Four: Coding the Lang Folder

Whoops! Not quite! You need to code the lang folder! Luckily I already included the XML for you in the lang > 1033 folder! Make sure you rename it to your codename! Simply open it and Edit > Replace codename, making sure to use lowercase here:

Go to your ui folder and navigate to zoopedia > entries, and rename the codename.xml that is there. Open it and also replace the codename, making sure that you use lowercase letters. Save and close. Now, you really are all done this time!

If you have any further problems, make sure to post in the Scenery Coding Help sections of the forums!