[1.10.15] Road curves/diagonal

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
Hadestia
Inhabitant of a Megalopolis
Reactions:
Posts: 727
Joined: 17 Jul 2017, 16:16
Location: Philippines
Plugins: Showcase Store
Contact:

Plugin Creator

Platform

[1.10.15] Road curves/diagonal

#1

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 FRAME
REGULAR FRAME
regular.png (6.17 KiB) Viewed 2635 times
DIAGONAL FRAME
DIAGONAL FRAME
diagonal.png (7.08 KiB) Viewed 2635 times
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
(11.67 KiB) Downloaded 157 times

User avatar
imajoke
Inhabitant of a Conurbation
Reactions:
Posts: 532
Joined: 27 Oct 2019, 02:39
Plugins: Showcase Store
Version: Beta

Re: [1.10.15] Road curves/diagonal

#2

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

User avatar
Player_no_Zero
Metropolitan
Reactions:
Posts: 140
Joined: 06 May 2019, 09:18
Location: Somewhere in Manila, Philippines
Plugins: Showcase Store

Plugin Creator

Platform

Re: [1.10.15] Road curves/diagonal

#3

Post by Player_no_Zero »

imajoke wrote:
10 Jun 2022, 07: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.

User avatar
PixelDubs
Inhabitant of a Conurbation
Reactions:
Posts: 529
Joined: 02 Nov 2020, 20:14
Location: Telford, England
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: [1.10.15] Road curves/diagonal

#4

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

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”