Printable Version of Topic
Click here to view this topic in its original format
Zoo Admin Forums > APE Tutorials > Fixing Rotation


Posted by: Aussie Koala Mar. 1 2003, 05:22 PM
For this tutorial you will need

Winhex
Download a trial version http://www.winhex.com/

and a Hex-Dec conversion chart
There is one http://www.webelfin.com/webelfindesign/colorconvert.html
or http://www.syc.k12.pa.us/ed526/hexdec.htm
I find it handy to have a printed version of the chart.

your Windows Paint Program

Posted by: Aussie Koala Mar. 1 2003, 06:24 PM
We want to start with something easy so we will use this clockpost to start with.

You will also need to download this file


Posted by: Aussie Koala Mar. 1 2003, 06:37 PM
Step 1.
Unzip the file and place the ztd in your zootycoon/updates folder.

Start Zoo Tycoon and a new freeform game.
Turn on the grid (ctrl-g)

Place the tutorial clock post in a grid square and surround it with path

Posted by: Aussie Koala Mar. 1 2003, 06:39 PM
Now if you rotate your screen, you will notice the clock seems to have moved and now appears partially on the path.

This is why most objects need to be fixed rotationally.



Posted by: Aussie Koala Mar. 1 2003, 07:13 PM
Step 2.
The clockpost is not actually where you think it is- thats why it jumps when you rotate your screen.
We need to determine the location of the clockpost and move it to where it should be placed.

First of all we should note- the clockpost was cloned from the lampost and has a footprint of 1 x 1. From looking at the clockpost in the grid - you can see it would be better for the clock to be centred in the middle of one grid square.
As one grid square has a footprint of 2 x 2 we need to change this.

We can do this by editing the ucs file. As we have to unzip our ztd file anyway- we will do this now.

Rename the tutorialclockpost.ztd to tutorialclockpost.zip.
Unzip to somewhere on your hard drive.

You should now have 2 folders- Objects and Scenery

Open the Scenery folder and then the folder called Other

You now have a file called 16D9C057.usc (or whatever the object id number is of the object your are fixing).

You can open this ucs file in notepad.

Posted by: Aussie Koala Mar. 1 2003, 07:36 PM
Step 3.
With the ucs file opened in notepad you will see the following lines:

[Characteristics/Integers]
cFootprintX = 1
cFootprintY = 1

This is what we need to change to correct the footprint.

Change it to

[Characteristics/Integers]
cFootprintX = 2
cFootprintY = 2

then save the ucs file.

You can now rezip the file and then rename it back to tutorialclockpost.ztd again.

Posted by: Aussie Koala Mar. 1 2003, 07:53 PM
Step 4.
Put the ztd file back in your updates folder and start up Zoo Tycoon again.

Place the clockpost in all of its 4 rotations on the map.

Posted by: Aussie Koala Mar. 1 2003, 08:09 PM
Because the clockpost actually has the same image for every rotation they should all look the same.

Step 5.
Now to determine where the clock actually is. If we were using an image 1 x 1 we would probably use the lampost but as we have changed it to 2 x 2 we can use the picnic table for this excersise.

Surround the clock with the picnic table to determine which grid square the clockpost is actually in.

Then place a square of concrete terrain in the gridsquare where the clockpost is located.

(Note: in this instance the clockpost is in the square it appears to be- but sometimes they can be a whole couple of squares out).

Posted by: Aussie Koala Mar. 1 2003, 08:18 PM
Step 6.
Do the same for the other 3 rotations.

Now delete the picnic tables.

Your screen should now look like this.


Posted by: Aussie Koala Mar. 1 2003, 08:43 PM
Step 7.
As you can see the clockpost needs to be centred in the middle of the grid square. At the moment it is too high up- and bunched up in one corner.

Now press your Prt Scr to take a screenshot of the clockposts in the concrete squares - exactly as I have done above.

Exit Zoo Tycoon and open up paint and paste your screenshot.

Save your screenshot.

In paint select View, Zoom, Custom, 800%

Find the base of the first clockpost, then select View, Zoom, Show Grid

You should now be lookiing at this:




Posted by: Aussie Koala Mar. 2 2003, 09:07 AM
Step 8.
Have a look at your screenshot with the grid turned on.
Each of those grid squares represents a pixel.

We need to move the clockpost to the centre of the Zoo Tycoon gridsquare represented by the grey concrete.

We want the clockpost to be sitting somewhere near where I have marked the blue line in the below pic. we can achieve this by moving the clockpost down.



Posted by: Aussie Koala Mar. 2 2003, 09:20 AM
Step 9.
Now count how many gridsquares (pixels) you would have to move the clock to have it in the desired position.

Moving it down 10 pixels should get us in the position we want.

To move the clock down we need to edit the files.

Unzip the tutorialclockpost.ztd - (you may still have the unzipped folders on your pc).

Posted by: Aussie Koala Mar. 2 2003, 10:11 AM
Step 10.
Now start up the Hex Editor Program.

In the hex editor program open the folder Objects then 16D9C057 (or whatever the id of the object you are fixing) then idle

Now remember the first rotation was SE

Click on the SE file

Your screen should look like this


Posted by: Aussie Koala Mar. 2 2003, 11:34 AM
Step 11.
If it looks slightly different press the arrow keys in the top right side until the screen is the same as in the pic. Also make sure you're in hexadecimal mode and offset is displayed in decimal.
(In winhex- hit F5 and ensure hexidecimal offsets option is unchecked.)


What you need to know here are what offset values you will need to be editing.

Offset 49 moves the image up or down (add to move up/subract to move down)
Offset 51 moves the image left or right (add to move left/subtract to move right)

You will find offset 49 in the row 000048 and column 1 (48+1=49)
You will find offset 51 in the row 000048 and column 3 (48+3=51)

We need to move our image down so offset 49 is what we need to edit.

As we see in above instructions - in order to move down we need to subtract.

Posted by: Aussie Koala Mar. 2 2003, 11:48 AM
Step 12.
The values are represented in hex form.

Look at the value of offset 49 which we need to change.
The hex number is 77.

Now look at your hex-decimal conversion chart and under Hex find 77.

You will see that the decimal equivalent is 119




Posted by: Aussie Koala Mar. 2 2003, 11:57 AM
Step 13.
We have already determined we need to move our clock down 10 pixels-

We need to now subtract 10 from the decimal value which give us 109

Now to convert our new decimal number back to hex.

Look at your chart under the Dec column and find 109. You can see the hex equivalent is 6D

Posted by: Aussie Koala Mar. 2 2003, 12:02 PM
Step 14.
This means we need to change our offset 49 from the current value of 77 to 6D

Just overtype it in the hex editor.

Your screen should now look like this:

Posted by: Aussie Koala Mar. 2 2003, 12:20 PM
Step 15.

Now save the file SE.

Now open the file SW.

Because our image was the same in all rotations we have the same value again in offset 49.

So again we change it to 6D and save.

Also do this for NE and NW.

When you have changed all 4 rotations you can exit Winhex.


Posted by: Aussie Koala Mar. 2 2003, 12:32 PM
Step16.
You can now rezip the objects and scenery files and then rename to tutorialclockpost.ztd.

Place it in your zootycoon update folder, restart zoo tycoon and test.
Rotate the screen in all direction to ensure there is no jumping.

Your clocks should now be centred in the grid square (or close to it anyway).

Posted by: Aussie Koala Mar. 2 2003, 12:33 PM
Any questions about this tutorial, please feel free to ask in the Online Tutorial Questions thread pinned here.


Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)