Learn here how to create and use plugins.

Moderator: Plugin Moderators

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




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

These frames are used for the (flat) surface of the ground. By providing multiple frames you can add some variation.
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 (13.38 KiB) Viewed 457 times

edge frames
Edge frames are used for the edges of the map.
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 (3.87 KiB) Viewed 457 times

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 (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
Posts: 135
Joined: Sun Apr 05, 2020 14:53
Location: Pitcairn Islands
Plugins: Show
Version: Beta


Plugin Creator

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.
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

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”