Page 1 of 1

[1.9.68] Diagonal cars

Posted: 07 Mar 2022, 16:09
by 1Code
Learn the basics of a car plugin first

1.9.68 adds support for diagonal car drawing for roads that allow diagonals
JustAnyone wrote: 13 Jul 2021, 16:47 Diagonal cars just use 8 instead of 4 frames.
4 for diagonal axis and 4 normally.

All you just need to do is specify "frames per variant": 8 attribute for the car drafts.

The following example is how diagonal firetrucks are implemented

Code: Select all    Reset

[{ "id":"$carfirebrigade00", "type":"car", "frames":[ {"x":512,"y":657,"w":32,"h":18,"count":4},{"x": 128,"y": 365,"w": 32,"h": 19,"count": 4,"offset y": 3072} // This array has 8 frames ], "frames per variant": 8, // We let the game know that we use 8 frames per variant, otherwise it would treat 8 frames as 2 separate variants "animation":[ { "id":"$animationcaralertlights00", "pos":[16,-10, 10,-4, -4,-9, 4,-13], "important":true }, { "id":"$animationcaralertlights00", "pos":[18,-9, 12,-5, -2,-8, 6,-14], "important":true }, { "id": "carlight_red", "pos": [11, 4, 0, 0, 0, 0, 25, 1], "frames": [0, 3] }, { "id": "carlight_red", "pos": [13, 5, 0, 0, 0, 0, 27, 0], "frames": [0, 3] }, { "id": "carlight_yellow", "pos": [0, 0, 19, 5, 3, 0, 0, 0], "frames": [1, 2] }, { "id": "carlight_yellow", "pos": [0, 0, 21, 4, 5, 1, 0, 0], "frames": [1, 2] } ], "flag military":true, "flag airport":true, "flag emergency": true, "chargeable": false, "meta":{"tags":{"fire brigade":{}}} }]
JSON checker
Check
In regard to the order of frames it works the same like before for the first 4 frames (which will have different order when v2 is set to true). The next four, diagonal frames are always ordered like this:
image (2).png
image (2).png (829 Bytes) Viewed 1481 times
See here for how to add night animation for your diagonal car

Re: [1.9.68] Diagonal cars

Posted: 14 Mar 2022, 09:29
by yusuf8a684
how do we apply night animations on the diagonal frames?