Code Help

Plug-in related stuff can be discussed here.

Moderator: Plugin Moderators

Barky
TheoTown Cartographer
Reactions:
Posts: 2074
Joined: Mon Apr 17, 2017 22:13
Location: Ireland
Plugins: Show

Platform

Re: Code Help

#41

Post by Barky »

Is it the height and width of go kart maybe?

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

Platform

Plugin Creator

Re: Code Help

#42

Post by CommanderABab »

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

Barky
TheoTown Cartographer
Reactions:
Posts: 2074
Joined: Mon Apr 17, 2017 22:13
Location: Ireland
Plugins: Show

Platform

Re: Code Help

#43

Post by Barky »

But is there a way to make it automatically spawn and roam around (only on the track) like emergency vehicleS?

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

Platform

Plugin Creator

Re: Code Help

#44

Post by CommanderABab »

Barky wrote:
Sun Jul 02, 2017 21:48
But is there a way to make it automatically spawn and roam around (only on the track) like emergency vehicleS?
Yes there is!

Please search the documentation. Keywords flags, x flags, own cars, spawn. :space
:fire
Image

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

Platform

Re: Code Help

#45

Post by Lobby »

Your rally cars cannot drive on your rally track because you didn't set flags for them. You might add

Code: Select all

"flag user5": true,
"flag normal": false,
to the car, too.

For bigger cities it might help to add

Code: Select all

"car local only":true
as described here to your building so a valid target building is always found.
=^._.^= ∫

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

Platform

Plugin Creator

Re: Code Help

#46

Post by CommanderABab »

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]?
Image

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

Platform

Plugin Creator

Re: Code Help

#47

Post by CommanderABab »

Ah, I see. They need different flags.
Image

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

Platform

Re: Code Help

#48

Post by Lobby »

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

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

Platform

Plugin Creator

Re: Code Help

#49

Post by CommanderABab »

Let's see. I think an array of four would be sufficient. One type of road on each side of a building = 4. ;)
Image

Barky
TheoTown Cartographer
Reactions:
Posts: 2074
Joined: Mon Apr 17, 2017 22:13
Location: Ireland
Plugins: Show

Platform

Re: Code Help

#50

Post by Barky »

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

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

Platform

Re: Code Help

#51

Post by Lobby »

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

Barky
TheoTown Cartographer
Reactions:
Posts: 2074
Joined: Mon Apr 17, 2017 22:13
Location: Ireland
Plugins: Show

Platform

Re: Code Help

#52

Post by Barky »

But the track isnt or supposed to be connected to other buildings, it just the garage and the track :/

Post Reply Previous topicNext topic

Return to “Plug-In Discussion”