[1.8.58] Ground tiles under buildings

Find tutorials, documentation, and resources for creating and using TheoTown plugins.
Previous topicNext topic
User avatar
Bearbear76
Inhabitant of a Multiverse
Reactions:
Posts: 5701
Joined: 10 Feb 2017, 12:53
Location: L2 cache
Plugins: Showcase Store

Plugin Creator

Platform

[1.8.58] Ground tiles under buildings

Post by Bearbear76 »

Hello!
With the upcoming update 1.8.58 a new feature has been added to JSON called:

Code: Select all

"ground tiles": [ "$ground_00", "$ground_01", "$ground_02" ],  //array with ground ids
This will randomly select one ground tile in the given array and build it under the building.
So for example, you want to make a building that has asphalt as it's ground you would simply add this line of JSON:

Code: Select all

"ground tiles": [ "$asphalt00", "$asphalt01", "$asphalt02" ]
SPOILER_401c90c6-3ca7-458e-8245-58e2e77e66eb.png
Also by adding a wide variety of grounds your building won't look too repetitive.
You could also save plugin space by using this method if you use a variety of ground tiles for a variety of buildings.

\(space = grounds + buildings\)
space you use when using the ground tile method (new method)

\(space = grounds \cdot buildings\)
space you use adding the ground individually to each building (old method)

make sure you do some quick maths since the ground tile method won't always save plugin space!
1 ground frame, 3 buildings
  • new method: 3 + 1 = 4 <-- uses more plugin space :(
  • old method: 3 * 1 = 3
3 ground frames, 4 buildings
  • new method: 3 + 4 = 7 <-- uses less plugin space :)
  • old method: 3 * 4 = 12
This is an example of how you would implement it in your JSON:

Code: Select all

[	{
		//old method
 		"id": "$ground_tile_example",
  		...
		"random frames": true,
		 "frames": [
		 	{"bmp": "$example_building00"},
	 		{"bmp": "$example_building01"},
		 	{"bmp": "$example_building02"}
		 ]
	},
	{
		//new method
		//this makes it more concise, yet much more readable
		"id": "$ground_tile_example",
		...
		"draw ground": true,
		"frames": [{"bmp": "$example_building"}],
		"ground tiles": [ "$example_tile00", "$example_tile01", "$example_tile02" ]
	}
]
:jb: Bear out!
You do not have the required permissions to view the files attached to this post.
Just my opinion
retired
User avatar
Bevise
Inhabitant of a Conurbation
Reactions:
Posts: 495
Joined: 27 Feb 2020, 13:39
Location: Phu Quoc Island, Vietnam
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: [1.8.58] Ground tiles

Post by Bevise »

What does "random frames" mean?
...OOOOOOOOOOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOO OOOOOOOOOOOOO
OOOOOOOOOOOOOOOOOOOOOOOOOOO

A_Vietnamese_plugin_creator
OOOOOOOOOOOOOOOOOOOOOOOOOOO
OOOOOOOOOO OOOOO OOOOOOOOOO
OOOOOOOOOOOOOOOOOOOOOOOOOOO
User avatar
Bearbear76
Inhabitant of a Multiverse
Reactions:
Posts: 5701
Joined: 10 Feb 2017, 12:53
Location: L2 cache
Plugins: Showcase Store

Plugin Creator

Platform

Re: [1.8.58] Ground tiles

Post by Bearbear76 »

Bevise wrote: 31 May 2020, 12:33 What does "random frames" mean?
Advanced tags for building plugins wrote: "random frame": (bool),
Every time you place the building, a random frame from the frame array will be selected
does almost the same thing. :)
Just my opinion
retired
User avatar
ian`
Metropolitan
Reactions:
Posts: 117
Joined: 04 Apr 2020, 15:36
Location: 日本
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: [1.8.58] Ground tiles

Post by ian` »

What ground is automatically removed when i bulldoze buildings?
:bc
User avatar
JustAnyone
Honorary Contributor
Reactions:
Posts: 3666
Joined: 23 Jul 2017, 10:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: [1.8.58] Ground tiles

Post by JustAnyone »

This exact ground
Previous topicNext topic