Re: Custom zones (RCI only tutorial)

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
CommanderABab
AB
Reactions:
Posts: 8822
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

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 4195 times
zones511.png
zones511.png (1.37 KiB) Viewed 4195 times
By Mg3094066
By Mg3094066
Mexico embassy.png (2.58 KiB) Viewed 4195 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.
Image

cesareborgia94
Inhabitant of a Planet
Reactions:
Posts: 1307
Joined: Sun Nov 12, 2017 9:23
Location: The Kingdom of Babilandia
Plugins: Show
Version: Beta

Platform

Plugin Creator

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 :)
I rarely make plugins now, but I still make them in spare time.
Disclaimer Please no request, I'm busy with real life stuff, I hope you understand ;)
You can find me here only. Discord is sh**, sorry JA :(

User avatar
22Alpha
Inhabitant of a Conurbation
Reactions:
Posts: 448
Joined: Sat Sep 23, 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.
:mine

User avatar
CommanderABab
AB
Reactions:
Posts: 8822
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

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.
Image

User avatar
22Alpha
Inhabitant of a Conurbation
Reactions:
Posts: 448
Joined: Sat Sep 23, 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 59 times
:mine

User avatar
FranchuFranchu
Inhabitant of a Country
Reactions:
Posts: 798
Joined: Sun May 28, 2017 0:07
Location: Freezing in Argentina
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Custom zones (RCI only tutorial)

#6

Post by FranchuFranchu »

Isn't there a way to make non-rci zones like the military one?
Did you know you can't blink while smiling :) ?

User avatar
FranchuFranchu
Inhabitant of a Country
Reactions:
Posts: 798
Joined: Sun May 28, 2017 0:07
Location: Freezing in Argentina
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Custom zones (RCI only tutorial)

#7

Post by FranchuFranchu »

I mean like the airport, where the zone has functionality
Did you know you can't blink while smiling :) ?

User avatar
Lobby
Developer
Reactions:
Posts: 3593
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
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 Megalopolis
Reactions:
Posts: 666
Joined: Wed Oct 24, 2018 13:41
Plugins: Show

Platform

Plugin Creator

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.
I have no clue what's happening this year

User avatar
Lobby
Developer
Reactions:
Posts: 3593
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
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.
=^._.^= ∫

Achmad Romi
Small-town resident
Reactions:
Posts: 26
Joined: Sat Aug 29, 2020 6:33
Location: Indonesia
Plugins: Show
Version: Beta

Re: Custom zones (RCI only tutorial)

#11

Post 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?

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”