Categories

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
wcs
Small-town resident
Reactions:
Posts: 38
Joined: 16 Jun 2019, 08:21
Plugins: Showcase Store
Contact:

Re: Categories

#41

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

User avatar
Kulche
Pluche
Reactions:
Posts: 1141
Joined: 07 Jun 2017, 20:28
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

#42

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

User avatar
wcs
Small-town resident
Reactions:
Posts: 38
Joined: 16 Jun 2019, 08:21
Plugins: Showcase Store
Contact:

Re: Categories

#43

Post 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

User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

#44

Post 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

User avatar
yusuf8a684
Reactions:

Re: Categories

#45

Post 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

User avatar
wcs
Small-town resident
Reactions:
Posts: 38
Joined: 16 Jun 2019, 08:21
Plugins: Showcase Store
Contact:

Re: Categories

#46

Post by wcs »

Thank you so much guys, I am quite busy right now, I will try your suggestions when I am free. :)

User avatar
Wepf
Inhabitant of a Megacity
Reactions:
Posts: 285
Joined: 14 Oct 2021, 10:19
Location: Your lucid dream
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

#47

Post 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

User avatar
Wepf
Inhabitant of a Megacity
Reactions:
Posts: 285
Joined: 14 Oct 2021, 10:19
Location: Your lucid dream
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

#48

Post 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"
  }
]

User avatar
Kulche
Pluche
Reactions:
Posts: 1141
Joined: 07 Jun 2017, 20:28
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

#49

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

User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

#50

Post by CommanderABab »


Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”