Page 1 of 2

Car & Road Flags

Posted: 07 Aug 2017, 10:39
by Lobby
With version 330 you have to ability to allow only passenger cars/truck on your own roads using flags.

If only passenger cars should be allowed add:

Code: Select all

"flag normal":false,
"flag pkw":true
To allow trucks only use:

Code: Select all

"flag normal":false,
"flag lkw":true
You have to set flag normal to false as it's enabled by default and includes booth, passenger cars and trucks.
roadflags.png
roadflags.png (43.87 KiB) Viewed 11346 times
Ensure to set these flags properly for your own cars in case you use car plugins. The code is the same as for roads.

Flags that are pre-defined by the game:

Code: Select all

"flag all"          // Special flag that enables all other flags at once
"flag normal"       // Special flag that enables some default flags (for roads that is pkw, lkw, tractor and bus)

"flag military"
"flag pedestrian"
"flag tram"
"flag airport"

"flag pkw"
"flag lkw"
"flag bus"
"flag tractor"

"flag train"
"flag maglev"
"flag monorail"
"flag high speed"
"flag subway"

Re: Cars & Roads: Flags

Posted: 07 Aug 2017, 10:48
by Josh
Is it possible in future to have bus flags?
Good job Lobby!

Re: Cars & Roads: Flags

Posted: 07 Aug 2017, 10:55
by Lobby
Of course :)

Re: Cars & Roads: Flags

Posted: 11 Aug 2017, 02:44
by CommanderABab
1l

Re: Cars & Roads: Flags

Posted: 11 Aug 2017, 02:44
by CommanderABab

Code: Select all

"flag normal":false,
"flag lkw":true
"flag normal":false,
"flag lkw":true

Re: Cars & Roads: Flags

Posted: 11 Aug 2017, 02:48
by CommanderABab
So, what does the l in lkw stand for?

Re: Cars & Roads: Flags

Posted: 11 Aug 2017, 16:25
by Lobby
LKW stands for Lastkraftwagen

Last means heavy things.

Re: Cars & Roads: Flags

Posted: 11 Aug 2017, 18:06
by CommanderABab
Thanks!

Re: Cars & Roads: Flags

Posted: 22 Sep 2017, 06:45
by JustAnyone
Is it possible to add custom Flags to the cars?

Re: Cars & Roads: Flags

Posted: 22 Sep 2017, 07:34
by CommanderABab
User2 through user9

Re: Cars & Roads: Flags

Posted: 22 Sep 2017, 15:11
by JustAnyone
How do I make that my Custom cars Use The road? Anything at car spawner or somethin'?

Re: Cars & Roads: Flags

Posted: 22 Sep 2017, 21:43
by Lobby
Set a flag (e.g. user7) in both, your road and your car plugin.

Re: Cars & Roads: Flags

Posted: 18 Nov 2017, 12:17
by JustAnyone
former member wrote:
18 Nov 2017, 12:12
What's the flag for buses?
I used

Code: Select all

flag bus:false;
, but buses are still driving on the road
Passenger I think.

Re: Cars & Roads: Flags

Posted: 18 Nov 2017, 12:35
by CommanderABab
Need quotes around flag bus.

Re: Cars & Roads: Flags

Posted: 18 Nov 2017, 12:43
by CommanderABab
No. I don't know if a flag bus exists. But if it did you would need

Code: Select all

"flag bus":false
to exclude buses.

Re: Cars & Roads: Flags

Posted: 18 Nov 2017, 13:08
by 22Alpha
CommanderABab wrote:
18 Nov 2017, 12:43
No. I don't know if a flag bus exists. But if it did you would need

Code: Select all

"flag bus":false
to exclude buses.
I tried that one, and the code was accepted. But I haven't kept an eye whether it works.

Re: Cars & Roads: Flags

Posted: 18 Nov 2017, 13:30
by CommanderABab
Lots of things are just ignored if they don't exist.

Re: Cars & Roads: Flags

Posted: 29 Nov 2017, 20:19
by Lobby
Yes, "flag bus":true exists :)

[390]Custom flags

Posted: 13 Dec 2017, 12:40
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.

Re: Cars & Roads: Flags

Posted: 13 Dec 2017, 12:48
by Lobby
It's more than you had with user0 etc. :)
You shouldn't use them anymore.