[1.9.68] Diagonal cars

Find tutorials, documentation, and resources for creating and using TheoTown plugins.
Previous topicNext topic
1
1Code
Inhabitant of a Megacity
Reactions:
Posts: 283
Joined: 30 Jan 2020, 14:56
Location: https://bit.ly/3P5dhnT
Plugins: Showcase Store

Plugin Creator

Platform

[1.9.68] Diagonal cars

Post 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, 14: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
See here for how to add night animation for your diagonal car
You do not have the required permissions to view the files attached to this post.
Last edited by 1Code on 19 Mar 2022, 16:29, edited 1 time in total.
y
yusuf8a684
Reactions:

Re: [1.9.68] Diagonal cars

Post by yusuf8a684 »

how do we apply night animations on the diagonal frames?
Previous topicNext topic