res/ind car identification

Learn here how to create and use plugins.

Moderator: Plugin Moderators

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

Platform

res/ind car identification

#1

Post by Lobby »

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

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

Platform

Plugin Creator

Re: ⚠ Important change in res/ind car identification

#2

Post by Borbor »

@lobby[Posts][PM] only extensions that use the override feature will not work?
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: 3590
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta

Platform

Re: ⚠ Important change in res/ind car identification

#3

Post by Lobby »

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

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

Platform

Plugin Creator

Re: ⚠ Important change in res/ind car identification

#4

Post by A dutch Guy »

This is indeed very useful for me

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

Platform

Re: Change in res/ind car identification

#5

Post by Lobby »

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

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

Platform

Plugin Creator

Re: Change in res/ind car identification

#6

Post by A dutch Guy »

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: 3590
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta

Platform

Re: Change in res/ind car identification

#7

Post by Lobby »

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

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

Platform

Re: Change in res/ind car identification

#8

Post by ElephantEthan »

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

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

Platform

Plugin Creator

Re: Change in res/ind car identification

#9

Post by CommanderABab »

Probably:

Code: Select all

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

#tail let's see.

Car Chains
Image

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

Platform

Re: Change in res/ind car identification

#10

Post by ElephantEthan »

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: 162
Joined: Tue Dec 26, 2017 14:41
Location: Enschede, The Netherlands
Plugins: Show

Platform

Plugin Creator

Re: Change in res/ind car identification

#11

Post by A dutch Guy »

@Lobby

Is there also a tag for the airport cars?

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

Platform

Re: Change in res/ind car identification

#12

Post by Lobby »

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

Code: Select all

"meta":{"tags":{"airport taxi":{}}}
=^._.^= ∫

User avatar
Lakan Haraya
Metropolitan
Reactions:
Posts: 116
Joined: Thu Mar 28, 2019 9:34
Location: Rizal, Philippines
Plugins: Show
Version: Beta

Plugin Creator

Platform

Re: res/ind car identification

#13

Post by Lakan Haraya »

Is there a tag for bus?

Code: Select all

"meta":{"tags":{"bus":{}}}
Last edited by Lakan Haraya on Mon Jan 27, 2020 11:25, edited 1 time in total.
"ᜀᜃᜓ ᜀᜅ᜔ ᜁᜌᜓᜅ᜔ ᜑᜇᜌ"
CEO of Haráya Motors

“TheoTown Philippines Council”
“Kapulungan Ng Mga Nagkakaisang Lungsod”

Pinoy? Sali na :jb:
https://discord.gg/9n7PFy

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

Platform

Re: res/ind car identification

#14

Post by Lobby »

The tag is:

Code: Select all

"meta":{"tags":{"idle bus":{}}}
=^._.^= ∫

User avatar
Uncle Koala
Metropolitan
Reactions:
Posts: 135
Joined: Sun Apr 05, 2020 14:53
Location: Pitcairn Islands
Plugins: Show
Version: Beta
Contact:

Platform

Plugin Creator

Re: res/ind car identification

#15

Post by Uncle Koala »

I understand this was made to prevent incompatiblity, but is there any way to override those IDs anyway? I wanted to edit semi-trucks because they are not realistic in their current state and they usually block traffic with their weird trailer chains (this is why shops in real life use smaller trucks too.). The traffic system works way better with the older trucks. I guess the semis could be used for long distance transport to the end of the map? (neighbour connections) :bq
Lua is easy! :lua:

Code: Select all

if Car.GoingToCrashIntoEachOther()
   then Car.DontCrash
end

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”