Page 2 of 3

Re: Categories

Posted: 09 Sep 2018, 17:35
by sairam

Re: Categories

Posted: 10 Sep 2018, 00:19
by Bearbear76
Show us the json

Re: Categories

Posted: 10 Sep 2018, 13:42
by sairam
The JSON code is here!

Code: Select all

[{"category":"$cat_zone00","frames":[{"bmp":"icon.png"}],"id":"$cat_newcat_zone",
    "ordinal":12,"title":" buildings","type":"category"}]

Re: Categories

Posted: 10 Sep 2018, 17:12
by CommanderABab
sairam wrote:
10 Sep 2018, 13:42
The JSON code is here!

Code: Select all

[{
 "category":"$cat_zone00",
 "frames":[{"bmp":"icon.png"}],
 "id":"$cat_newcat_zone",
 "ordinal":12,
 "title":" buildings",
 "type":"category"
}]

Re: Categories

Posted: 10 Sep 2018, 18:06
by sairam
Here is the pic! To know it detail see picture.
113443.png

Re: Categories

Posted: 30 Oct 2018, 17:41
by sairam
Can anyone help me with this?

Re: Categories

Posted: 16 Jan 2019, 04:38
by Shama
Can you put categories within categories?

Re: Categories

Posted: 16 Jan 2019, 04:42
by Shama
I guess i should add: I want to make a self created category- would I be able to put another category within that? Making a roads plugin, with various styles and options so this would be helpful, especially if road decos become too tedious or wont do what i want in some cases.

Re: Categories

Posted: 16 Jan 2019, 05:08
by CommanderABab
Shama wrote:
16 Jan 2019, 04:38
Can you put categories within categories?
Yes, you can do that.

Re: Categories

Posted: 16 Jan 2019, 06:12
by Shama
Yay, I got it to work. Seems, at least for me, easier to use separate jsons- as loaded in one json, even with category ids in alphabetical order, i could not get it it work. But with separate jsons for each category in the zip and the main category with file name "acat...." and the categories within "bcat...." and within those (kinda crazy just testing, all 3 within transport category :D) "cat...".

Re: Categories

Posted: 09 Jul 2019, 08:39
by wcs
I could not make my category work

Code: Select all

[
  {
    "id":"cat_neuterland",
    "ordinal":0
    "type":"category", 
    "category":"$cat_zone00",
    "frames":[{"bmp":"neuterlandicon.png"}],
    "title":"Neuterland",
  }
]
After that, I tag all of my .json with

Code: Select all

    "category":"$cat_neuterland00",
I have 1 .json for the category, and 6 other for my RCI zones.

It gives me error, stating that no such category could be found

Re: Categories

Posted: 09 Jul 2019, 17:01
by JustAnyone
Make sure category draft is loaded first.

Re: Categories

Posted: 09 Jul 2019, 17:02
by yusuf8a684
If you want I can give you a json

Re: Categories

Posted: 10 Jul 2019, 13:49
by wcs
Still not able to make it functional.

Recent code,

Sample category .json

Code: Select all

[
  {
    "type":"category",
    "ordinal":0,
    "id":"cat_neuterland",
    "frames":[{"bmp":"cat_neuterland.png"}],
    "title":"Neuterland"
  }
]
Sample zone .json

Code: Select all

[
  {
    "category":"cat_neuterland",
    "ordinal":0,
    "author":"wcs",
	"id":"neuterland_mall_zone.wcs",
	"title":"Neuterland Mall",
	"text":"Malls brought to you by Neuterland Inc.",
	"base":"$zonecommercial",
	"type":"zone",
	"frames":[{"x":352,"y":0,"w":32,"h":16}],
	"map color":{"r":91,"g":95,"b":255},
	"preview frames":[{"bmp":"zoneiconneuterlandmall.png"}],
	"draw ground":true,
	"height":1,
	"width":1,
        "needs road":false,
	"placeable":true,
	"price":25,
	"rci":true
  },
  {
	"id":"neuterland_mall_decor_1x1",
	"title":"Neuterland Mall Decor",
	"text":"Simple Mall Decor.",
	"type":"decoration",
	"frames":[{"bmp":"neuterland_mall_decor_1x1.png"}],
	"meta":{"tags":{"decorator":{"zones":["neuterland_mall_zone.wcs"]}}},
	"draw ground":true,
	"needs road":false,
	"height":1,
	"width":1
  },
  {
	"id":"neuterland_mall_2x2_f1",
	"title":"Neuterland Mall 1F",
	"text":"Single floor mall.",
	"type":"commercial",
	"frames":[{"bmp":"neuterland_mall_2x2_f1.png","count":8,"frames":8,"w":64}],
	"draw ground":true,
	"height":2,
	"width":2,
	"workers":15,
	"zone":"neuterland_mall_zone.wcs",
	"level":"1"
  },
]

Re: Categories

Posted: 10 Jul 2019, 18:22
by yusuf8a684
Try to add 0 to category json/file name's first

Re: Categories

Posted: 11 Jul 2019, 01:38
by wcs
Renamed it to 0cat_neuterland_zone, still getting the category not found error.

Did i wrote my code correctly, above? Also, my category is a separate .json and not a part of the zones .json, that will work right?

Re: Categories

Posted: 11 Jul 2019, 10:21
by Kulche
wcs wrote:
11 Jul 2019, 01:38
My category is a separate .json and not a part of the zones .json.
If the category json is after the zone json then it won't work. Put some zs in zone json or as in cat json.

Re: Categories

Posted: 12 Jul 2019, 00:43
by wcs
Kulche wrote:
11 Jul 2019, 10:21
wcs wrote:
11 Jul 2019, 01:38
My category is a separate .json and not a part of the zones .json.
If the category json is after the zone json then it won't work. Put some zs in zone json or as in cat json.
Thanks, I will try this one, where do I put this? On the each of the .json ID?

@yusuf8a684 Could you send the sample .json that you offered, I would like to take a look at it and see if I can implement it in my .json, thanks! :space

Re: Categories

Posted: 12 Jul 2019, 01:08
by CommanderABab
No, you just name the category defining json with a name that TheoTown will read before any json that uses the category.

This can be folders or json file names.

Folder named 000c
File named Category.json
Folder named UsesCategory
File named UsesCategory.json

Or if files are in same folder, then:
000definescat.json
Usescat.json

Re: Categories

Posted: 12 Jul 2019, 01:54
by yusuf8a684
IMG_20190712_025135.jpg
Oh, that's right.
Category folders should be upper from it's items. Like, red circled folder is category of the categories that shown with red arrow and yellow circled folder is category of the rails

These all folders that has 00 in the name is a category folder