Page 1 of 1

Car chains

Posted: Thu Dec 07, 2017 19:35
by Lobby
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.

Re: [385]Car chains

Posted: Thu Dec 07, 2017 20:15
by Borbor
If I ask you to lobby, can you sample the json file?

Re: [385]Car chains

Posted: Thu Dec 07, 2017 20:26
by THEMAX
I will start to work on my tramway

Re: [385]Car chains

Posted: Thu Dec 07, 2017 21:08
by Lobby
@Borbor I added the json code to get the chains as shown in the image
@former member It won't be a DLC

Re: [385]Car chains

Posted: Thu Dec 07, 2017 21:29
by Lobby
I know :)

Re: [385]Car chains

Posted: Sat Dec 09, 2017 17:25
by KINGTUT10101
Will there be a tutorial for custom zones soon?

Re: Car chains

Posted: Sun Dec 09, 2018 18:55
by Imran M
For people who use json Genie: "tail" is an array, and the ids are values. They don't have a title just a value

Re: [385]Car chains

Posted: Sun Dec 09, 2018 20:10
by JustAnyone
KINGTUT10101 wrote:
Sat Dec 09, 2017 17:25
Will there be a tutorial for custom zones soon?
There is one.

Re: Car chains

Posted: Mon Dec 10, 2018 0:16
by KINGTUT10101
That comment was made a year ago..

Re: [385]Car chains

Posted: Mon Dec 10, 2018 0:55
by CommanderABab
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