Code Help
Moderator: Plugin Moderators
-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
Re: Code Help
Is it the height and width of go kart maybe?
- CommanderABab
- AB
- Reactions:
- Posts: 9128
- Joined: Tue Jun 07, 2016 21:12
- Plugins: Show
- Version: Beta
Re: Code Help
You dont need quotes around 512 and 1 there. Ok, so you have 1 tiny car within a radius of 512. Might take a while to see it.

-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
Re: Code Help
But is there a way to make it automatically spawn and roam around (only on the track) like emergency vehicleS?
- CommanderABab
- AB
- Reactions:
- Posts: 9128
- Joined: Tue Jun 07, 2016 21:12
- Plugins: Show
- Version: Beta
Re: Code Help
Yes there is!
Please search the documentation. Keywords flags, x flags, own cars, spawn.



Re: Code Help
Your rally cars cannot drive on your rally track because you didn't set flags for them. You might add to the car, too.
For bigger cities it might help to add as described here to your building so a valid target building is always found.
Code: Select all
"flag user5": true,
"flag normal": false,
For bigger cities it might help to add
Code: Select all
"car local only":true
=^._.^= ∫
- CommanderABab
- AB
- Reactions:
- Posts: 9128
- Joined: Tue Jun 07, 2016 21:12
- Plugins: Show
- Version: Beta
Re: Code Help
I have a question Lobby. May a building spawn more than one type of car?
Jsonlint says there are duplicate tags when I try, but Theotown doesn't complain. Should I place them in the code like "car": [ 1, 2, 3]?
Jsonlint says there are duplicate tags when I try, but Theotown doesn't complain. Should I place them in the code like "car": [ 1, 2, 3]?

- CommanderABab
- AB
- Reactions:
- Posts: 9128
- Joined: Tue Jun 07, 2016 21:12
- Plugins: Show
- Version: Beta
Re: Code Help
If you define a flag multiple times only one will be used... when I added the feature I had not in mind that you would like to do such things 

=^._.^= ∫
- CommanderABab
- AB
- Reactions:
- Posts: 9128
- Joined: Tue Jun 07, 2016 21:12
- Plugins: Show
- Version: Beta
Re: Code Help
Let's see. I think an array of four would be sufficient. One type of road on each side of a building = 4. 


-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
Re: Code Help
Lobby is there any code I can copy from the emergency vehicles, the code which makes them instantly spawn and free roam, its exactly what I need
Re: Code Help
As former member said, it's not the same thing for operational cars. However, the behavior should be exactly the same when you use the "car"-flags as you try to do. Operational cars also "search" for buildings they drive to randomly then.
=^._.^= ∫
-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
Re: Code Help
But the track isnt or supposed to be connected to other buildings, it just the garage and the track :/