Roads

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
Lobby
Developer
Reactions:
Posts: 3705
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Roads

#81

Post by Lobby »

Do you mean these?
image.png
image.png (5.5 KiB) Viewed 9632 times

User avatar
Lakan Haraya
Metropolitan
Reactions:
Posts: 131
Joined: 28 Mar 2019, 09:34
Location: Philippines
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Roads

#82

Post by Lakan Haraya »

Excuse me :') what does offset x/y mean? :/

User avatar
OnlyMe
Settler
Reactions:
Posts: 1
Joined: 07 Feb 2020, 02:51
Plugins: Showcase Store

Re: Roads

#83

Post by OnlyMe »

How would it look like for high ways. Do you have a template for it.

User avatar
Axton12
Settler
Reactions:
Posts: 1
Joined: 18 Mar 2020, 17:24
Plugins: Showcase Store

Re: Roads

#84

Post by Axton12 »

Yes

User avatar
Ashmayor
Townsman
Reactions:
Posts: 99
Joined: 14 Jul 2017, 04:43

Platform

Re: Roads

#85

Post by Ashmayor »

Please Can i get New Dirt Road Frames?

User avatar
ian`
Supporter
Reactions:
Posts: 117
Joined: 04 Apr 2020, 17:36
Location: Indonesien
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Roads

#86

Post by ian` »

@Lobby , Can I make the car run lower on the bridge? I am trying to make a bridge lower than 12 for use in rivers or narrow water zones.
please ignore the bridge frames, it can be fixed later if the car can run lower.
please ignore the bridge frames, it can be fixed later if the car can run lower.

User avatar
Lobby
Developer
Reactions:
Posts: 3705
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Roads

#87

Post by Lobby »

So you have tried to set a lower value than 12 for "bridge height"?

Since terrain has been added to the game the height of bridges is more or less fixed to 12px so that it is compatible with terrain. Changing that coupling is likely to break something :/

User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Roads

#88

Post by CommanderABab »

I don't think it breaks anything, but the cars go up/down 12 at ramps no matter bridge height value. :)

User avatar
CERRERA
Townsman
Reactions:
Posts: 48
Joined: 25 Jan 2020, 06:19
Location: Philippines
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Roads

#89

Post by CERRERA »

How about elevated rail

User avatar
Achmad Romi
Townsman
Reactions:
Posts: 49
Joined: 29 Aug 2020, 06:33
Location: Indonesia
Plugins: Showcase Store
Version: Beta

Re: Roads

#90

Post by Achmad Romi »

Can you make a 1 lane road like this bus road?
Screenshot_2020-10-19-00-21-02.png
Correct my mistakes because I'm using google translate
*Lajur bukan Jalur

User avatar
Toby
Villager
Reactions:
Posts: 12
Joined: 10 Oct 2020, 10:37
Location: west java, Indonesia.
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Roads

#91

Post by Toby »

:D
Achmad Romi wrote:
18 Oct 2020, 19:34
Can you make a 1 lane road like this bus road?Screenshot_2020-10-19-00-21-02.png
Correct my mistakes because I'm using google translate
*Lajur bukan Jalur

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: Roads

#92

Post by PixelDubs »

mdk_813 wrote:
13 Jan 2018, 21:09
Hi guys,
I have a question.
Let's say I want to make a oneway-road, but without 64 frames and without an arrow-overlay. Would it be possible to provide just 16 frames and still have it work as a oneway road. Obviously one would have to pay attention to use the proper directions when building it, but still, would it work?
I tried that, but it did not work, this was what
happened.
It combines 4 random road textures if it's a plugin or not and just stacks them on top.
Screenshot_20201216-212249.png

User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Roads

#93

Post by CommanderABab »

It works if you provide the same 16 frames road texture 4 times.

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Roads

#94

Post by JustAnyone »

Following update 1.9.68, an official support for diagonal roads has been added.

Unfortunately, pre-existing diagonal plugins won't work as there are additional things to consider.

Below is an example of how you would define diagonal roads

Code: Select all    Reset

[{ "hidden":true, // Hide the diagonal road parts from toolbar "id":"$diagonal_road_diagonal00", // ... "type":"road", "draw ground":true, "frames":[ {"bmp":"diagonal.png","w":32,"h":16,"count":16} ], "allow diagonal":true // Tell the game to display cars diagonally for this road }, { "id":"$diagonal_road00", // ... "type":"road", "frames":[ {"bmp":"regular.png","w":32,"h":16,"count":16} ], "diagonal road":"$diagonal_road_diagonal00" // We reference the real diagonal road, that way the road itself can have regular curves too }]
JSON checker
Check
Frames associated with the JSON code above
regular.png
regular.png (6.73 KiB) Viewed 8619 times
diagonal.png
diagonal.png (7.57 KiB) Viewed 8619 times
Example of working implementation of such roads provided in a zip here:
Diagonal Road Test.zip
(11.64 KiB) Downloaded 171 times

User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Roads

#95

Post by CommanderABab »

Pretty cool!

User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4314
Joined: 14 Sep 2017, 17:30
Location: Astrellia, UHAE
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Roads

#96

Post by THEMAX »

Does anyone have the textures for rail bridges & rail slopes ?

User avatar
yusuf8a684
Reactions:

Re: Roads

#97

Post by yusuf8a684 »

THEMAX wrote:
11 Mar 2021, 13:14
Does anyone have the textures for rail bridges & rail slopes ?
Keinname on discord has them

User avatar
Wepf
Inhabitant of a Megacity
Reactions:
Posts: 285
Joined: 14 Oct 2021, 10:19
Location: Your lucid dream
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Roads

#98

Post by Wepf »

Lobby wrote:
04 Jun 2017, 22:01
So let's create a road plugin. I would like to have a blue road similar to the existing country road that looks like this:
Image


To get started we need some frames for the base graphics first: road.png
Image
The orientation follows a specific order. For your own road it's sufficient to use this graphic as template. You have to provide 16 frames here.

As we want to have a bridge we also have to provide graphics for it: bridge.png
image.png
The ordering is important :!:
If we want to use a bridge we have to tell TheoTown the pixel height of it. For some reason the height has to be 12. The number of frames must be a multiple of 12. If you provide 24 frame for example, your road will have two bridge types.

Additionally, in case we want to have some traffic lights, we might use this ones: tf.png
Image
If we use traffic lights, we also have to provide more information about phase lengths.

Our json code may now look like

Code: Select all

[
  {
    "id":"$testroad00",
    "type":"road",
    "level":1,
    "speed":2.0,

    "frames":[{"bmp":"road.png","w":32,"h":16,"count":16}],

    "bridge frames":[{"bmp":"bridge.png","w":32,"h":48,"count":12}],
    "bridge height":12,

    "traffic lights":[{"bmp":"tf.png","w":32,"h":32,"count":4}],
    "green phase":3000,
    "yellow phase":500,

    "price":50,
    "bridge price":200,
    "monthly price":2
  }
]
Note how I use can reference multiple frames from one image by providing values w, h and count.

The value level determines whether this road overrides other road types. Every road has it's own level and can only override roads which have a lower level. Value speed determines how fast cars will drive on this road. For reference, the slowest road has speed 1.0, the fastest road has speed 5.0 (natively in the game).

If you don't provide any frames for traffic lights your road won't have any. The values green phase and yellow phase indicate phase length in milliseconds (1000ms = 1s).



:66:
For recent versions please note that the road on the ramp needs one additional line of pixels on the top end to cover specific transitions between slopes and none slopes. The ramps in the image above have already been fixed.

Since terrain was added you can now specify your own frames that will be used for road that is placed directly onto slopes:

Code: Select all

"slope frames":[
  {"x":120,"y":311,"w":32,"h":32,"count":4,"offset x":2048,"offset y":1024}
],
For example:
image.png
By default the game will use the frames provided for flat road and squeeze them onto the slope. Alternatively, if provided, the ramps of the bridge(s) will be used.
Can I use the road frames for my road plugin?

User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4314
Joined: 14 Sep 2017, 17:30
Location: Astrellia, UHAE
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Roads

#99

Post by THEMAX »

I was wondering something, are diagonal bridges supported yet and if so, can we get a tutorial for these too ?

@JustAnyone @Lobby

User avatar
Wepf
Inhabitant of a Megacity
Reactions:
Posts: 285
Joined: 14 Oct 2021, 10:19
Location: Your lucid dream
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Roads

#100

Post by Wepf »

Screenshot_20211125-141913_TheoTown.jpg
Screenshot_20211125-141913_TheoTown.jpg (15.41 KiB) Viewed 7023 times

How to make the road have seawalls, please send me the link of the tutorial or teach me

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”