Change in res/ind car identification

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
Lobby
Developer
Reactions:
Posts: 3184
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Change in res/ind car identification

Post by Lobby » Sun Feb 25, 2018 14:16

Hi, in the past you had to override one of the cars "$carres00", ..., "$carind00", ... in order to get your own residential/commercial/industrial cars into the game. Version 437 will change that behavior. The game will then identify such cars not by their id but by the tags they set.

To mark your car as level1 residential car use :json

Code: Select all

"meta":{
  "tags":{
    "carres0":{}
  }
}
For a level 3 industrial car use :json

Code: Select all

"meta":{
  "tags":{
    "carind2":{}
  }
}
The complete definition of a level 1 residential car would look like :json

Code: Select all

 {
  "id":"$carres00",
  "type":"car",
  "frames":[
    {"x":512,"y":512,"w":12,"h":10,"count":8}
  ],
  "v2":true,
  "auto colorize":true,    // Can be used to color white frames
  "flag normal":false,     // This is not a normal car as it's not a truck
  "flag pkw":true,         // And only for person transport
  "meta":{
    "tags":{
      "carres0":{}         // You may use mutliple tags for one car
    }
  }
}
I consider to will add support for plugins that aren't updated to these changes (as by default, a override would remove any tag information, therefore outdated plugins wouldn't work anymore). These changes are needed in order to add more rci cars without tampering with the existing ones.

Plugin creators who might find this information useful: @CommanderABab @Josh @JustAnyone @KoalaGuy @A dutch Guy @22Alpha @Borbor @former member
...Have a nice stay

User avatar
Borbor
Inhabitant of a Conurbation
Reactions:
Posts: 354
Joined: Thu Apr 27, 2017 14:03
Location: Republic of Turkey
Plugins: Show
Version: Beta
Phone model: TT 175

Re: ⚠ Important change in res/ind car identification

Post by Borbor » Sun Feb 25, 2018 15:19

@lobby[Posts][PM] only extensions that use the override feature will not work?
Plugin maker
My plugins are open source
:bp :mine
http://www.theotown.com/forum/search.ph ... =firstpost
"Our true mentor in life is science."
Mustafa Kemal Atatürk

User avatar
Lobby
Developer
Reactions:
Posts: 3184
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Re: ⚠ Important change in res/ind car identification

Post by Lobby » Sun Feb 25, 2018 15:21

Yes, cars that override $carres00 etc. might not work as expected anymore. I suggest to use your own id for your cars then and add the appropriate tags as shown above.
...Have a nice stay

User avatar
A dutch Guy
Inhabitant of a Megacity
Reactions:
Posts: 151
Joined: Tue Dec 26, 2017 14:41
Location: Enschede, The Netherlands
Plugins: Show

Re: ⚠ Important change in res/ind car identification

Post by A dutch Guy » Sun Feb 25, 2018 19:47

This is indeed very useful for me

User avatar
Lobby
Developer
Reactions:
Posts: 3184
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Re: Change in res/ind car identification

Post by Lobby » Tue Apr 17, 2018 10:34

Service cars can now be tagged the same way. So you can just add new medic cars for example.

Code: Select all

"meta":{"tags":{"fire brigade":{}}}

Code: Select all

"meta":{"tags":{"medic":{}}}

Code: Select all

"meta":{"tags":{"police":{}}}

Code: Select all

"meta":{"tags":{"swat":{}}}
@Borbor
...Have a nice stay

User avatar
A dutch Guy
Inhabitant of a Megacity
Reactions:
Posts: 151
Joined: Tue Dec 26, 2017 14:41
Location: Enschede, The Netherlands
Plugins: Show

Re: Change in res/ind car identification

Post by A dutch Guy » Thu Jul 19, 2018 17:59

Lobby wrote:
Tue Apr 17, 2018 10:34
Service cars can now be tagged the same way. So you can just add new medic cars for example.

Code: Select all

"meta":{"tags":{"fire brigade":{}}}

Code: Select all

"meta":{"tags":{"medic":{}}}

Code: Select all

"meta":{"tags":{"police":{}}}

Code: Select all

"meta":{"tags":{"swat":{}}}
is there a tag for military vehicles as well?

User avatar
Lobby
Developer
Reactions:
Posts: 3184
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Re: Change in res/ind car identification

Post by Lobby » Thu Jul 19, 2018 23:31

I will add

Code: Select all

"meta":{"tags":{"military tank":{}}}
and

Code: Select all

"meta":{"tags":{"military truck":{}}}
The difference between the two is the building they spawn from.
...Have a nice stay

ElephantEthan
Inhabitant of a Megacity
Reactions:
Posts: 299
Joined: Sun Aug 26, 2018 14:07
Plugins: Show

Re: Change in res/ind car identification

Post by ElephantEthan » Wed Aug 29, 2018 21:08

Is there a tag for farm tractors? Can also trailers/tails be added using this method?

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

Re: Change in res/ind car identification

Post by CommanderABab » Wed Aug 29, 2018 23:26

Probably:

Code: Select all

"meta":{
  "tags":{
    "carind0":{}
  }
}
.or similar.

#tail let's see.

Car Chains
587587Currently using beta 587. 587 What's new? :)
bus routes are supposed to be fixed!!
:cry:

Telegram - t.me/
🆎️🆎️🆎️🆎️Commander🆎️🆎️

ElephantEthan
Inhabitant of a Megacity
Reactions:
Posts: 299
Joined: Sun Aug 26, 2018 14:07
Plugins: Show

Re: Change in res/ind car identification

Post by ElephantEthan » Thu Aug 30, 2018 6:14

Right, I thought tails were in the car spawner for some reason. Thank you very much for the info @CommanderABab !

User avatar
A dutch Guy
Inhabitant of a Megacity
Reactions:
Posts: 151
Joined: Tue Dec 26, 2017 14:41
Location: Enschede, The Netherlands
Plugins: Show

Re: Change in res/ind car identification

Post by A dutch Guy » Thu Nov 08, 2018 18:48

@Lobby

Is there also a tag for the airport cars?

User avatar
Lobby
Developer
Reactions:
Posts: 3184
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Re: Change in res/ind car identification

Post by Lobby » Sat Nov 10, 2018 12:30

@A dutch Guy Great idea!
I'll add the tag "airport taxi" for it. Usage:

Code: Select all

"meta":{"tags":{"airport taxi":{}}}
...Have a nice stay

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”

Who is online

Users browsing this forum: Between3Characters and 1 guest