Custom decoration tiles for zones

Learn here how to create and use plugins.

Moderators: FranchuFranchu, Bearbear65

Post Reply
User avatar
Matison55557
Inhabitant of a Universe
Reactions:
Posts: 4873
Joined: Mon Jul 04, 2016 18:49
Plugins: Show
Version: Beta

Custom decoration tiles for zones

Post by Matison55557 » Wed Dec 13, 2017 17:41

Hi, TheoTown supports custom decoration tiles since the newest version. In this tutorial I would like to show you how you can make your own decoration tiles for both in-game zones and custom zones.

Let's say that we want in our zone to have four new decotiles, like these:
decoexample.png
decoexample.png (579 Bytes) Viewed 295 times
We need to put together a JSON for them.

Code: Select all

[
{
"id":"$matison_exampledeco",
"author":"Matison55557",
"width":1,
"height":1,
"frames":[{"bmp":"decoexample.png","w":32,"h":16,"count":4}],
"title":"Example decoration",
"text":".",
"type":"decoration",
"meta":{"tags":{"decorator":{"zones":[]    <--- inside the brackets, you put zones
}
}
}
}
]
Now, the explanations
frames must have the w, h and count if you are doing more than one. In this case, count is 4. W has to be 32 because the decoration tiles are always 1x1. H has to be the height of the image.
The last line is what makes the plugin a spawning decoration tile.
In the square brackets, you have to put the IDs of all zones that you want your decoration to spawn in.

Here are IDs of default zones:
$zoneresidential
$zonecommercial
$zoneindustrial
$zoneresidential_lvl2
$zonecommercial_lvl2
$zoneindustrial_lvl2
Ones with lvl2 are the dense zones.

You can also put your custom zones. Also, they have to be in quotation marks, and separated by commas.
Example: ["$zoneresidential","$zoneresidential_lvl2"]

After you finish everything, you can now see the new decoration tiles spawn randomly next to new buildings under construction!

That's all there is to it. Have fun!
Big thanks to Lobby!
Please help improve the TheoTown wiki: http://theotowngame.wikia.com

The Hearst Towehttp://telegra.ph/My-TheoTown-Achievements-07-19r in TheoTown looks nothing like the real thing...

Post Reply

Return to “Tutorials and Documentation”

Who is online

Users browsing this forum: No registered users and 2 guests