Cars

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#51

Post by CommanderABab »

My plugins spawn cars just fine. Keep traffic set at 2x or less in the settings. Give the cars targets to go to and a fairly large radius so that they have a chance of finding targets.

User avatar
Bearbear76
Former Bearbear65
Reactions:
Posts: 5730
Joined: 10 Feb 2017, 14:53
Location: L2 cache
Plugins: Showcase Store

Plugin Creator

Platform

Re: Cars

#52

Post by Bearbear76 »

From beta 1.4.84 you can use:

Code: Select all

"v2":[0,0,0,0]
This allows you to shift/move cars by adjusting it's height.
By changing the value you can change the height of the specific frame.
The numbers indicate the frames in this order:
carsample.png
carsample.png (1007 Bytes) Viewed 13187 times
By writing the following you will adjust the 1st and 3rd frame by +1.

Code: Select all

"v2":[1,0,1,0]
Correct me if I'm wrong with any of this information! :json

User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#53

Post by CommanderABab »

That ability has been around for a few versions now.

It will work in the last public version also.

User avatar
NEPman
Small-town resident
Reactions:
Posts: 37
Joined: 24 Apr 2018, 13:15
Location: <..>
Plugins: Showcase Store
Version: Beta

Platform

Re: Cars

#54

Post by NEPman »

I have one question. I want to make ship spawner. How can I write it? As "car spawner" or "ship spawner"?

User avatar
yusuf8a684
Reactions:

Re: Cars

#55

Post by yusuf8a684 »

I need tractor textures, where can i find it?

User avatar
Bearbear76
Former Bearbear65
Reactions:
Posts: 5730
Joined: 10 Feb 2017, 14:53
Location: L2 cache
Plugins: Showcase Store

Plugin Creator

Platform

Re: Cars

#56

Post by Bearbear76 »

yusuf8a684 wrote:
16 Jul 2018, 13:07
I need tractor textures, where can i find it?
Couldn't find it in the world texture :bt
But here
Tractors.png
Tractors.png (4.06 KiB) Viewed 12955 times

User avatar
sairam
Inhabitant of a Conurbation
Reactions:
Posts: 537
Joined: 31 Dec 2017, 13:35
Location: India Pudukkottai
Plugins: Showcase Store
Version: Beta

Platform

Re: Cars

#57

Post by sairam »

I have a problem the car frame partly v1 and v2. How to use the graphics. Please help. I'll upload the frame of car. Here it is.
file_3.png
file_3.png (889 Bytes) Viewed 12826 times

User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#58

Post by CommanderABab »

Screenshot_20180812-101735.jpg

User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#59

Post by CommanderABab »

Or vice versa :)

User avatar
Imran M
Inhabitant of a Country
Reactions:
Posts: 844
Joined: 24 Oct 2018, 13:41
Plugins: Showcase Store

Plugin Creator

Platform

Re: Cars

#60

Post by Imran M »

@Lobby Hi, there's something wrong. When I try to use my truck, it says it can't find the I'd.
Attachments
space.zip
(7.93 KiB) Downloaded 270 times

User avatar
Lobby
Developer
Reactions:
Posts: 3705
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Cars

#61

Post by Lobby »

@Imran M That's because of the order in which your files are read in. Rename your "space cars" folder into "a_space cars" to ensure that it will be loaded first.

User avatar
Imran M
Inhabitant of a Country
Reactions:
Posts: 844
Joined: 24 Oct 2018, 13:41
Plugins: Showcase Store

Plugin Creator

Platform

Re: Cars

#62

Post by Imran M »

Thanks! I didn't know that!

User avatar
Imran M
Inhabitant of a Country
Reactions:
Posts: 844
Joined: 24 Oct 2018, 13:41
Plugins: Showcase Store

Plugin Creator

Platform

Re: Cars

#63

Post by Imran M »

Meh, close enough.
Attachments
Okerak_18-12-14_12.27.26.png

User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars, did you know? Designating level in car spawner.

#64

Post by CommanderABab »

Code: Select all

"car spawner":[
           {
             "cars":["$bigcarplugin63"],
             "count":1000,
             "radius":3000,
             "level":-1,
              "targets":[
                "$busdepot00",
                "$easteregg00",
                "$easteregg00",
                "$easteregg00",
                "$easteregg00",
                "$busstop00",
                "$busdepot00",
                "$railstation00",
                "$bigpark00" ,
                "$easteregg00"
            ] 
           },
           {
             "cars":["$bigcarplugin63"],
             "count":1000,
             "radius":3000,
             "level":0,
              "targets":[
                "$busdepot00",
                "$easteregg00",
                "$easteregg00",
                "$easteregg00",
                "$easteregg00",
                "$busstop00",
                "$busdepot00",
                "$railstation00",
                "$bigpark00" ,
                "$easteregg00"
            ] 
           },
           {
             "cars":["$bigcarplugin63"],
             "count":1000,
             "radius":3000,
             "level":1,
              "targets":[
                "$busdepot00",
                "$easteregg00",
                "$easteregg00",
                "$easteregg00",
                "$easteregg00",
                "$busstop00",
                "$busdepot00",
                "$railstation00",
                "$bigpark00" ,
                "$easteregg00"
            ] 
           },
           {
             "cars":["$bigcarplugin63"],
             "count":1000,
             "radius":3000,
             "level":2,
              "targets":[
                "$busdepot00",
                "$easteregg00",
                "$easteregg00",
                "$easteregg00",
                "$easteregg00",
                "$busstop00",
                "$busdepot00",
                "$railstation00",
                "$bigpark00" ,
                "$easteregg00"
            ] 
           },
           {
             "cars":["$bigcarplugin63"],
             "count":1000,
             "radius":3000,
             "level":3,
              "targets":[
                "$busdepot00",
                "$easteregg00",
                "$easteregg00",
                "$easteregg00",
                "$easteregg00",
                "$busstop00",
                "$busdepot00",
                "$railstation00",
                "$bigpark00" ,
                "$easteregg00"
            ] 
           },
           {
             "cars":["$bigcarplugin63"],
             "count":1000,
             "radius":3000,
             "level":4,
              "targets":[
                "$busdepot00",
                "$easteregg00",
                "$easteregg00",
                "$easteregg00",
                "$easteregg00",
                "$busstop00",
                "$busdepot00",
                "$railstation00",
                "$bigpark00" ,
                "$easteregg00"
            ] 
           },
           {
             "cars":["$bigcarplugin63"],
             "count":100,
             "radius":300,
             "level":1           
           }
         ],
That you can spawn cars from different levels?
So, if car spawner designates level 3 for a car(s), then that/those car(s) you would spawn directly to a level 3 bridge next to the building.

I think default ground level would be 0.

User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#65

Post by CommanderABab »

Your .json with commas expanded to commas and linefeed:

Code: Select all

{ "id":"milkcar.28eu9jd",
 "type":"car",
 "frames":[ {"bmp":"milkcar.png",
"w":15,
"h":10,
"count":4} ,
 {"bmp":"milkcar.png",
"w":15,
"h":10,
"count":4},
 {"bmp":"milkcar.png",
"w":15,
"h":10,
"count":4} ],
 "v2":true,
 "capacity":1,
 "flag normal":false,
 "flag user2":true },
 [ { "id":"milfarm929jd",
 "type":"industrial",
 "workers":190,
 "author":"Lancaster Kingdom",
 "width":1,
 "height":1,
 "frames":[{"bmp":"milkfarm.png"}],
 "smoke":[{"id":"$smoke07",
"x":13,
"y":-14}],
 "level":3,
 "car spawner":[ { "cars":["milkcar.28eu9jd"],
 "radius":100,
 "count":70 } ] } ]
Should be:

Code: Select all

[{ "id":"milkcar.28eu9jd",
 "type":"car",
 "frames":[ {"bmp":"milkcar.png",
"w":15,
"h":10,
"count":4}  ],
 "v2":true,
 "capacity":1,
 "flag normal":false,
 "flag user2":true },
 { "id":"milfarm929jd",
 "type":"industrial",
 "workers":190,
 "author":"Lancaster Kingdom",
 "width":1,
 "height":1,
 "frames":[{"bmp":"milkfarm.png"}],
 "smoke":[{"id":"$smoke07",
"x":13,
"y":-14}],
 "level":3,
 "car spawner":[ { "cars":["milkcar.28eu9jd"],
 "radius":100,
 "count":70 } ] } ]
I redacted multiple uses of the same .png in the frames statements for the car, but that wasn't causing your problem. The json being an array [] of objects {}, didn't start with the initial [, which was later in the file. I moved it to the beginning.

User avatar
CERRERA
Townsman
Reactions:
Posts: 48
Joined: 25 Jan 2020, 06:19
Location: Philippines
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Cars

#66

Post by CERRERA »

How about elevated train

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2220
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Cars

#67

Post by KINGTUT10101 »

Lobby wrote:
26 Jan 2018, 01:51
2. You have to add this into your bus definition:

Code: Select all

"template":"$template_bus00"
The bus will then be added to the variants of busses.
Is there a template for emergency vehicles, like SWAT vans, to be specific?

User avatar
Lobby
Developer
Reactions:
Posts: 3705
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Cars

#68

Post by Lobby »

No, there's not. You'd have to write the template yourself if you need one. See content_car.json in the json resource topic for the needed attributes.

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2220
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

Re: Cars

#69

Post by KINGTUT10101 »

I took a look at the SWAT van's definition, and I didn't find anything out of the ordinary that seemed to give it the functionality I wanted. Are the emergency vehicles hard-coded?

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Cars

#70

Post by JustAnyone »

Yes

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”