Page 1 of 2

Higher level bridges

Posted: 16 Feb 2018, 00:34
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 13484 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).

Re: Higher level bridges

Posted: 16 Feb 2018, 00:39
by CommanderABab
That was 20 frames! :) he fixed it!

Re: Higher level bridges

Posted: 16 Feb 2018, 00:44
by Lobby
Thank you :bf

Re: Higher level bridges

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

Re: Higher level bridges

Posted: 16 Feb 2018, 00:50
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 :)

Re: Higher level bridges

Posted: 16 Feb 2018, 00:53
by Mg3094066
(._.?) wait...
What can i do with this?
Bridge_frames2.png
Bridge_frames2.png (5.98 KiB) Viewed 13889 times
Bridge_frames.png
Bridge_frames.png (4.91 KiB) Viewed 13889 times
PS: U can use it freely just mention me in the credits for know the existense of the plugin

Re: Higher level bridges

Posted: 16 Feb 2018, 00:59
by Lobby
I updated the frames in World texture

Re: Higher level bridges

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

Code: Select all

"frames per bridge":16

Re: Higher level bridges

Posted: 16 Feb 2018, 01:12
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!

Re: Higher level bridges

Posted: 16 Feb 2018, 01:21
by Mg3094066
Now i will fix this 3 issues: and next go for tunnels

Re: Higher level bridges

Posted: 16 Feb 2018, 01:30
by CommanderABab

Re: Higher level bridges

Posted: 16 Feb 2018, 02:16
by Mg3094066
Ok maybe i have a proble with this:

Re: Higher level bridges

Posted: 16 Feb 2018, 02:26
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.

Re: Higher level bridges

Posted: 16 Feb 2018, 03:34
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?:

Re: Higher level bridges

Posted: 16 Feb 2018, 03:35
by Mg3094066
*Beta Edition*

Re: Higher level bridges

Posted: 16 Feb 2018, 04:08
by KINGTUT10101
Do these frame replace the normal bridge frames?

Re: Higher level bridges

Posted: 16 Feb 2018, 05:12
by Mg3094066
@Lobby there are the redrew image

Re: Higher level bridges

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

Re: Higher level bridges

Posted: 16 Feb 2018, 17:16
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}]
}
]

Re: Higher level bridges

Posted: 16 Feb 2018, 17:29
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.