Categories

Find tutorials, documentation, and resources for creating and using TheoTown plugins.
User avatar
wcs
Small-town resident
Reactions:
Posts: 38
Joined: 16 Jun 2019, 06:21
Plugins: Showcase Store

Re: Categories

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?
Follow me! @wackyserious on Twitter | Youtube for the latest updates on my projects!
User avatar
Kulche
Inhabitant of a Continent
Reactions:
Posts: 1194
Joined: 07 Jun 2017, 18:28
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

Post by Kulche »

wcs wrote: 10 Jul 2019, 23: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.
get yoked!!
User avatar
wcs
Small-town resident
Reactions:
Posts: 38
Joined: 16 Jun 2019, 06:21
Plugins: Showcase Store

Re: Categories

Post by wcs »

Kulche wrote: 11 Jul 2019, 08:21
wcs wrote: 10 Jul 2019, 23: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
Follow me! @wackyserious on Twitter | Youtube for the latest updates on my projects!
User avatar
CommanderABab
AB
Reactions:
Posts: 11269
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

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
my avatar:
y
yusuf8a684
Reactions:

Re: Categories

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
You do not have the required permissions to view the files attached to this post.
User avatar
wcs
Small-town resident
Reactions:
Posts: 38
Joined: 16 Jun 2019, 06:21
Plugins: Showcase Store

Re: Categories

Post by wcs »

Thank you so much guys, I am quite busy right now, I will try your suggestions when I am free. :)
Follow me! @wackyserious on Twitter | Youtube for the latest updates on my projects!
User avatar
Wepf
Inhabitant of a Megacity
Reactions:
Posts: 257
Joined: 14 Oct 2021, 08:19
Location: Your lucid dream
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

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
I play music and create theotown plugin (rarely)


Btw I'm from 🇹🇭 and I'm 13
User avatar
Wepf
Inhabitant of a Megacity
Reactions:
Posts: 257
Joined: 14 Oct 2021, 08:19
Location: Your lucid dream
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

Post by Wepf »

Wepf wrote: 19 Nov 2021, 12: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"
  }
]
I play music and create theotown plugin (rarely)


Btw I'm from 🇹🇭 and I'm 13
User avatar
Kulche
Inhabitant of a Continent
Reactions:
Posts: 1194
Joined: 07 Jun 2017, 18:28
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

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.
get yoked!!
User avatar
CommanderABab
AB
Reactions:
Posts: 11269
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

Post by CommanderABab »

my avatar:
S
StealthTown
Villager
Reactions:
Posts: 22
Joined: 20 Jun 2022, 21:26

Re: Categories

Post by StealthTown »

how to add subcategory inside a category?
User avatar
Kulche
Inhabitant of a Continent
Reactions:
Posts: 1194
Joined: 07 Jun 2017, 18:28
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

Post by Kulche »

You put the category into a category; same way as any other draft
User avatar
Evanzer
Inhabitant of a Megacity
Reactions:
Posts: 160
Joined: 07 Aug 2024, 00:09

Plugin Creator

Platform

Re: Categories

Post by Evanzer »

Kulche wrote: 08 Jul 2024, 10:09 You put the category into a category; same way as any other draft
Who
User avatar
Kulche
Inhabitant of a Continent
Reactions:
Posts: 1194
Joined: 07 Jun 2017, 18:28
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

Post by Kulche »

new member try to ask comprehensible question challenge
User avatar
Ross The Mayor
Small-town resident
Reactions:
Posts: 33
Joined: 20 Dec 2023, 21:30
Location: Jamaica
Plugins: Showcase Store
Version: Beta

Plugin Creator

Re: Categories

Post by Ross The Mayor »

Can anyone help. How do you place a plugin in a category within another of a category? So let's say a grass decal within a grass category within ground category in vanilla terrain category.
User avatar
Kulche
Inhabitant of a Continent
Reactions:
Posts: 1194
Joined: 07 Jun 2017, 18:28
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Categories

Post by Kulche »

you put the category draft inside of a category, there's nothing fancy involved