Car & Road Flags

Find tutorials, documentation, and resources for creating and using TheoTown plugins.
User avatar
Marvel
Metropolitan
Reactions:
Posts: 111
Joined: 29 Nov 2020, 06:47
Location: Indonesia
Plugins: Showcase Store
Version: Beta

Re: Car & Road Flags

Post by Marvel » 17 Jan 2026, 10:00

Is it possible to have a different kind of flag in each lane of one way road
User avatar
JustAnyone
Honorary Contributor
Reactions:
Posts: 3664
Joined: 23 Jul 2017, 10:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Car & Road Flags

Post by JustAnyone » 17 Jan 2026, 18:25

No.
User avatar
Syn
Small-town resident
Reactions:
Posts: 29
Joined: 07 Jan 2021, 05:55

Plugin Creator

Platform

Re: Car & Road Flags

Post by Syn » 10 Mar 2026, 17:35

Why does road authority black car thingy still driving around my custom road, which basically now set up to be pedestrian only and I basically turn every flag off but pedestrian, are they on completely different flag which basically can drive on anything that labeled as road?
User avatar
equalDelight
Settler
Reactions:
Posts: 2
Joined: 02 Oct 2021, 11:46

Re: [390]Custom flags

Post by equalDelight » 28 Sep 2026, 17:51

Lobby wrote: 13 Dec 2017, 10:40 Version 390 will allow you to reference to your own flags by name. To allocate a flag that's called "lobby_newflag you may just write :json

Code: Select all

"allocate flag":["lobby_newflag"]  // "allocate flag":"lobby_newflag would work, too
To use it, write :json

Code: Select all

"flag lobby_newflag":true
You should add the definition above to every plugin which uses it (redefinition is therefore explicitly allowed). Just ensure that your flag name is some kind of unique.

⚠There's a limit of 20 custom flags in total.
Hi Lobby, I'm still confused how to allocate custom flag here.

Does it work if I just type

Code: Select all    Reset

[ { "allocate flag":"custom_flag" }, { "id":"$new_road", "title":"New Road", "type":"road", //... "flag custom_flag":true } ]
JSON checker
Check
Or do I need to add id and type?

Code: Select all    Reset

[ { "id":"$custom_flag", "type":"data", //honestly, I don't know what this does. I'm just guessing because it felt appropriate. "allocate flag":"custom_flag" }, //... ]
JSON checker
Check
Or do I need to type it inside one of the drafts?
Last edited by equalDelight on 28 Sep 2026, 18:01, edited 1 time in total.
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3756
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: Car & Road Flags

Post by Lobby » 22 Oct 2026, 08:43

You have to put it alongside the use site:

Code: Select all    Reset

[ { "id":"$new_road", "title":"New Road", "type":"road", //... "allocate flag":"custom_flag", "flag custom_flag":true } ]
JSON checker
Check
And use an array if you have multiple:

Code: Select all    Reset

[ { "id":"$new_road", "title":"New Road", "type":"road", //... "allocate flag":["custom_flag1", "custom_flag2"], "flag custom_flag1":true, "flag custom_flag2":true } ]
JSON checker
Check