Higher level bridges

Learn here how to create and use plugins.

Moderator: Plugin Moderators

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

Platform

Higher level bridges

#1

Post by Lobby »

See here on how to create a plugin road. In order to support higher level bridges you have to provide separate frames for the ramp so there's a total of 16 frames per bridge.

These frames may look like that (32x48 pixels each) :img
bridge_frames_updated.png
bridge_frames_updated.png (9.25 KiB) Viewed 17931 times
Not that you might have to adjust your piles to be stackable.

You can use it like that :json

Code: Select all

"bridge frames":[{"bmp":"bridge_frames.png","w":32,"h":48,"count":16}],
"bridge height":12,
"frames per bridge":16  // You have to tell the game that there are 16 instead of 12 frames for each bridge type
The game will allow higher level bridges for any roads that provide 16 frames per bridge as shown above.

You can manually set the max bridge level by using

Code: Select all

"max level":3
in your road code. 3 is default for roads that provide 16 frames. Up to level 4 16 is supported right now (version 435 440).

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

Plugin Creator

Platform

Re: Higher level bridges

#2

Post by CommanderABab »

That was 20 frames! :) he fixed it!

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

Platform

Re: Higher level bridges

#3

Post by Lobby »

Thank you :bf

User avatar
Mg3094066
Inhabitant of a Supercluster
Posts: 3223
Joined: 28 May 2017, 01:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

#4

Post by Mg3094066 »

Only the other 3 types are missing

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

Plugin Creator

Platform

Re: Higher level bridges

#5

Post by CommanderABab »

Mg3094066 wrote:
16 Feb 2018, 00:49
Only the other 3 types are missing

That's where you have to make your own :)

User avatar
Mg3094066
Inhabitant of a Supercluster
Posts: 3223
Joined: 28 May 2017, 01:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

#6

Post by Mg3094066 »

(._.?) wait...
What can i do with this?
Bridge_frames2.png
Bridge_frames2.png (5.98 KiB) Viewed 18336 times
Bridge_frames.png
Bridge_frames.png (4.91 KiB) Viewed 18336 times
PS: U can use it freely just mention me in the credits for know the existense of the plugin

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

Platform

Re: Higher level bridges

#7

Post by Lobby »

I updated the frames in World texture

User avatar
Mg3094066
Inhabitant of a Supercluster
Posts: 3223
Joined: 28 May 2017, 01:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

#8

Post by Mg3094066 »

Ok we must to introduce this bridge tipe for my road for make it work?

Code: Select all

"frames per bridge":16

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

Plugin Creator

Platform

Re: Higher level bridges

#9

Post by CommanderABab »

Mg3094066 wrote:
16 Feb 2018, 01:09
Ok we must to introduce this bridge tipe for my road for make it work?

Code: Select all

"frames per bridge":16
Yes!

User avatar
Mg3094066
Inhabitant of a Supercluster
Posts: 3223
Joined: 28 May 2017, 01:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

#10

Post by Mg3094066 »

Now i will fix this 3 issues: and next go for tunnels
Attachments
IMG_20180215_151741_983.jpg

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

Plugin Creator

Platform

Re: Higher level bridges

#11

Post by CommanderABab »


User avatar
Mg3094066
Inhabitant of a Supercluster
Posts: 3223
Joined: 28 May 2017, 01:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

#12

Post by Mg3094066 »

Ok maybe i have a proble with this:
Attachments
IMG_20180215_161243_120.jpg

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

Platform

Re: Higher level bridges

#13

Post by Lobby »

You might have to redo this part. The easiest way is probably to recolor the matching frames from the world texture.

The old ramps used a visual trick to mimic 12 pixel height bridges. The problem is that this technique isn't stackable, so these frames changed a bit to be actually 12 pixels height.

User avatar
Mg3094066
Inhabitant of a Supercluster
Posts: 3223
Joined: 28 May 2017, 01:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

#14

Post by Mg3094066 »

Lobby wrote:
16 Feb 2018, 02:26
You might have to redo this part. The easiest way is probably to recolor the matching frames from the world texture.

The old ramps used a visual trick to mimic 12 pixel height bridges. The problem is that this technique isn't stackable, so these frames changed a bit to be actually 12 pixels height.
This is a little complicated, the game stops when i build a bridge that have the ramps.
There are an error?:
Attachments
I deleted the other bridge frames, now there are the only one bridge
I deleted the other bridge frames, now there are the only one bridge
Bridge_frames.png (7.34 KiB) Viewed 18274 times

User avatar
Mg3094066
Inhabitant of a Supercluster
Posts: 3223
Joined: 28 May 2017, 01:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

#15

Post by Mg3094066 »

*Beta Edition*

User avatar
KINGTUT10101
1,000,000 inhabitants
Posts: 2226
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Higher level bridges

#16

Post by KINGTUT10101 »

Do these frame replace the normal bridge frames?

User avatar
Mg3094066
Inhabitant of a Supercluster
Posts: 3223
Joined: 28 May 2017, 01:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

#17

Post by Mg3094066 »

@Lobby there are the redrew image
Attachments
Bridge_frames.png
Bridge_frames.png (5.76 KiB) Viewed 18261 times

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

Platform

Re: Higher level bridges

#18

Post by Lobby »

@KINGTUT10101 yes
@Mg3094066 may you show your code, please? The game won't crash because of pixel issues.

User avatar
Mg3094066
Inhabitant of a Supercluster
Posts: 3223
Joined: 28 May 2017, 01:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

#19

Post by Mg3094066 »

Lobby wrote:
16 Feb 2018, 12:36
@KINGTUT10101 yes
@Mg3094066 may you show your code, please? The game won't crash because of pixel issues.

Code: Select all

[
   {
      "id":"$4laneRoadMg3094066$",
	  "type":"road",
     "connectable": true,
	  "level":3,
     "width":2,
	  "frames":[
{"bmp":"roadL3.png","w":32,"h":15,"count":16},
{"bmp":"roadR2.png","w":32,"h":15,"count":16},
{"bmp":"roadR1.png","w":32,"h":15,"count":16},
{"bmp":"roadL4.png","w":32,"h":15,"count":16},
],
	  "speed":3.0,
      "traffic lights":
      [{"bmp":"tf.png","w":32,"h":32,"count":4}],
      "green phase":10000,
      "yellow phase":1000, 
	  "price":210,
	  "monthly price":3,
      "title":"Mexican Highway",
      "text":"if German highways you seem a little rare here we have a Highway made and drawn in Mexico. ;)",
       "auto join":true,
       "one way":true,
       "frames per bridge":16,
       "bridge frames":[{"bmp":"Bridge_frames.png","count":12,"h":34,"w":32}],
"bridge height":12,
"bridge price":370,
"tunnel frames":[{"bmp":"tunnel_frames.png","x":0,"w":16,"h":19,"handle y":7}, 
{"bmp":"tunnel_frames.png","x":16,"w":16,"h":19,"handle x":-16,"handle y":7}, 
{"bmp":"tunnel_frames.png","x":32,"w":16,"h":19,"handle y":7}, 
{"bmp":"tunnel_frames.png","x":48,"w":16,"h":19,"handle x":-16,"handle y":7}]
}
]

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

Platform

Re: Higher level bridges

#20

Post by Lobby »

I found a syntax mistake using JSONLint:

Code: Select all

			"count": 16
		},
		{
			"bmp": "roadL4.png",
			"w": 32,
			"h": 15,
			"count": 16
		},
	],
Remove the , before the last } of this excerpt.

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”