How to make a Theotown plugin by yourself?

Learn here how to create and use plugins.

Moderators: Scenario Moderators, Plugin Moderators

User avatar
383828228
Small-town resident
Posts: 27
Joined: 20 Aug 2025, 12:50

Platform

How to make a Theotown plugin by yourself?

#1

Post by 383828228 »

How to make a Theotown plugin by yourself?
1. Basic knowledge of plugin file structure

First, you need to have a basic knowledge of the plugin's file structure.
To gain it, there are several forms that are important to plugin makers.

(First, we should know the elemental and simple kinds of them.)

1. PNG files

Picture files that are saved with a file name ending in .png.

Example:
xxx_house.png

That means you need to save it as a PNG file so the Theotown program can successfully read it.

You can draw any “frames” you want to see or show in Theotown —
for example: a building, decoration, or even a road.

Main functions

PNG files mainly provide visual frames for the game program.
They help the program understand what your building or object looks like.

(If you don’t have any PNG file, the game will send an error message.)

Rules

You need at least one picture for the game to render your object.
In theory, the image can look like anything you want — but it must follow certain rules:

Every building has a “base”, a kind of ground tile that belongs to the modular ground structure.
You can find those base grounds (PNG files) in the official plugin portal.

They usually look like small diamond-shaped green tiles.
You can safely use them when designing your plugin (and delete them later if you want).

2. JSON files

In addition to PNG files, you’ll need JSON files.
They define how both the properties and appearance behave in the game.

JSON is a kind of text file that is easy for both humans and computers to understand.

Example JSON file

Below is a simple example of a commercial building JSON structure:

Code: Select all

[
{
"id": "Seven_Taiwan_tin",
"author": "user383828228",
"frames": [{ "bmp": "7ven_Taiwan_tin.png" }],
"build_time": 6,
"width": 3,
"height": 3,
"level": 2,
"type": "commercial"
},
{
"id": "Seven_Taiwan_flat",
"author": "user383828228",
"frames": [{ "bmp": "7ven_Taiwan_flat.png" }],
"build_time": 6,
"width": 3,
"height": 3,
"level": 2,
"type": "commercial"
}
]
JSON structure explanation
1. Key–value pairs

JSON files are made of key–value pairs, like this:

"key": "value"

Example:

Code: Select all

{ "id": "Seven_Taiwan_tin", "author": "user383828228" }
Each key represents a property (like id, author, build_time, etc.),
and each value defines the actual content.

2. Objects

When you wrap several key-value pairs in { },
it becomes a JSON object.

Example:

Code: Select all

{
"id": "Seven_Taiwan_tin",
"author": "user383828228",
"build_time": 6,
"width": 3,
"height": 3,
"level": 2,
"type": "commercial"
}
3. Arrays

When there are two or more objects, they are enclosed by [ ],
forming an array.

Example:

Code: Select all

[
{ "id": "Building_1", "type": "residential" },
{ "id": "Building_2", "type": "industrial" }
]
Common JSON Keys

Here are the most common and important JSON keys in Theotown plugins:

id

Acts like a product identification code.
Every plugin’s ID must be unique, or the game will show an error.

author

Defines the author name.
It doesn’t affect functionality — you can even use a nickname.

frames

Tells the program which image(s) to load.

Example:

Code: Select all

"frames": [{ "bmp": "building_1.png" }]
You can also include multiple frames for animation:

Code: Select all

"frames": [
{ "bmp": "building_1.png" },
{ "bmp": "building_2.png" }
]
Make sure the file names exactly match the real .png files
(including uppercase/lowercase letters).

build_time

Defines how long it takes to construct the building.
Example:

Code: Select all

"build_time": 6
For a 3×3 or 6×6 building, this could take about 1 minute in real time.

width / height

Defines the base size of the building:

Code: Select all

"width": 3,
"height": 3
Or, you can use an array form:

Code: Select all

"size": [3, 3]
level

Defines which level the building appears under in the game (1, 2, 3, etc.).

type

Defines what kind of building or object it is.
Common types include:

building
commercial
residential
industrial
park
decoration
road
car
train

3. File location and packaging

After understanding both PNG and JSON,
you need to know how to properly package your plugin.

Theotown plugins must be saved as .zip files.
The structure must be directly inside the ZIP, not inside a subfolder.

Correct structure:

xxx_house.zip
├── xxx.png
└── xxx.json


Make sure your .json and .png file names match.
Then, zip them together and you’re done!

You can now try making your first simple plugin!

Start small — maybe a 1×1 building or decoration —
and experiment with changing values in the JSON to see how it behaves.

Once you get the hang of it,
you can move on to advanced topics like animations, effects, or scripts.





Thanks for watching!!

User avatar
reindeerwheat
Small-town resident
Posts: 38
Joined: 21 Jun 2025, 14:57

Re: How to make a Theotown plugin by yourself?

#2

Post by reindeerwheat »

AI?

User avatar
Aidanspacelover2
Metropolitan
Posts: 119
Joined: 18 Oct 2025, 01:28
Location: Ironland
Plugins: Showcase Store
Version: Beta

Platform

Re: How to make a Theotown plugin by yourself?

#3

Post by Aidanspacelover2 »

reindeerwheat wrote:
22 Oct 2025, 22:08
AI?
Just make it yourself. It's not too complicated 🥀

User avatar
Fyonche
Inhabitant of a Megalopolis
Posts: 643
Joined: 02 Jan 2025, 12:59
Location: Non-precise location
Plugins: Showcase Store
Version: Beta

Platform

Re: How to make a Theotown plugin by yourself?

#4

Post by Fyonche »

Aidanspacelover2 wrote:
23 Oct 2025, 00:13
Just make it yourself. It's not too complicated 🥀
No. Reindeerwheat is asking if this tutorial was written by AI or not.

User avatar
383828228
Small-town resident
Posts: 27
Joined: 20 Aug 2025, 12:50

Platform

Re: How to make a Theotown plugin by yourself?

#5

Post by 383828228 »

What??
um... actually I made this without ai.🤣🤣🤣🤣🤣( believe or not believe,for you.)

User avatar
Playerc445GDReal
Inhabitant of a Megalopolis
Posts: 660
Joined: 09 Feb 2025, 13:41
Location: 🌌the edge of the milky way galaxy🌠
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: How to make a Theotown plugin by yourself?

#6

Post by Playerc445GDReal »

there are dashes (--)
one clue of ai writing

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”