Page 3 of 3
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!

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
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
Re: Categories
Posted: 13 Jul 2019, 01:18
by wcs
Thank you so much guys, I am quite busy right now, I will try your suggestions when I am free.

Re: Categories
Posted: 19 Nov 2021, 14:39
by Wepf
For no reason, the building keep saying that there is no any category that match the one I coded to the building EVEN I copy id from the custom category that I made
Re: Categories
Posted: 19 Nov 2021, 14:45
by Wepf
Wepf wrote: ↑19 Nov 2021, 14:39
For no reason, the building keep saying that there is no any category that match the one I coded to the building EVEN I copy id from the custom category that I made
Here is the building code and category code
Code: Select all
[
{
"id":"$train_depot00",
"type":"railway station",
"author":"Wepf",
"frame":[{"bmp":"DepotRed1.png"},
{"bmp":"DepotRed2.png"},
{"bmp":"DepotRed3.png"},
{"bmp":"DepotRed4.png"}],
"title":"Train depot",
"text":"For store, repair and maintaince train. This one spawn non-electric trains.",
"influence passenger train":45,
"influence noise":5,
"capacity":45,
"category":"$Bri'ish00",
"height":1,
"width":1,
"build time":5,
"rotation aware":true,
"car spawner":[{"targets":["$train_platform00","$train_platform01","$train_depot00","$train_depot01"],
"cars":["$theored","theoblue"],
"flag normal":false,
"flag tram":true,
"flag train":true,
"count":4,
"radius":600,
"level":0}],
"car local only":true,
"needs road":false,
"price":100,
"monthly price":30
},
{
"id":"$train_depot01",
"type":"railway station",
"author":"Wepf",
"frame":[{"bmp":"Depot1.png"},
{"bmp":"Depot.png"},
{"bmp":"Depot2.png"},
{"bmp":"Depot3.png"}],
"title":"Modern trains' depot",
"text":"For store, repair and maintaince train. This one spawn electric trains.",
"width":2,
"height":2,
"build time":10,
"needs road":false,
"price":150,
"monthly price":60,
"car local only":true,
"car spawner":[{"targets":["$train_platform00","$train_platform01","$train_depot00","$train_depot01"],
"cars":["$Qqqqqq00","$Qqqqqq01"],
"flag normal":false,
"flag train":true,
"count":4,
"radius":600,
"level":0}],
"influence passenger train":45,
"influence noise":5,
"capacity":45,
"rotation aware":true,
"category":"$Bri'ish00"
}
]
Code: Select all
[
{
"id":"$Bri'ish00",
"frame":[{"bmp":"Trackless-Tram.png"}],
"title":"Trackless train system",
"text":"Like normal train and tram system but the railway guides vehicle using an underground signal below the rail instead of tracks.",
"type":"category"
}
]
Re: Categories
Posted: 19 Nov 2021, 15:19
by Kulche
Categories have to be loaded before they are called, so the best practice would be to put its definition in the same file.
Re: Categories
Posted: 20 Nov 2021, 03:08
by CommanderABab
Re: Categories
Posted: 08 Jul 2024, 02:24
by StealthTown
how to add subcategory inside a category?
Re: Categories
Posted: 08 Jul 2024, 12:09
by Kulche
You put the category into a category; same way as any other draft
Re: Categories
Posted: 15 Aug 2024, 11:44
by Evanzer
Kulche wrote: ↑08 Jul 2024, 12:09
You put the category into a category; same way as any other draft
Who
Re: Categories
Posted: 15 Aug 2024, 19:09
by Kulche
new member try to ask comprehensible question challenge