Page 1 of 1

Custom zones (RCI only tutorial)

Posted: Sat Dec 09, 2017 15:11
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 4196 times
zones511.png
zones511.png (1.37 KiB) Viewed 4196 times
By Mg3094066
By Mg3094066
Mexico embassy.png (2.58 KiB) Viewed 4196 times
10 zones.json
(2.84 KiB) Downloaded 69 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.

Re: Custom zones (RCI only tutorial)

Posted: Sat Dec 09, 2017 18:16
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 :)

Re: Custom zones (RCI only tutorial)

Posted: Sat Dec 09, 2017 18:33
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.

Re: Custom zones (RCI only tutorial)

Posted: Sat Dec 09, 2017 18:40
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.

Re: Custom zones (RCI only tutorial)

Posted: Sat Dec 09, 2017 18:45
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.

Re: Custom zones (RCI only tutorial)

Posted: Fri Feb 16, 2018 17:35
by FranchuFranchu
Isn't there a way to make non-rci zones like the military one?

Re: Custom zones (RCI only tutorial)

Posted: Fri Feb 16, 2018 20:36
by FranchuFranchu
I mean like the airport, where the zone has functionality

Re: Custom zones (RCI only tutorial)

Posted: Sat Feb 17, 2018 2:35
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 :)

Re: Re: Custom zones (RCI only tutorial)

Posted: Mon Feb 18, 2019 13:01
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.

Re: Re: Custom zones (RCI only tutorial)

Posted: Fri Mar 01, 2019 12:39
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.

Re: Custom zones (RCI only tutorial)

Posted: Tue Oct 13, 2020 14:55
by Achmad Romi
22Alpha wrote:
Sat Dec 09, 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?