## Car chains

Learn here how to create and use plugins.

Moderator: Plugin Moderators

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

### Car chains

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

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

### Re: [385]Car chains

If I ask you to lobby, can you sample the json file?
http://www.theotown.com/forum/search.ph ... =firstpost
"Our true mentor in life is science."
Mustafa Kemal Atatürk

THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4263
Joined: Thu Sep 14, 2017 17:30
Location: Astrellia, UHAE
Plugins: Show
Version: Beta

### Re: [385]Car chains

I will start to work on my tramway
Emperor of Atlantean federated empire

Founder state of Internationxal council
Leader of AEOY and steel pact

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

### Re: [385]Car chains

@Borbor I added the json code to get the chains as shown in the image
@former member It won't be a DLC
=^._.^= ∫

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

### Re: [385]Car chains

I know
=^._.^= ∫

KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2101
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Contact:

### Re: [385]Car chains

Will there be a tutorial for custom zones soon?

Imran M
Inhabitant of a Megalopolis
Reactions:
Posts: 711
Joined: Wed Oct 24, 2018 13:41
Plugins: Show

### Re: Car chains

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 have no clue what's happening this year

JustAnyone
Rip-off engineer
Reactions:
Posts: 3026
Joined: Sun Jul 23, 2017 12:45
Location: Easter Island
Plugins: Show

### Re: [385]Car chains

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

KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2101
Joined: Thu Jul 07, 2016 22:50
Location: 'Merica
Plugins: Show
Version: Beta
Contact:

### Re: Car chains

That comment was made a year ago..

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

### Re: [385]Car chains

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.
loud

abcde
Settler
Reactions:
Posts: 2
Joined: Fri Jul 03, 2020 3:12

### Re: Car chains

What should I do if I want to make a train? The car chain looks like a train, but how to make it run on the rail? Can I add a few lines of code to make it a train?
thanks

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

### Re: Car chains

Code: Select all

"flag normal": false,
"flag train": true
to your car chain would allow it to drive on rails. However, you need a building (e.g. a station) that spawns it because it won't be spawned automatically.
=^._.^= ∫

ChunFangXin
Settler
Reactions:
Posts: 2
Joined: Sat Jul 11, 2020 7:54

### Re: Car chains

I'm very sorry to disturb you again, because I have encountered a terrible plug-in problem. I make a lot of trains, but they always carry a car. Sometimes I make a garbage truck on top of the train, and sometimes the fire engine will be embedded in the locomotive. It's strange. But I firmly believe that this is my programming. There is a problem with the two parameters of X and y. Because when I adjust these two parameters, the situation will change, but it never disappears. There is always this strange problem. What is the problem? How to calculate the four parameters of X, y, W and h when making automobile chain? thank you. I'm very sorry, because my English is not good, this paragraph uses the translation software to translate, if there is something wrong, I'm very sorry.

star Lee
Villager
Reactions:
Posts: 18
Joined: Mon Jul 06, 2020 4:57

### Re: Car chains

Excuse me,what is this?
Attachments

PetrovMaksYt
Inhabitant of a Megacity
Reactions:
Posts: 195
Joined: Sun Aug 16, 2020 11:26

### Re: Car chains

star Lee wrote:
Fri Jul 24, 2020 13:18
Excuse me,what is this?

070f55a64b71aee3b6d8868020cd665.jpg
Texture of vagons very long too.
WELCOME! geif83kjf4v4o4mv4tnuinwonp4rbn2958h9.

PetrovMaksYt
Inhabitant of a Megacity
Reactions:
Posts: 195
Joined: Sun Aug 16, 2020 11:26

### Re: Car chains

or high
WELCOME! geif83kjf4v4o4mv4tnuinwonp4rbn2958h9.