Page 1 of 1

Rotatable animation

Posted: 28 Jul 2024, 06:24
by dnswodn
It seems that there is no a tutorial on how to make animations rotatable, so I wrote this.
So, Let's go.

The better way: Please read replies #2 and #3.

Another way:
First, as everyone knows, to make buildings rotatable, you have to provide 4 frames, animation is the same.

Code: Select all    Reset

[ { "id": "$animation00", "type": "animation", "frames": [ {"bmp": "image.png"} ] }, { "id": "$animation01", "type": "animation", "frames": [ {"bmp": "image.png"} ] }, { "id": "$animation02", "type": "animation", "frames": [ {"bmp": "image.png"} ] }, { "id": "$animation03", "type": "animation", "frames": [ {"bmp": "image.png"} ] } ]
JSON checker
Check
And the animation part of the json:

Code: Select all    Reset

[{ //…… "animation": [ {"id": "$animation00"},{"id": "$animarion01"},{"id": "$animation02"},{"id": "$animation03"} ], "frame animation indices": [ [0],[1],[2],[3] //If the animations rotate incorrectly, you can try [3],[2],[1],[0]. ] }]
JSON checker
Check
About the "frame animation indices":
As everyone knows, the worlds in TheoTown has four directions: SE,NE,NW and SW.These four items([]) correspond to the four directions one by one.
So, the "0" in the first item means that animation00 will be shown in the SE direction, the "1" in the second item means that animation01 will be shown in the NE direction and so on.

Hope this will help you. :space

Re: Rotatable animation

Posted: 28 Jul 2024, 07:29
by Kulche
That's a mediocre tutorial, please just use a 4 frame rotation aware animation instead of creating 4 separate animation drafts and then forcing yourself to use animation indices (who in their right mind would even use indices instead of frame?).

Re: Rotatable animation

Posted: 28 Jul 2024, 08:57
by dnswodn
Kulche wrote: 28 Jul 2024, 07:29 That's a mediocre tutorial, please just use a 4 frame rotation aware animation instead of creating 4 separate animation drafts and then forcing yourself to use animation indices (who in their right mind would even use indices instead of frame?).
Like this?

Code: Select all    Reset

[ { "id": "$animation", "type": "animation", "frames": [ { "bmp": "image.png", "w": 5, "count": 4 } ], "rotation aware": true }, { //… "animation": [ { "id": "$animation" } ] } ]
JSON checker
Check

Re: Rotatable animation

Posted: 28 Jul 2024, 10:36
by Kulche
yes, much simpler this way

Re: Rotatable animation

Posted: 08 Nov 2024, 07:51
by NSGSEI
dnswodn wrote: 28 Jul 2024, 06:24 It seems that there is no a tutorial on how to make animations rotatable, so I wrote this.
So, Let's go.

The better way: Please read replies #2 and #3.

Another way:
First, as everyone knows, to make buildings rotatable, you have to provide 4 frames, animation is the same.

Code: Select all    Reset

[ { "id": "$animation00", "type": "animation", "frames": [ {"bmp": "image.png"} ] }, { "id": "$animation01", "type": "animation", "frames": [ {"bmp": "image.png"} ] }, { "id": "$animation02", "type": "animation", "frames": [ {"bmp": "image.png"} ] }, { "id": "$animation03", "type": "animation", "frames": [ {"bmp": "image.png"} ] } ]
JSON checker
Check
And the animation part of the json:

Code: Select all    Reset

[{ //…… "animation": [ {"id": "$animation00"},{"id": "$animarion01"},{"id": "$animation02"},{"id": "$animation03"} ], "frame animation indices": [ [0],[1],[2],[3] //If the animations rotate incorrectly, you can try [3],[2],[1],[0]. ] }]
JSON checker
Check
About the "frame animation indices":
As everyone knows, the worlds in TheoTown has four directions: SE,NE,NW and SW.These four items([]) correspond to the four directions one by one.
So, the "0" in the first item means that animation00 will be shown in the SE direction, the "1" in the second item means that animation01 will be shown in the NE direction and so on.

Hope this will help you. :space
Thank you very much. You may have solved my problem. :space