Page 1 of 1

Rotation aware night animations.

Posted: 25 Apr 2021, 19:05
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 5444 times
Themax_PrpDecs1_Paris_Newspaper_Kiosk1_Night.png
Themax_PrpDecs1_Paris_Newspaper_Kiosk1_Night.png (1.03 KiB) Viewed 5444 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,
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
JSON checker

Output: Select all

...
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.

Re: Rotation aware night animations.

Posted: 28 Apr 2021, 13:57
by Bearbear76
Great documentation! :)

Re: Rotation aware night animations.

Posted: 28 Apr 2021, 15:29
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 :)

Re: Rotation aware night animations.

Posted: 28 Apr 2021, 22:23
by THEMAX
Kulche wrote:
28 Apr 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.