Higher level bridges

Find tutorials, documentation, and resources for creating and using TheoTown plugins.
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Higher level bridges

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
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).
You do not have the required permissions to view the files attached to this post.
User avatar
CommanderABab
AB
Reactions:
Posts: 11269
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

Post by CommanderABab »

That was 20 frames! :) he fixed it!
my avatar:
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: Higher level bridges

Post by Lobby »

Thank you :bf
User avatar
Mg3094066
Inhabitant of a Supercluster
Reactions:
Posts: 3217
Joined: 27 May 2017, 23:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

Post by Mg3094066 »

Only the other 3 types are missing
I threw my dignity to trash and downloaded Free Fire... But someway i liked it ":'D

But i think it was too early to celebrate... my internet runs at 8kb...

Just wait another month... :bb
User avatar
CommanderABab
AB
Reactions:
Posts: 11269
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

Post by CommanderABab »

Mg3094066 wrote: 15 Feb 2018, 22:49 Only the other 3 types are missing

That's where you have to make your own :)
my avatar:
User avatar
Mg3094066
Inhabitant of a Supercluster
Reactions:
Posts: 3217
Joined: 27 May 2017, 23:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

Post by Mg3094066 »

(._.?) wait...
What can i do with this?
Bridge_frames2.png
Bridge_frames.png
PS: U can use it freely just mention me in the credits for know the existense of the plugin
You do not have the required permissions to view the files attached to this post.
I threw my dignity to trash and downloaded Free Fire... But someway i liked it ":'D

But i think it was too early to celebrate... my internet runs at 8kb...

Just wait another month... :bb
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: Higher level bridges

Post by Lobby »

I updated the frames in World texture
User avatar
Mg3094066
Inhabitant of a Supercluster
Reactions:
Posts: 3217
Joined: 27 May 2017, 23:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

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
I threw my dignity to trash and downloaded Free Fire... But someway i liked it ":'D

But i think it was too early to celebrate... my internet runs at 8kb...

Just wait another month... :bb
User avatar
CommanderABab
AB
Reactions:
Posts: 11269
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

Post by CommanderABab »

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

Code: Select all

"frames per bridge":16
Yes!
my avatar:
User avatar
Mg3094066
Inhabitant of a Supercluster
Reactions:
Posts: 3217
Joined: 27 May 2017, 23:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

Post by Mg3094066 »

Now i will fix this 3 issues: and next go for tunnels
You do not have the required permissions to view the files attached to this post.
I threw my dignity to trash and downloaded Free Fire... But someway i liked it ":'D

But i think it was too early to celebrate... my internet runs at 8kb...

Just wait another month... :bb
User avatar
CommanderABab
AB
Reactions:
Posts: 11269
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

Post by CommanderABab »

my avatar:
User avatar
Mg3094066
Inhabitant of a Supercluster
Reactions:
Posts: 3217
Joined: 27 May 2017, 23:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

Post by Mg3094066 »

Ok maybe i have a proble with this:
You do not have the required permissions to view the files attached to this post.
I threw my dignity to trash and downloaded Free Fire... But someway i liked it ":'D

But i think it was too early to celebrate... my internet runs at 8kb...

Just wait another month... :bb
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: Higher level bridges

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
Reactions:
Posts: 3217
Joined: 27 May 2017, 23:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

Post by Mg3094066 »

Lobby wrote: 16 Feb 2018, 00: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?:
You do not have the required permissions to view the files attached to this post.
I threw my dignity to trash and downloaded Free Fire... But someway i liked it ":'D

But i think it was too early to celebrate... my internet runs at 8kb...

Just wait another month... :bb
User avatar
Mg3094066
Inhabitant of a Supercluster
Reactions:
Posts: 3217
Joined: 27 May 2017, 23:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

Post by Mg3094066 »

*Beta Edition*
I threw my dignity to trash and downloaded Free Fire... But someway i liked it ":'D

But i think it was too early to celebrate... my internet runs at 8kb...

Just wait another month... :bb
User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2211
Joined: 07 Jul 2016, 20:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

Post by KINGTUT10101 »

Do these frame replace the normal bridge frames?
User avatar
Mg3094066
Inhabitant of a Supercluster
Reactions:
Posts: 3217
Joined: 27 May 2017, 23:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

Post by Mg3094066 »

@Lobby there are the redrew image
You do not have the required permissions to view the files attached to this post.
I threw my dignity to trash and downloaded Free Fire... But someway i liked it ":'D

But i think it was too early to celebrate... my internet runs at 8kb...

Just wait another month... :bb
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: Higher level bridges

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
Reactions:
Posts: 3217
Joined: 27 May 2017, 23:50
Location: Venezuelan Republic of Mexico
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Higher level bridges

Post by Mg3094066 »

Lobby wrote: 16 Feb 2018, 10: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}]
}
]
I threw my dignity to trash and downloaded Free Fire... But someway i liked it ":'D

But i think it was too early to celebrate... my internet runs at 8kb...

Just wait another month... :bb
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: Higher level bridges

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.