Page 1 of 2

Custom zones (RCI only tutorial)

Posted: 09 Dec 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 13613 times
zones511.png
zones511.png (1.37 KiB) Viewed 13613 times
By Mg3094066
By Mg3094066
Mexico embassy.png (2.58 KiB) Viewed 13613 times
10 zones.json
(2.84 KiB) Downloaded 309 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: 09 Dec 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: 09 Dec 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: 09 Dec 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: 09 Dec 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: 16 Feb 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: 16 Feb 2018, 20:36
by FranchuFranchu
I mean like the airport, where the zone has functionality

Re: Custom zones (RCI only tutorial)

Posted: 17 Feb 2018, 02: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: 18 Feb 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: 01 Mar 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: 13 Oct 2020, 14:55
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?

Re: Custom zones (RCI only tutorial)

Posted: 07 Mar 2021, 19:04
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

Re: Re: Custom zones (RCI only tutorial)

Posted: 07 Mar 2021, 19:10
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

Re: Custom zones (RCI only tutorial)

Posted: 08 May 2021, 16:01
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

Re: Custom zones (RCI only tutorial)

Posted: 08 May 2021, 18:18
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,

Re: Re: Custom zones (RCI only tutorial)

Posted: 28 Sep 2021, 05:38
by Yakka
Is it possible to make building with multiple zone's?

Re: Re: Custom zones (RCI only tutorial)

Posted: 28 Sep 2021, 06:42
by JustAnyone
No.

Re: Re: Custom zones (RCI only tutorial)

Posted: 10 Feb 2022, 08:00
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?

Re: Re: Custom zones (RCI only tutorial)

Posted: 12 Feb 2022, 14:42
by CommanderABab
Maybe you could share some code?

Re: Re: Custom zones (RCI only tutorial)

Posted: 25 Feb 2022, 07:15
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
}
]