Re: Custom zones (RCI only tutorial)

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
CommanderABab
AB
Reactions:
Posts: 11080
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Custom zones (RCI only tutorial)

#1

Post by CommanderABab »

These are my zones:

If you have the commanderAbab.plugin, you already have these.

Some additional zoning tags are used:
These are:

Code: Select all

    "base":"$zonecommercial",
You saw above.

Code: Select all

    "persistent":true 
zone stays even if you build a road and then remove it. Only roads to build in the embassy zone are military and airport roads.
I believe the airport and military zones use the

Code: Select all

  "superior to all":true
tag.

Code: Select all

    "superior to base":true,
This along with

Code: Select all

"rci":true
allows the base buildings to build here automatically.

Code: Select all

[
  {
    "id": "$zoneembassy",
    "title":"Embassy Zone",
    "text":"hopefully get this working!",
    "type": "zone",
    "rci":true,
    "separator":true,
    "base":"$zonecommercial",
    "requirement":{"requirements":[{"type":"RANK", "data":{"lvl":5}}]},
    
    "frames":[{"bmp":"zones510.png","w":32,"h":16,"x":96,"count":1}],
    "preview frames":[{"bmp":"zones510.png","w":32,"h":16,"x":96,"target w":64,"target h":32,"count":1} ],
    "price":400,
    "map color":{"r":77,"g":206,"b":76},
    "superior to base":true,
    "placeable":true,
    "persistent":true 
  },
  {
    "id": "$zonedeltares",
    "title":"Delta Residential Zone",
    "text":"hopefully get this working!",
    "type": "zone",
    "rci":true,
    "separator":true,
    "base":"$zoneresidential",
    "frames":[{"bmp":"zones511.png","w":32,"h":16,"x":0,"count":1}],
    "preview frames":[{"bmp":"zones511.png","w":32,"h":16,"x":0,"target w":64,"target h":32,"count":1} ],
    "price":200,
    "superior to base":true,
    "placeable":true
    
  },
  {
    "id": "$zonedeltacom",
    "title":"Delta Commercial Zone",
    "text":"hopefully get this working!",
    "type": "zone",
    "rci":true,
    "separator":true,
    "base":"$zonecommercial",
    "frames":[{"bmp":"zones511.png","w":32,"h":16,"x":32,"count":1}],
    "preview frames":[{"bmp":"zones511.png","w":32,"h":16,"x":32,"target w":64,"target h":32,"count":1} ],
    "price":200,
    "superior to base":true,
    "placeable":true
    
  },
  {
    "id": "$zonedeltaind",
    "title":"Delta Industrial Zone",
    "text":"hopefully get this working!",
    "type": "zone",
    "rci":true,
    "separator":true,
    "base":"$zoneindustrial",
    "frames":[{"bmp":"zones511.png","w":32,"h":16,"x":64,"count":1}],
    "preview frames":[{"bmp":"zones511.png","w":32,"h":16,"x":64,"target w":64,"target h":32,"count":1} ],
    "price":200,
    "superior to base":true,
    "placeable":true
    
  },
  

   {
      "id": "ab.version.mexico.embassy",
      "type": "commercial",
      "author": "CommanderABab, Mg3094066",
      "width": 4,
      "height": 4,
      
      "frames": [
         {
            "bmp": "Mexico embassy.png"
         }
      ],
      "zone":"$zoneembassy",
      "power": -20,
      "water": -13,
      "level":3,
      "radius":3,
      "zone radius":3
      
      
   },
   {
      "id": "ab.version.mexico.embassy.delta",
      "type": "commercial",
      "author": "CommanderABab, Mg3094066",
      "width": 4,
      "height": 4,
      
      "frames": [
         {
            "bmp": "Mexico embassy.png"
         }
      ],
      "zone":"$zonedeltacom",
      "power": -20,
      "water": -13,
      "level":3,
      "radius":3,
      "zone radius":3
      
      
   }
]

zones510.png
zones510.png (1.39 KiB) Viewed 13107 times
zones511.png
zones511.png (1.37 KiB) Viewed 13107 times
By Mg3094066
By Mg3094066
Mexico embassy.png (2.58 KiB) Viewed 13107 times
10 zones.json
(2.84 KiB) Downloaded 288 times
Embassy to right, delta zone to left
Embassy to right, delta zone to left
Deleted two of each.  Embassy zone prevents most things from building in it.  Normal roads, parks, RCI, etc.  Airport and military road can be built there. As will decorations.  You can also rezone or remove the zone.
Deleted two of each. Embassy zone prevents most things from building in it. Normal roads, parks, RCI, etc. Airport and military road can be built there. As will decorations. You can also rezone or remove the zone.

User avatar
cesareborgia94
Reactions:

Re: Custom zones (RCI only tutorial)

#2

Post by cesareborgia94 »

I love this tutorial! Now I can create a custom zone for my plugins in the future. Thanks to the author for this awaited tutorial :)

User avatar
22Alpha
Inhabitant of a Conurbation
Reactions:
Posts: 448
Joined: 23 Sep 2017, 14:29

Platform

Re: Custom zones (RCI only tutorial)

#3

Post by 22Alpha »

Well.. I did learn it by discovering and trials and questions, but not given by direct patent. No wonder why he does not want you to make one.

I made one. For the energy. I'll show you if you guys want. The energy sector became an industrial that produce energy. The problem is, monthly costs does not do the math for zoneables. Of course it won't, it is not yet part of the coding language.

User avatar
CommanderABab
AB
Reactions:
Posts: 11080
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Custom zones (RCI only tutorial)

#4

Post by CommanderABab »

"placeable":true, means that you can place the zone with the zoning tool.

Without it, another plugin would have to build the zone.

User avatar
22Alpha
Inhabitant of a Conurbation
Reactions:
Posts: 448
Joined: 23 Sep 2017, 14:29

Platform

Re: Custom zones (RCI only tutorial)

#5

Post by 22Alpha »

Here. You can move your current New Supply System if you have one. You guys can try it. But I won't stop here. I'll continue to develop this plugin on its purpose. Zoneable.
Attachments
New Supply System.plugin
(88.3 KiB) Downloaded 278 times

User avatar
FranchuFranchu
Inhabitant of a Country
Reactions:
Posts: 799
Joined: 28 May 2017, 00:07
Location: Freezing in Argentina
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Custom zones (RCI only tutorial)

#6

Post by FranchuFranchu »

Isn't there a way to make non-rci zones like the military one?

User avatar
FranchuFranchu
Inhabitant of a Country
Reactions:
Posts: 799
Joined: 28 May 2017, 00:07
Location: Freezing in Argentina
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Custom zones (RCI only tutorial)

#7

Post by FranchuFranchu »

I mean like the airport, where the zone has functionality

User avatar
Lobby
Developer
Reactions:
Posts: 3705
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Custom zones (RCI only tutorial)

#8

Post by Lobby »

Feel free to study the zone and airport JSON files that can be found in the JSON-resources thread.

These zones aren't really special by any means :)

User avatar
Imran M
Inhabitant of a Country
Reactions:
Posts: 844
Joined: 24 Oct 2018, 13:41
Plugins: Showcase Store

Plugin Creator

Platform

Re: Re: Custom zones (RCI only tutorial)

#9

Post by Imran M »

I made a non-rci zone, but the buildings still can be placed on things other than the zone. How could I make this work? Also, how can I make it place zone around the building, like some airport buildings?

I did it by myself! It was radius:1 and it fixed all my problem! But I don't understand how to use border frames and road border frames.

User avatar
Lobby
Developer
Reactions:
Posts: 3705
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Re: Custom zones (RCI only tutorial)

#10

Post by Lobby »

It's complicated. If you provide 16 frames for "border frames" it will place them around the zone like for the airport zone. The alignment of the frames (that means the meaning of the i-th frame) is the same as for the frames of roads.

"road border frames" works similar and will be displayed instead of "border frames" if there's a road crossing the border. You have to provide 32 here with the second 16 will be used for the case that there's currently a car on that border road (e.g. like the opening barriers for the military zone).

To get started here's how the border frames are defined for the military zone :json

Code: Select all

    "border frames":[
      null,
      {"x":32,"y":64,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":0,"y":64,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":64,"y":64,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":32,"y":64,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":32,"y":64,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":96,"y":64,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":32,"y":64,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":0,"y":64,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":160,"y":64,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":0,"y":64,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":0,"y":64,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":128,"y":64,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":32,"y":64,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":0,"y":64,"w":32,"h":32,"handle y":24,"offset y":3072},
      null
    ],
    "road border frames":[
      null,
      {"x":64,"y":144,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":0,"y":144,"w":32,"h":32,"handle y":24,"offset y":3072},
      null,
      {"x":64,"y":144,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":64,"y":144,"w":32,"h":32,"handle y":24,"offset y":3072},
      null,
      null,
      {"x":0,"y":144,"w":32,"h":32,"handle y":24,"offset y":3072},
      null,
      {"x":0,"y":144,"w":32,"h":32,"handle y":24,"offset y":3072},
      null,
      null,
      null,
      null,
      null,
      null,
      {"x":96,"y":144,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":32,"y":144,"w":32,"h":32,"handle y":24,"offset y":3072},
      null,
      {"x":96,"y":144,"w":32,"h":32,"handle y":24,"offset y":3072},
      {"x":96,"y":144,"w":32,"h":32,"handle y":24,"offset y":3072},
      null,
      null,
      {"x":32,"y":144,"w":32,"h":32,"handle y":24,"offset y":3072},
      null,
      {"x":32,"y":144,"w":32,"h":32,"handle y":24,"offset y":3072},
      null,
      null,
      null,
      null,
      null
    ]
You can just copy'n'paste it into your zone.

User avatar
Achmad Romi
Townsman
Reactions:
Posts: 49
Joined: 29 Aug 2020, 06:33
Location: Indonesia
Plugins: Showcase Store
Version: Beta

Re: Custom zones (RCI only tutorial)

#11

Post by Achmad Romi »

22Alpha wrote:
09 Dec 2017, 18:45
Here. You can move your current New Supply System if you have one. You guys can try it. But I won't stop here. I'll continue to develop this plugin on its purpose. Zoneable.
.plugin files can only be opened on a PC?

User avatar
yusuf8a684
Reactions:

Re: Custom zones (RCI only tutorial)

#12

Post by yusuf8a684 »

Achmad Romi wrote:
13 Oct 2020, 14:55
22Alpha wrote:
09 Dec 2017, 18:45
Here. You can move your current New Supply System if you have one. You guys can try it. But I won't stop here. I'll continue to develop this plugin on its purpose. Zoneable.
.plugin files can only be opened on a PC?
you just can't open them

User avatar
yusuf8a684
Reactions:

Re: Re: Custom zones (RCI only tutorial)

#13

Post by yusuf8a684 »

I made 9 custom zones with copying in-game frames, animation and changing their ids. There is an issue about the zones, at some point they just stop spawning even tho there are demands for it

viewtopic.php?f=36&t=13236

User avatar
Lalulali
Settler
Reactions:
Posts: 5
Joined: 28 Dec 2020, 09:07

Platform

Re: Custom zones (RCI only tutorial)

#14

Post by Lalulali »

if i want to make a zone that only build building from my plugin, how do i define the json file ?
this is my json that i already try to make

Code: Select all    Reset

[ { "id": "$HumanComZone", "title":"Human Commercial", "text":"Human Zone For Commercial Building", "type": "zone", "rci":false, "separator":true, "base":"$zonecommercial", "frames":[{"bmp": "Commercial.png"}], "preview frames":[{"bmp": "Preview Commercial.png"}], "price":150, "superior to base":true, "placeable":true }, { "id": "$ComLow1", "type": "commercial", "author": "lalulali", "width": 1, "height": 1, "zone": "$HumanComZone", "frames": [{"bmp": "Stall 1.png"}], "level": 1, "people": 4, "title": "Human Market Stall", "text": "Human Market Stall Type 1 For Poor People", "needs road":false, "draw ground":true, "price": 7, "bulldoze price": 10, "build time": 2 } ]
JSON checker
Check

User avatar
CommanderABab
AB
Reactions:
Posts: 11080
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Custom zones (RCI only tutorial)

#15

Post by CommanderABab »

Lalulali wrote:
08 May 2021, 16:01
if i want to make a zone that only build building from my plugin, how do i define the json file ?
this is my json that i already try to make

Code: Select all    Reset

[ { "id": "$HumanComZone", "title":"Human Commercial", "text":"Human Zone For Commercial Building", "type": "zone", "rci":false, "separator":true, "base":"$zonecommercial", "frames":[{"bmp": "Commercial.png"}], "preview frames":[{"bmp": "Preview Commercial.png"}], "price":150, "superior to base":true, "placeable":true }, { "id": "$ComLow1", "type": "commercial", "author": "lalulali", "width": 1, "height": 1, "zone": "$HumanComZone", "frames": [{"bmp": "Stall 1.png"}], "level": 1, "people": 4, "title": "Human Market Stall", "text": "Human Market Stall Type 1 For Poor People", "needs road":false, "draw ground":true, "price": 7, "bulldoze price": 10, "build time": 2 } ]
JSON checker
Check
Leave this line out:

Code: Select all

"superior to base":true,
and change this line to this:

Code: Select all

      "rci": true,

User avatar
Yakka
Inhabitant of a Conurbation
Reactions:
Posts: 413
Joined: 06 Jan 2020, 09:57
Location: Java-indonesia
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Re: Custom zones (RCI only tutorial)

#16

Post by Yakka »

Is it possible to make building with multiple zone's?

User avatar
JustAnyone
Developer
Reactions:
Posts: 3470
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Re: Custom zones (RCI only tutorial)

#17

Post by JustAnyone »

No.

User avatar
Nifaroux
Villager
Reactions:
Posts: 15
Joined: 10 Jan 2022, 05:07

Re: Re: Custom zones (RCI only tutorial)

#18

Post by Nifaroux »

when I activate the "RCI" buildings from the game appear but never my custom ones and if I deactivate the "RCI" nothing is generated, can anyone help me?

User avatar
CommanderABab
AB
Reactions:
Posts: 11080
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Re: Custom zones (RCI only tutorial)

#19

Post by CommanderABab »

Maybe you could share some code?

User avatar
Nifaroux
Villager
Reactions:
Posts: 15
Joined: 10 Jan 2022, 05:07

Re: Re: Custom zones (RCI only tutorial)

#20

Post by Nifaroux »

CommanderABab wrote:
12 Feb 2022, 14:42
Maybe you could share some code?
Sorry for not answering, I haven't been that active lately

[
{
"id": "Ruralzone",
"title":"Rural Zone",
"text":"area to generate rural houses",
"type": "zone",
"rci":false,
"separator":true,
"persistent":false,
"base":"$zoneresidential",
"frames":[{"bmp":"Ruralzone.png"}],
"preview frames":[{"bmp":"RZpreview.png"} ],
"price":1,
"superior to base":true,
"placeable":true
}
]

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”