Rotatable animation

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
dnswodn
Inhabitant of a Megacity
Posts: 177
Joined: 08 Feb 2022, 08:14
Location: 🏞️ Theonia 🌁
Plugins: Showcase Store

Plugin Creator

Platform

Rotatable animation

#1

Post 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
Last edited by dnswodn on 29 Jul 2024, 05:35, edited 2 times in total.
User avatar
Kulche
Pluche
Posts: 1182
Joined: 07 Jun 2017, 20:28
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Rotatable animation

#2

Post 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?).
User avatar
dnswodn
Inhabitant of a Megacity
Posts: 177
Joined: 08 Feb 2022, 08:14
Location: 🏞️ Theonia 🌁
Plugins: Showcase Store

Plugin Creator

Platform

Re: Rotatable animation

#3

Post 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
User avatar
Kulche
Pluche
Posts: 1182
Joined: 07 Jun 2017, 20:28
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Rotatable animation

#4

Post by Kulche »

yes, much simpler this way
User avatar
NSGSEI
Villager
Posts: 22
Joined: 29 Dec 2018, 07:36
Location: China
Plugins: Showcase Store
Version: Beta

Platform

Re: Rotatable animation

#5

Post 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
Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”