Car chains

Learn here how to create and use plugins.

Moderator: Plugin Moderators

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

Car chains

Post by Lobby » Thu Dec 07, 2017 19:35

See this thread on how to add custom cars to the game. Since version 385 you can define a chain of cars that behaves as one vehicle. See here an example:
2017-12-07 02.50.37.png
The garbage trucks were appended to the fire brigade truck to form long, connected vehicles. A better use would be for example a tram or a bending bus. There's basically no limit in the length of the chain.

To append cars to a car just use

Code: Select all

"tail":["anotherCarId",...]  // A list of cars to append
To append the car itself just use null as convenient placeholder. So a chain of a car of length 3 would have a tail of length 2:

Code: Select all

"tail":[null,null]
The car ids used in a tail array have to be already defined. Only the first variant (4 frames make up a variant) will be used for each car in a tail. You may use the empty/invisible car $car_null00 as placeholder between cars in a chain if sufficient.

The code to achieve the fire-garbage-trains as shown above :json

Code: Select all

[
  {
    "override":true,
    "id":"$carfirebrigade00",
    "type":"car",
    "frames":[{"x":512,"y":657,"w":32,"h":18,"count":4}],
    "tail":["$garbagetruck00","$garbagetruck00","$garbagetruck00","$garbagetruck00"]
  }
]
No extra graphics needed.
Last edited by Anonymous on Thu Dec 07, 2017 19:40, edited 1 time in total.
...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: [385]Car chains

Post by Borbor » Thu Dec 07, 2017 20:15

If I ask you to lobby, can you sample the json file?
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
THEMAX
Inhabitant of a Supercluster
Reactions:
Posts: 3616
Joined: Thu Sep 14, 2017 17:30
Location: Astrellia, UHAE
Plugins: Show
Version: Beta

Re: [385]Car chains

Post by THEMAX » Thu Dec 07, 2017 20:26

I will start to work on my tramway
Emperor of Atlantean federated empire
Image
Founder state of Internationxal council
Leader of AEOY and steel pact

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

Re: [385]Car chains

Post by Lobby » Thu Dec 07, 2017 21:08

@Borbor I added the json code to get the chains as shown in the image
@former member It won't be a DLC
...Have a nice stay

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

Re: [385]Car chains

Post by Lobby » Thu Dec 07, 2017 21:29

I know :)
...Have a nice stay

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 1835
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Phone model: Moto Z Force Droid

Re: [385]Car chains

Post by KINGTUT10101 » Sat Dec 09, 2017 17:25

Will there be a tutorial for custom zones soon?

Imran M
Metropolitan
Reactions:
Posts: 121
Joined: Wed Oct 24, 2018 13:41
Plugins: Show
Phone model: Huawei p8 lite

Re: Car chains

Post by Imran M » Sun Dec 09, 2018 18:55

For people who use json Genie: "tail" is an array, and the ids are values. They don't have a title just a value
I HATE doing roofs, and I can't find any good window colours. :bb
I can also help, most of the time. As long as it's fun, or something easy, like making Json files.

User avatar
JustAnyone
Junior Developer
Reactions:
Posts: 2433
Joined: Sun Jul 23, 2017 12:45
Location: Pickle command administration
Plugins: Show
Version: Beta
Phone model: Picklephone S5

Re: [385]Car chains

Post by JustAnyone » Sun Dec 09, 2018 20:10

KINGTUT10101 wrote:
Sat Dec 09, 2017 17:25
Will there be a tutorial for custom zones soon?
There is one.

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 1835
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Phone model: Moto Z Force Droid

Re: Car chains

Post by KINGTUT10101 » Mon Dec 10, 2018 0:16

That comment was made a year ago..

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

Re: [385]Car chains

Post by CommanderABab » Mon Dec 10, 2018 0:55

JustAnyone wrote:
Sun Dec 09, 2018 20:10
KINGTUT10101 wrote:
Sat Dec 09, 2017 17:25
Will there be a tutorial for custom zones soon?
There is one.
Show
loud
JustAnyone wrote:
Sun Dec 09, 2018 20:10
587587Currently using beta 587. 587 What's new? :)
bus routes are supposed to be fixed!!
:cry:

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

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”

Who is online

Users browsing this forum: No registered users and 1 guest