The ACTUAL tutorial on flags

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
FranchuFranchu
Inhabitant of a Country
Posts: 799
Joined: 28 May 2017, 00:07
Location: Freezing in Argentina
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

The ACTUAL tutorial on flags

#1

Post by FranchuFranchu »

Since KoalaGuy was deleted, all his posts are gone. One of those posts was about flags. So here I am remaking the tutorial


Flags are used to make certain cars go only in certain roads. In the game it is used in the bus road.
First, you have to make a road with the flag

Code: Select all

[
  {
    "id":"$testroad00",
    "type":"road",
    "level":1,
    "speed":2.0,

    "frames":[{"bmp":"road.png","w":32,"h":16,"count":16}],
    "flag normal":false, //No cars can go here
    "flag pkw":true //But passenger cars can
  }
]
Next, we will have to make a car that drives here

Code: Select all

[
  {
    "id":"FranFran.carplugin00",
    "type":"car",
    "frames":[
      {"bmp":"carsample.png","w":18,"h":12,"count":4}
    ],
    "v2":true,
    "flag normal":false, //this is not a normal car
    "flag pkw":true //this is a passenger car!
  }
]

Done!
Original topic

All possible flags:
"flag all"
"flag normal"
"flag pkw"
"flag lkw"
"flag bus"
"flag tram"
"flag airport"
"flag pedestrian"
"flag military"
"flag user0"
"flag user1"
...
"flag user9"
Lobby wrote:
13 Dec 2017, 12: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.

User avatar
cesareborgia94

Re: The ACTUAL tutorial on flags

#2

Post by cesareborgia94 »

Thank you Franchu
Now please do a tutorial on custom animation, please...

User avatar
Patchouli Knowledge
Townsman
Posts: 62
Joined: 26 Sep 2020, 09:42

Re: The ACTUAL tutorial on flags

#3

Post by Patchouli Knowledge »

What do PKW and LKW stand for respectively

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

Plugin Creator

Platform

Re: The ACTUAL tutorial on flags

#4

Post by CommanderABab »

Pkw are trucks.
Lkw might be cars.

User avatar
JustAnyone
Developer
Posts: 3558
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: The ACTUAL tutorial on flags

#5

Post by JustAnyone »

They appropriately mean personenkraftwagen and lastkraftwagen.

User avatar
Ostrovsk
Villager
Posts: 13
Joined: 13 Oct 2023, 18:31

Re: The ACTUAL tutorial on flags

#6

Post by Ostrovsk »

Good day to everyone, I would like to ask a question. No more than 20 user flags with user 0-9 or up to 20 own flags without user?

User avatar
Jamal Andi
Inhabitant of a Planet
Posts: 1494
Joined: 11 Oct 2023, 20:05
Location: Münster, Germany
Plugins: Showcase Store
Contact:

Platform

Re: The ACTUAL tutorial on flags

#7

Post by Jamal Andi »

JustAnyone wrote:
04 Apr 2022, 10:20
They appropriately mean personenkraftwagen and lastkraftwagen.
Sehr deutsch

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”