res/ind car identification

Find tutorials, documentation, and resources for creating and using TheoTown plugins.
Previous topicNext topic
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

res/ind car identification

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
User avatar
Borbor
Inhabitant of a Conurbation
Reactions:
Posts: 360
Joined: 27 Apr 2017, 12:03
Location: Republic of Turkey
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: ⚠ Important change in res/ind car identification

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
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: ⚠ Important change in res/ind car identification

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: 174
Joined: 26 Dec 2017, 12:41
Location: The Netherlands
Plugins: Showcase Store

Plugin Creator

Platform

Re: ⚠ Important change in res/ind car identification

Post by A dutch Guy »

This is indeed very useful for me
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: Change in res/ind car identification

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: 174
Joined: 26 Dec 2017, 12:41
Location: The Netherlands
Plugins: Showcase Store

Plugin Creator

Platform

Re: Change in res/ind car identification

Post by A dutch Guy »

Lobby wrote: 17 Apr 2018, 08: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
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: Change in res/ind car identification

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.
E
ElephantEthan
Inhabitant of a Megacity
Reactions:
Posts: 294
Joined: 26 Aug 2018, 12:07
Plugins: Showcase Store

Platform

Re: Change in res/ind car identification

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: 11269
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Change in res/ind car identification

Post by CommanderABab »

Probably:

Code: Select all

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

#tail let's see.

Car Chains
my avatar:
E
ElephantEthan
Inhabitant of a Megacity
Reactions:
Posts: 294
Joined: 26 Aug 2018, 12:07
Plugins: Showcase Store

Platform

Re: Change in res/ind car identification

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: 174
Joined: 26 Dec 2017, 12:41
Location: The Netherlands
Plugins: Showcase Store

Plugin Creator

Platform

Re: Change in res/ind car identification

Post by A dutch Guy »

@Lobby

Is there also a tag for the airport cars?
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: Change in res/ind car identification

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: 131
Joined: 28 Mar 2019, 07:34
Location: Philippines
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: res/ind car identification

Post by Lakan Haraya »

Is there a tag for bus?

Code: Select all

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

“TheoTown Philippines Council”
“Kapulungan Ng Mga Nagkakaisang Lungsod”
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3759
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: res/ind car identification

Post by Lobby »

The tag is:

Code: Select all

"meta":{"tags":{"idle bus":{}}}
User avatar
Uncle Koala
Metropolitan
Reactions:
Posts: 142
Joined: 05 Apr 2020, 12:53
Location: Pitcairn Islands
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: res/ind car identification

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
User avatar
Yakka Works
Inhabitant of a Conurbation
Reactions:
Posts: 412
Joined: 06 Jan 2020, 07:57
Location: Java-indonesia
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: res/ind car identification

Post by Yakka Works »

How to make custom one
My plugins,up to date and it's free on my website. So check it out.
My website
Community/Creators Discord Server List
User avatar
CERRERA
Townsman
Reactions:
Posts: 48
Joined: 25 Jan 2020, 04:19
Location: Philippines
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: res/ind car identification

Post by CERRERA »

Lobby wrote: 25 Feb 2018, 12: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
May I see all the tag list
Everything you can imagine is real
User avatar
Vinzzxprikitiwww
Villager
Reactions:
Posts: 9
Joined: 04 Sep 2025, 06:24
Plugins: Showcase Store
Version: Beta

Platform

Re: res/ind car identification

Post by Vinzzxprikitiwww »

Is there a garbage truck?
User avatar
JustAnyone
Honorary Contributor
Reactions:
Posts: 3666
Joined: 23 Jul 2017, 10:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: res/ind car identification

Post by JustAnyone »

Code: Select all

{
  "meta": {
    "tags": {
      "garbage": {}
    }
  }
}
G
Guest
Reactions:

Re: res/ind car identification

Post by Guest »

Is there a full example of it. I set a custom tank to my plugin and add a tag for it.

Code: Select all    Reset

[ { "id": "$43464667667_tank", "type": "car", "frames": [ { "bmp": "tank.png", "w": 184, "h": 112, "count": 4 } ], "v2": true, "auto colorize": true, "flag normal": false, "flag pkw": true, "meta": { "tags": { "swat": {} } } } ]
JSON checker
Check
Previous topicNext topic