FFHacktics
News
About

Downloads
Tools
Patches
Custom Sprites

Community
Forum
Contests
Mibbit (IRC)
FFH's Discord irc.ffhacktics.com #FFH

Resources
Wiki
Maps
Effects
Tutorials
Sprites
Item Palettes
Event Instructions


Affiliates
FFVI Hacking
Graphics Gale
Event Instruction: {19}Camera
See Also: {1F}Focus {E5}WaitForInstruction

Description:
The camera can move around as you wish, as if it were a small copter.
It's not as complicated as it seems. with some experience, you should be able to get exactly what you want without testing in game.
All the camera values are absolute; not relative. It will only take into acound current values to determine the shortest way to reach destination.
Absolute: Based on point zero (0,0,0)
Relative: Based on last coordinates

All numbers are suggestions and by no means you must use only those. Anything can range from -32768 to 32767.
For the sake of simplicity, all Half-Words don't have their bytes swapped to avoid confusion when hex editing.

Go take a look at the maps sections to help yourself when you want to determine coordinates or the like. By the way those maps were all taken at 30º; except the first one at 90º.


Parameters:
X axis : Half-Word (signed)
Z axis : Half-Word (signed)
Y axis : Half-Word (signed)
Angle : Half-Word (signed)
Map Rotation : Half-Word (signed)
Camera Rotation : Half-Word (signed)
Distance : Half-Word (signed)
Time : Half-Word (signed)


X axis : Half-Word (signed)
A tile is 28x28
The camera can move 4x more precisely than the tiles' dimension, so moving a tile away would require 28*4=112.
If you simply add tiles, it will already be centered, 112 will have 1st tile centered. 168 whoever will be the border between 1st and 2nd tiles.
+00112 = 20 pixels = 1 tile (center)
+00392 = 98 pixels = 3,5 tiles (border 3-4)
+00896 = 224 pixels = 8 tiles (center)


Z axis : Half-Word (signed)
Similarly to the X & Y, 1h is 12 pixels high, or 48 units high when using the camera.
Centering is the determined by given height +2h (48*2=96), which is technically not correct as most units are 3h high (48*3=144) so if you want "perfect" centering, you have to subtract 1/2h (40/2=24).
+00048 = 1h (centers 3h)
+00192 = 4h (centers 6h)
+00384 = 8h (centers 10h)


Y axis : Half-Word (signed)
See Move on X axis.


Angle : Half-Word (signed)
Note: the base of the map is 0º.
+00000 = +00,00º
+00302 = +26,54º (often used in regular game)
+00341 = +30,33º
+01024 = +90,00º (bird view)


Map Rotation : Half-Word (signed)
Positive result = Clockwise Rotation
The camera will take the shortest way to the new coordinates based on the previous ones.
You should always stay in a range on -180º to 180º to avoid unecessary rotations. I marked -135º, -45º, 0º, 45º and 135º with an asterix (*) to help.
-03584 = -315,00º [Map_1]
-02560 = -225,00º [Map_2]
-01536 = -135,00º [Map_3]*
-00512 = -045,00º [Map_4]*
+00000 = +000,00º [Map_0]* ((0,0) at bottom left corner)
+00512 = +045,00º [Map_1]*
+01536 = +135,00º [Map_2]*
+02560 = +225,00º [Map_3]
+03584 = +315,00º [Map_4]


Camera Rotation : Half-Word (signed)
Positive result = Clockwise Rotation
And no, at 180º your characters won't fall from the map like ants. That's why it's the camera that is rotating, and not the map.
-02048 = -180,00º
-01024 = -090,00º
-00512 = -045,00º
+00000 = +000,00º
+00512 = +045,00º
+01024 = +090,00º
+02048 = +180,00º


Distance : Half-Word (signed)
Distance between the camera and target. For simplicity's sake we will convert it to a zoom value. This one is rarely ever used since resizing makes the maps, and mostly units, ugly.
+02048 = 050%
+04096 = 100%
+08192 = 200%


Time : Half-Word (signed)
Time required to perform the whole instruction.
+00050 = 0,50 seconds
+00100 = 1,00 second
+00300 = 3,00 seconds

Final Fantasy Hacktics 2.0 ~ The Final Fantasy Tactics Hacking community
©2007-2014 Xifanie Boisvert
All materials are property of their respective owners.