Car & Road Flags

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
Lobby
Developer
Reactions:
Posts: 3650
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta

Platform

[390]Custom flags

#21

Post by Lobby »

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.
=^._.^= ∫

User avatar
Lobby
Developer
Reactions:
Posts: 3650
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta

Platform

Re: Cars & Roads: Flags

#22

Post by Lobby »

It's more than you had with user0 etc. :)
You shouldn't use them anymore.
=^._.^= ∫

User avatar
Josh
Graphic designer
Reactions:
Posts: 2223
Joined: Sat Mar 11, 2017 19:20
Location: The Netherlands
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Cars & Roads: Flags

#23

Post by Josh »

But how can you add special things to the flag?
TheoTown player since update 1.1.50

Creator of Aldorria, Covinton Empire, West Country, Sunnydale

User avatar
Lobby
Developer
Reactions:
Posts: 3650
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta

Platform

Re: Cars & Roads: Flags

#24

Post by Lobby »

What do you mean by special things?
=^._.^= ∫

User avatar
Josh
Graphic designer
Reactions:
Posts: 2223
Joined: Sat Mar 11, 2017 19:20
Location: The Netherlands
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Cars & Roads: Flags

#25

Post by Josh »

Things like influences and fun
TheoTown player since update 1.1.50

Creator of Aldorria, Covinton Empire, West Country, Sunnydale

User avatar
Lobby
Developer
Reactions:
Posts: 3650
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta

Platform

Re: Cars & Roads: Flags

#26

Post by Lobby »

Interesting idea :)
=^._.^= ∫

User avatar
22Alpha
Inhabitant of a Conurbation
Reactions:
Posts: 448
Joined: Sat Sep 23, 2017 14:29

Platform

Re: Cars & Roads: Flags

#27

Post by 22Alpha »

Yup, I was waiting for it as well haha
:mine

User avatar
Krepel
Villager
Reactions:
Posts: 9
Joined: Thu May 24, 2018 22:12
Location: Cracow, Lesser Poland, Poland
Plugins: Show

Re: Cars & Roads: Flags

#28

Post by Krepel »

So wait, if I'd make a tram plugin, which flags should I use to only allow trams on the rails?

i don't really understand the flags thing
Marsz Polonia, marsz!

User avatar
NEPman
Small-town resident
Reactions:
Posts: 37
Joined: Tue Apr 24, 2018 13:15
Location: <..>
Plugins: Show

Platform

Re: Cars & Roads: Flags

#29

Post by NEPman »

How to prohibit the passage of fire trucks, ambulances and police cars on my way?

User avatar
yusuf8a684
Inhabitant of a Planet
Reactions:
Posts: 1438
Joined: Sun Dec 10, 2017 22:09
Location: Turkiye
Plugins: Show

Plugin Creator

Platform

Re: Cars & Roads: Flags

#30

Post by yusuf8a684 »

NEPman wrote:
Fri Jul 27, 2018 15:40
@Lobby[Posts][PM], how to prohibit the passage of fire trucks, ambulances and police cars on my road?
We can't i think
The Internet Addict

Dont trust me, I am sometimes a, sometimes b and sometimes z. Have some stages of charecters thats always in a cycle. Cant even trust myself...

LOL

User avatar
Lobby
Developer
Reactions:
Posts: 3650
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta

Platform

Re: Cars & Roads: Flags

#31

Post by Lobby »

Exactly, fire trucks etc. are designed to be able to drive on pkw, lkw, bus, tractor, military, pedestrian, tram or airport roads. You'd have to define a road that has none of these flags set in order to hinder fire trucks etc. from using it.
=^._.^= ∫

User avatar
Lobby
Developer
Reactions:
Posts: 3650
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta

Platform

Re: Re: Cars & Roads: Flags

#32

Post by Lobby »

Added a listing to all flags included in the game to the first post; Please favor them over own ones if reasonable to share behavior between different plugins.
The trains in the game use

Code: Select all

"flag train":true
=^._.^= ∫

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2129
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Contact:

Platform

Plugin Creator

Re: Car & Road Flags

#33

Post by KINGTUT10101 »

Is there a flag for emergency vehicles?

User avatar
Lobby
Developer
Reactions:
Posts: 3650
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta

Platform

Re: Car & Road Flags

#34

Post by Lobby »

Not yet, might be added in the future :bt
=^._.^= ∫

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2129
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Contact:

Platform

Plugin Creator

Re: Car & Road Flags

#35

Post by KINGTUT10101 »

Any news on this?

User avatar
CommanderABab
AB
Reactions:
Posts: 9438
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Cars & Roads: Flags

#36

Post by CommanderABab »

CommanderABab wrote:
Fri Aug 11, 2017 2:44
1l
What?
...............:) .Image

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2129
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Contact:

Platform

Plugin Creator

Re: Car & Road Flags

#37

Post by KINGTUT10101 »

Has a flag for service vehicles been added yet?

User avatar
yusuf8a684
Inhabitant of a Planet
Reactions:
Posts: 1438
Joined: Sun Dec 10, 2017 22:09
Location: Turkiye
Plugins: Show

Plugin Creator

Platform

Re: Car & Road Flags

#38

Post by yusuf8a684 »

I tried creating my own flag but still cars aren't spawning

Code: Select all    Reset

[ { "frames": [ { "bmp": "subaru_impreza.png", "count": 4, "h": 9, "w": 12 } ], "id": "subaru_offroad_racecar", "allocate flag": "rallycars", "type": "car", "v2": true, "flag rallycars": true, "flag normal": false, "speed": 1.7 }, { "frames": [ { "bmp": "mg_metro.png", "count": 4, "h": 8, "w": 11 } ], "id": "metro_offroad_racecar", "allocate flag": "rallycars", "type": "car", "v2": true, "flag rallycars": true, "flag normal": false, "speed": 1.5 }, { "frames": [ { "bmp": "ford_focus.png", "count": 4, "h": 8, "w": 11 } ], "id": "focus_offroad_racecar", "allocate flag": "rallycars", "type": "car", "v2": true, "flag rallycars": true, "flag normal": false, "speed": 1.6 }, { "frames": [ { "bmp": "dirt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "dirt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "dirt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "dirt_offroad.png", "count": 16, "h": "16", "w": 32 } ], "id": "offroad_road_dirt", "speed": 1.5, "allocate flag": "rallycars", "type": "road", "flag normal": false, "flag rallycars": true, "author": "yusuf8a684, Lobby and Theotheoderich", "category": "$offroad-addon", "draw ground": true, "height": 1, "price": 5, "text": "Dirt off-road roads are a bit slower than asphalt off-road roads", "title": "Dirt Off-Road Road", "width": 1, "level": 0, "one way": true, "flag pkw": false, "flag lkw": false, "flag tram": false }, { "author": "yusuf8a684, Lobby and Theotheoderich", "category": "$offroad-addon", "allocate flag": "rallycars", "draw ground": true, "frames": [ { "bmp": "asphalt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "asphalt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "asphalt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "asphalt_offroad.png", "count": 16, "h": "16", "w": 32 } ], "height": 1, "id": "offroad_road", "price": 10, "text": "Asphalt off-road roads are little bit faster than dirt off-road roads", "title": "Asphalt Off-road Road", "type": "road", "width": 1, "level": 1, "one way": true, "speed": 2, "flag rallycars": true, "flag normal": false, "flag tram": false, "flag pkw": false, "flag lkw": false }]
JSON checker
Check

Edit: I will just use tractor, I don't think that will be a much problem tractors running on rally roads hehe
The Internet Addict

Dont trust me, I am sometimes a, sometimes b and sometimes z. Have some stages of charecters thats always in a cycle. Cant even trust myself...

LOL

User avatar
Imran M
Inhabitant of a Country
Reactions:
Posts: 811
Joined: Wed Oct 24, 2018 13:41
Plugins: Show

Platform

Plugin Creator

Re: Car & Road Flags

#39

Post by Imran M »

yusuf8a684 wrote:
Tue Mar 02, 2021 13:14
I tried creating my own flag but still cars aren't spawning

Code: Select all    Reset

[ { "frames": [ { "bmp": "subaru_impreza.png", "count": 4, "h": 9, "w": 12 } ], "id": "subaru_offroad_racecar", "allocate flag": "rallycars", "type": "car", "v2": true, "flag rallycars": true, "flag normal": false, "speed": 1.7 }, { "frames": [ { "bmp": "mg_metro.png", "count": 4, "h": 8, "w": 11 } ], "id": "metro_offroad_racecar", "allocate flag": "rallycars", "type": "car", "v2": true, "flag rallycars": true, "flag normal": false, "speed": 1.5 }, { "frames": [ { "bmp": "ford_focus.png", "count": 4, "h": 8, "w": 11 } ], "id": "focus_offroad_racecar", "allocate flag": "rallycars", "type": "car", "v2": true, "flag rallycars": true, "flag normal": false, "speed": 1.6 }, { "frames": [ { "bmp": "dirt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "dirt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "dirt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "dirt_offroad.png", "count": 16, "h": "16", "w": 32 } ], "id": "offroad_road_dirt", "speed": 1.5, "allocate flag": "rallycars", "type": "road", "flag normal": false, "flag rallycars": true, "author": "yusuf8a684, Lobby and Theotheoderich", "category": "$offroad-addon", "draw ground": true, "height": 1, "price": 5, "text": "Dirt off-road roads are a bit slower than asphalt off-road roads", "title": "Dirt Off-Road Road", "width": 1, "level": 0, "one way": true, "flag pkw": false, "flag lkw": false, "flag tram": false }, { "author": "yusuf8a684, Lobby and Theotheoderich", "category": "$offroad-addon", "allocate flag": "rallycars", "draw ground": true, "frames": [ { "bmp": "asphalt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "asphalt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "asphalt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "asphalt_offroad.png", "count": 16, "h": "16", "w": 32 } ], "height": 1, "id": "offroad_road", "price": 10, "text": "Asphalt off-road roads are little bit faster than dirt off-road roads", "title": "Asphalt Off-road Road", "type": "road", "width": 1, "level": 1, "one way": true, "speed": 2, "flag rallycars": true, "flag normal": false, "flag tram": false, "flag pkw": false, "flag lkw": false }]
JSON checker
Check
You need to actually spawn the cars through a building. This can be done by:

Code: Select all    Reset

"car spawner":[{ "cars":["metro_offroad_racecar","subaru_offroad_racecar"], //Put in the ids of the cars of cars "radius":10, //Put in the area you want them to spawn in "count":3 //Put in how many you want to spawn }]
JSON checker
Check
Add this code to a regular building and not the car, and I think it should work

I'm pretty sure that there's something called "target" where the cars go to a specific building, but I'm not sure about that part. You could check in the documentation for cars in this part of the forum.
I just love the DOPE-amine you get after completing a plugin!

User avatar
yusuf8a684
Inhabitant of a Planet
Reactions:
Posts: 1438
Joined: Sun Dec 10, 2017 22:09
Location: Turkiye
Plugins: Show

Plugin Creator

Platform

Re: Car & Road Flags

#40

Post by yusuf8a684 »

Imran M wrote:
Tue Mar 02, 2021 16:23
yusuf8a684 wrote:
Tue Mar 02, 2021 13:14
I tried creating my own flag but still cars aren't spawning

Code: Select all    Reset

[ { "frames": [ { "bmp": "subaru_impreza.png", "count": 4, "h": 9, "w": 12 } ], "id": "subaru_offroad_racecar", "allocate flag": "rallycars", "type": "car", "v2": true, "flag rallycars": true, "flag normal": false, "speed": 1.7 }, { "frames": [ { "bmp": "mg_metro.png", "count": 4, "h": 8, "w": 11 } ], "id": "metro_offroad_racecar", "allocate flag": "rallycars", "type": "car", "v2": true, "flag rallycars": true, "flag normal": false, "speed": 1.5 }, { "frames": [ { "bmp": "ford_focus.png", "count": 4, "h": 8, "w": 11 } ], "id": "focus_offroad_racecar", "allocate flag": "rallycars", "type": "car", "v2": true, "flag rallycars": true, "flag normal": false, "speed": 1.6 }, { "frames": [ { "bmp": "dirt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "dirt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "dirt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "dirt_offroad.png", "count": 16, "h": "16", "w": 32 } ], "id": "offroad_road_dirt", "speed": 1.5, "allocate flag": "rallycars", "type": "road", "flag normal": false, "flag rallycars": true, "author": "yusuf8a684, Lobby and Theotheoderich", "category": "$offroad-addon", "draw ground": true, "height": 1, "price": 5, "text": "Dirt off-road roads are a bit slower than asphalt off-road roads", "title": "Dirt Off-Road Road", "width": 1, "level": 0, "one way": true, "flag pkw": false, "flag lkw": false, "flag tram": false }, { "author": "yusuf8a684, Lobby and Theotheoderich", "category": "$offroad-addon", "allocate flag": "rallycars", "draw ground": true, "frames": [ { "bmp": "asphalt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "asphalt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "asphalt_offroad.png", "count": 16, "h": "16", "w": 32 }, { "bmp": "asphalt_offroad.png", "count": 16, "h": "16", "w": 32 } ], "height": 1, "id": "offroad_road", "price": 10, "text": "Asphalt off-road roads are little bit faster than dirt off-road roads", "title": "Asphalt Off-road Road", "type": "road", "width": 1, "level": 1, "one way": true, "speed": 2, "flag rallycars": true, "flag normal": false, "flag tram": false, "flag pkw": false, "flag lkw": false }]
JSON checker
Check
You need to actually spawn the cars through a building. This can be done by:

Code: Select all    Reset

"car spawner":[{ "cars":["metro_offroad_racecar","subaru_offroad_racecar"], //Put in the ids of the cars of cars "radius":10, //Put in the area you want them to spawn in "count":3 //Put in how many you want to spawn }]
JSON checker
Check
Add this code to a regular building and not the car, and I think it should work

I'm pretty sure that there's something called "target" where the cars go to a specific building, but I'm not sure about that part. You could check in the documentation for cars in this part of the forum.
Thank you for your help but they actually have spawners. Didn't put their codes here
The Internet Addict

Dont trust me, I am sometimes a, sometimes b and sometimes z. Have some stages of charecters thats always in a cycle. Cant even trust myself...

LOL

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”