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: 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
Here's the zip file of the road as experiment: