Rotation aware night animations.

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4283
Joined: Thu Sep 14, 2017 17:30
Location: Astrellia, UHAE
Plugins: Show
Version: Beta

Platform

Plugin Creator

Rotation aware night animations.

#1

Post by THEMAX »

Rotation aware night animation
There has been lately a lot of persons asking how to make night animations on the discord, therefore i'll post a tutorial on how to make night animations rotation aware, but first, a few details :

-Rotation aware buildings can only have 2 or 4 frames, the same apply for rotation aware light animations. Otherwise, you might not get the expected result.
-This tutorial will admit you have already created 2 distinct png, one with the rotations of your prop / building, and another with the night animations, just like I did with the newspaper kiosk right under, which i'll use as an example.
Themax_PrpDecs1_Paris_Newspaper_Kiosk1.png
Themax_PrpDecs1_Paris_Newspaper_Kiosk1.png (2.3 KiB) Viewed 95 times
Themax_PrpDecs1_Paris_Newspaper_Kiosk1_Night.png
Themax_PrpDecs1_Paris_Newspaper_Kiosk1_Night.png (1.03 KiB) Viewed 95 times

Code: Select all    Reset

[ { "id": "$Themax_PrpDecs1_Paris_Newspaper_Kiosk1_Night", "type": "animation", "light": true, "light switching": true, "frames": [ { "bmp": "Themax_PrpDecs1_Paris_Newspaper_Kiosk1_Night.png", "count": 4, "h": 32, "w": 32 } ], "rotation aware": true }, { "id": "$Themax_PrpDecs1_Paris_Newspaper_Kiosk1", "type": "decoration", "category": "$cat_Themax_Props_And_Decorations_0", "author": "Themax", "width": 1, "height": 1, "frames": [ { "bmp": "Themax_PrpDecs1_Paris_Newspaper_Kiosk1.png", "count": 4, "h": 32, "w": 32 } ], "animation": [{"id": "$Themax_PrpDecs1_Paris_Newspaper_Kiosk1_Night", "x":0,"y":-25}], "price": 400, "monthly price": 0, "rotation aware": true, "draw ground": true, "water": "0", "power": "0", "build time": 0, "ordinal": 101, "needs road": false, "text": "A newspaper kiosk based on those you can find in Paris.", "title": "Paris newspaper kiosk" } ]
JSON checker
Check
Here is our json, the way i proceed is to first add a night-animation part, and set up a single frame sheet with "count", "h" & "w" corresponding to the total width of my png divided by 4, plus a "rotation aware": true (mandatory, otherwise it wont work).

Once that is done, adds an animation line to your json and you should be good to go, adjust the "y" part accordingly so it match your texture.

There you go, you have a basic json for a rotation aware building with night animations. In addition, this functionnality works also for cars, and it can really lower the work burden if done correctly, at the expanse of a sometimes bigger plugin texture space usage, for this reason, i would recommend not using this solution for plugins that have a large size.

If i discover other, better ways to make rotation aware night animations, i'll post about those.
Emperor of Atlantean federated empire
Image
Founder state of Internationxal council
Leader of AEOY and steel pact

User avatar
Bearbear76
Former Bearbear65
Reactions:
Posts: 5406
Joined: Fri Feb 10, 2017 14:53
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Rotation aware night animations.

#2

Post by Bearbear76 »

Great documentation! :)
Just my opinion
I'm probably recompiling my kernel... :o

User avatar
Kulche
Pluche
Reactions:
Posts: 1090
Joined: Wed Jun 07, 2017 20:28
Plugins: Show
Version: Beta

Plugin Creator

Platform

Re: Rotation aware night animations.

#3

Post by Kulche »

Didn't really know that rotation aware could be used for animations. You might as well use "frame": index in your animation object for greater control :)
I'm not lazy, I'm motivated to do nothing!
...blame lobby for that

User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4283
Joined: Thu Sep 14, 2017 17:30
Location: Astrellia, UHAE
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Rotation aware night animations.

#4

Post by THEMAX »

Kulche wrote:
Wed Apr 28, 2021 15:29
Didn't really know that rotation aware could be used for animations. You might as well use "frame": index in your animation object for greater control :)
I just discovered about that but I haven't mastered it enough to make a tutorial yet. Will come soon, most likely.
Emperor of Atlantean federated empire
Image
Founder state of Internationxal council
Leader of AEOY and steel pact

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”