Ground/terrain/asphalt

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

Ground/terrain/asphalt

Post by Lobby »

Plugins of type ground can be used to add other ground type to the existing grass, sand, asphalt and so on.

Code: Select all    Reset

[{ "id":"$myground00", "type":"ground", "frames":[{"bmp":"frames.png","w":32,"count":6}], "border frames":[{"bmp":"border_frames.png","w":32,"handle y":8,"count":16}], "edge frames":[{"bmp":"edge_frames.png","w":16,"count":12}], "edge border frames":[{"bmp":"edge_border_frames.png","w":16,"count":32}], "texture":[{"bmp":"texture.png","w":32,"count":2}] }]
JSON checker
Check

frames
These frames are used for the (flat) surface of the ground. By providing multiple frames you can add some variation.
frames.png

border frames
These frames are used for coasts, that is, where a neighboring tile is water. The order is important and works similar to the alignment of road frames.
border_frames.png

edge frames
Edge frames are used for the edges of the map.
edge_frames.png

edge border frames
Edge border frames are used for tiles at the edge of the map that are also coast.
edge_border_frames.png

texture
These optional 2 frames are used for drawing slopes. Providing them is useful for better looking slopes since otherwise the game tries to use the regular frames for slope drawing.
texture.png


Instead of edge frames and edge border frames you can use "template":"$template_ground" to use the game's default ones.

You can provide winter frames by adding " winter" suffix to the key of a frames attribute. E.g. "frames winter":[...] would be used to define winter frames. The amount of winter frames provided should match the defined amount of regular frames.

You can also define the color that will be used for the ground in the minimap:

Code: Select all

  "map color":{"r":68,"g":96,"b":48},
  "map color winter":{"r":239,"g":239,"b":239}
These would be the colors that are used by default.

You can use ground for example as ground under buildings.
You do not have the required permissions to view the files attached to this post.
User avatar
Uncle Koala
Metropolitan
Reactions:
Posts: 142
Joined: 05 Apr 2020, 12:53
Location: Pitcairn Islands
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Ground/terrain/asphalt

Post by Uncle Koala »

If you don't want to draw border frames, you can "cheat" by putting 4 pixels below the tile.
example.png
If you reuse the normal frames, your tile will float above water and it makes your plugin look low quality.

Just putting this out there for all the "decal" makers who use one frame for everything and then end up releasing a very low quality plugin while it could be much better with a bit more effort. :space
You do not have the required permissions to view the files attached to this post.
Lua is easy! :lua:

Code: Select all

if Car.GoingToCrashIntoEachOther()
   then Car.DontCrash
end
Previous topicNext topic