[1.10.15] Road curves/diagonal

Find tutorials, documentation, and resources for creating and using TheoTown plugins.
Previous topicNext topic
User avatar
Hadestia
Inhabitant of a Megalopolis
Reactions:
Posts: 722
Joined: 17 Jul 2017, 14:16
Location: Philippines
Plugins: Showcase Store

Plugin Creator

Platform

[1.10.15] Road curves/diagonal

Post by Hadestia »

Retiati_21-12-18_00.19.23.png
If you're wondering how ingame country road switched its curve to diagonal, here we will tackle it.

If you are not familiar with road plugin, it's better to understand first how to make a road plugin here:
viewtopic.php?f=41&t=2964

In order to make the road frame switches from curve to diagonal first we need to provide a frame for the regular road (curved/edged) and for diagonal road frames:
regular.png
diagonal.png
We're done with our frame, Now let's make a json for our roads. All we need to do is provide 2 road objects for our road, the first one if for our diagonal and the other is for the regular road. We need to initialize diagonal road first before regular to avoid missing error so our json may look like:

Code: Select all    Reset

[ //ROAD TEMPLATE { "id":"$diagonal_road_template00", "type":"template", "level":1, "traffic lights":[ {"bmp":"trafficlights.png","w":32,"count":4} ], "price":20, "monthly price":1, "title":"diagonal test", "text":"Road for diagonal road test." }, //DIAGONAL ROAD { "hidden":true, //optional if we want to hide this "level":2, "id":"$diagonal_road_diagonal00", "template":"$diagonal_road_template00", "type":"road", "draw ground":true, "speed":3, "frames":[ {"bmp":"diagonal.png","w":32,"count":16} ], "allow diagonal":true //[important] this will make car frames switch from regular to diagonal on curves }, //REGULAR ROAD { "id":"$diagonal_road00", "template":"$diagonal_road_template00", "type":"road", "speed":2, "frames":[ {"bmp":"regular.png","w":32,"count":16} ], "diagonal road":"$diagonal_road_diagonal00", //[important] with this attribute we can call the diagonal frames of this road by its id, this is for if users building this road using the diagonal marker "meta":{ "tags":{ "tool":{ "marker":"pipe" } } } // A meta for road marker when building diagonal } ]
JSON checker
Check
This feature also work for 2 width roads but, we need to click the "1" road tool first on order to show the marker and build the diagonal.

Here's the zip file of the road as experiment:
Diagonal Road Test.zip
You do not have the required permissions to view the files attached to this post.
 ! Message from: Hadestia
Visit my YouTube channel:
https://youtube.com/channel/UC5qG-r8y21036JZbGRClbdQ
i
imajoke
Inhabitant of a Conurbation
Reactions:
Posts: 529
Joined: 27 Oct 2019, 00:39
Plugins: Showcase Store
Version: Beta

Platform

Re: [1.10.15] Road curves/diagonal

Post by imajoke »

Speaking of, are diagonal bridges and tunnels planned to be implemented for the diagonal country road? Whether ingame or as it's own plugin
Eugh. I remembered this account existed and all I did.
I'm a better person now. Most likely to stay inactive.
Awesome community by the way y'all are peak 🗣️🗣️

The YouTube account isn't mine anymore by the way, a different family member uses it now.
User avatar
Player_no_Zero
Metropolitan
Reactions:
Posts: 132
Joined: 06 May 2019, 07:18
Location: Somewhere in Manila, Philippines
Plugins: Showcase Store

Plugin Creator

Platform

Re: [1.10.15] Road curves/diagonal

Post by Player_no_Zero »

imajoke wrote: 10 Jun 2022, 05:54 Speaking of, are diagonal bridges and tunnels planned to be implemented for the diagonal country road? Whether ingame or as it's own plugin
Diagonal tunnels don't make really much sense to make. Because I cannot even see it, so why bother.
𝐄𝐕𝐄𝐑𝐘𝐓𝐇𝐈𝐍𝐆 𝐌𝐔𝐒𝐓 𝐆𝐎 𝐁𝐘 𝐓𝐇𝐄 𝐃𝐄𝐓𝐀𝐈𝐋
𝐘𝐎𝐔 𝐌𝐔𝐒𝐓 𝐂𝐎𝐍𝐓𝐀𝐂𝐓 𝐌𝐄 𝐅𝐈𝐑𝐒𝐓, 𝐍𝐎𝐓 𝐀𝐋𝐋 𝐎𝐅 𝐌𝐘 𝐒𝐏𝐑𝐈𝐓𝐄𝐒 𝐀𝐑𝐄 𝐅𝐑𝐄𝐄, 𝐖𝐈𝐓𝐇 𝐀𝐍 𝐄𝐗𝐂𝐄𝐏𝐓𝐈𝐎𝐍 𝐓𝐎 𝐆𝐑𝐀𝐕𝐄𝐘𝐀𝐑𝐃 𝐏𝐎𝐒𝐓𝐒.
CREDIT ME IF YOU WANT TO USE MY SPRITES
User avatar
PixelDubs
Inhabitant of a Megalopolis
Reactions:
Posts: 613
Joined: 02 Nov 2020, 18:14
Location: probably at a concert
Plugins: Showcase Store

Plugin Creator

Platform

Re: [1.10.15] Road curves/diagonal

Post by PixelDubs »

Thanks mate, your a life saver, I remember a year ago creating my Diagonal Road Without Sidewalks plugin, I literally had to get help from Kingtut101
they/them
🇬🇧🏴󠁧󠁢󠁷󠁬󠁳󠁿
Previous topicNext topic