Ground/terrain/asphalt

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
Lobby
Developer
Reactions:
Posts: 3590
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta

Platform

Ground/terrain/asphalt

#1

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
frames.png (2.76 KiB) Viewed 457 times

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
border_frames.png (13.38 KiB) Viewed 457 times

edge frames
Edge frames are used for the edges of the map.
edge_frames.png
edge_frames.png (15.51 KiB) Viewed 457 times

edge border frames
Edge border frames are used for tiles at the edge of the map that are also coast.
edge_border_frames.png
edge_border_frames.png (3.87 KiB) Viewed 457 times

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
texture.png (4.64 KiB) Viewed 457 times


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.
=^._.^= ∫

User avatar
Uncle Koala
Metropolitan
Reactions:
Posts: 135
Joined: Sun Apr 05, 2020 14:53
Location: Pitcairn Islands
Plugins: Show
Version: Beta
Contact:

Platform

Plugin Creator

Re: Ground/terrain/asphalt

#2

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
Lua is easy! :lua:

Code: Select all

if Car.GoingToCrashIntoEachOther()
   then Car.DontCrash
end

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”