Cars

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
TheFennekin
Neighborhood fox
Reactions:
Posts: 2728
Joined: 24 Aug 2017, 11:17
Location: Wandering around
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#121

Post by TheFennekin »

Q: How do you put night anims on cars? Is it just like how you do it for buildings or no? Also, if I have for example multiple variants of a single car on one image and id, how do I put night anims on them?
User avatar
TheFennekin
Neighborhood fox
Reactions:
Posts: 2728
Joined: 24 Aug 2017, 11:17
Location: Wandering around
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#122

Post by TheFennekin »

Q: Is it possible to override in-game buses?
User avatar
Yakka
Inhabitant of a Conurbation
Reactions:
Posts: 413
Joined: 06 Jan 2020, 09:57
Location: Java-indonesia
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#123

Post by Yakka »

TheFennekin wrote: 02 Mar 2022, 03:32 Q: Is it possible to override in-game buses?
Yes if you know the id of it,im remembering it just something like $bus00 $bus01 and so on.
User avatar
TheFennekin
Neighborhood fox
Reactions:
Posts: 2728
Joined: 24 Aug 2017, 11:17
Location: Wandering around
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#124

Post by TheFennekin »

I'll try. Hopefully the new bus system won't be a hassle
User avatar
TheFennekin
Neighborhood fox
Reactions:
Posts: 2728
Joined: 24 Aug 2017, 11:17
Location: Wandering around
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#125

Post by TheFennekin »


Anyway, I offset the truck by using the "v2" (I don't remember what its actually for) and it worked but I concern this is not the correct way.

Code: Select all    Reset

"frames":[{"bmp":"JBPM_Scania.png","count":4,"h":22,"w":23}], "id":"$carfirebrigade00", "meta":{"tags":{"medic":{},"swat"{}}}, "speed":1.1, "type":"car", "v2":[-2,-2,-2,-2], "override":true
JSON checker
Check

What does the "v2":[insert value] do? How do I use them?
User avatar
Yakka
Inhabitant of a Conurbation
Reactions:
Posts: 413
Joined: 06 Jan 2020, 09:57
Location: Java-indonesia
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#126

Post by Yakka »

:lua:
TheFennekin wrote: 29 Mar 2022, 06:11

Anyway, I offset the truck by using the "v2" (I don't remember what its actually for) and it worked but I concern this is not the correct way.

Code: Select all    Reset

"frames":[{"bmp":"JBPM_Scania.png","count":4,"h":22,"w":23}], "id":"$carfirebrigade00", "meta":{"tags":{"medic":{},"swat"{}}}, "speed":1.1, "type":"car", "v2":[-2,-2,-2,-2], "override":true
JSON checker
Check

What does the "v2":[insert value] do? How do I use them?
Something like hadle y for frames.
User avatar
TheFennekin
Neighborhood fox
Reactions:
Posts: 2728
Joined: 24 Aug 2017, 11:17
Location: Wandering around
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#127

Post by TheFennekin »

Figured it out
User avatar
TheFennekin
Neighborhood fox
Reactions:
Posts: 2728
Joined: 24 Aug 2017, 11:17
Location: Wandering around
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#128

Post by TheFennekin »

Screenshot_20220330_182849_info.flowersoft.theotown.theotown.jpg
Failed lol

Code: Select all    Reset

[ { "id":"toyotaae86.trueno", "type":"car", "frames":[ {"bmp":"normal.png","count":4,"w":11,"h":8}], "v2":[0,0,0,0,0,0,0,0], "speed":1.3, "frames per variant" :8 }, { "id":"toyotaae86.trueno.drift", "type":"car", "frames per variant" :8, "frames":[ {"bmp":"drift.png","count":4,"w":11,"h":8}], "v2":[0,0,0,0,0,0,0,0], "speed":1 } ]
JSON checker
Check
Don't mind the offset vaules, it's just a test
User avatar
TheFennekin
Neighborhood fox
Reactions:
Posts: 2728
Joined: 24 Aug 2017, 11:17
Location: Wandering around
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#129

Post by TheFennekin »

I also made a drift mode (frames are intended to be offset) but I got this instead (for both cars)
User avatar
Ryk_Mak_2050
Settler
Reactions:
Posts: 4
Joined: 25 Dec 2021, 18:57

Re: Cars

#130

Post by Ryk_Mak_2050 »

Can I have the code on Police Cars that works when I press the emergency button? I wanna have 7 Police Cars in my 3x3 Dense Big Police Station plugin that I currently working on.
Last edited by Ryk_Mak_2050 on 22 May 2022, 14:40, edited 3 times in total.
User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4314
Joined: 14 Sep 2017, 17:30
Location: Astrellia, UHAE
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#131

Post by THEMAX »

I have been working on a car plugin this week-end, and I'd like to know if there is a way to create a group of cars (different models & different colours) for one category (TTT residential, T industrial, police and so on) to override vanilla cars with new ones. Is that something feasible
User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#132

Post by CommanderABab »

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

Plugin Creator

Platform

Re: Cars

#133

Post by CommanderABab »

  1. You can see how to override cars at the start of this thread, but to add cars to certain types of buildings, use this instead.
    Screenshot_20220606-185227_Chrome.jpg
  2. :)
User avatar
Ryk_Mak_2050
Settler
Reactions:
Posts: 4
Joined: 25 Dec 2021, 18:57

Re: Cars

#134

Post by Ryk_Mak_2050 »

I have a code problem that is not working when adding some codes. And causes this. Please help.
Screenshot_20220615-155130_TheoTown.jpg
Here's my code:

[
{
"id": "$dense.pol.station.150",
"type": "police",
"author": "Plugin creator website 3.0 & Ryk_Mak_2050",
"width": 3,
"height": 3,
"frames": [
{
"bmp": "Dense Police Station.png"
}
],
"title": "Dense Police Station",
"text": "To accommodate your densely populated city. It has 7 Police Cars to patrol and respond to crime quickly.",
"price": 70000,
"influence police": 120,
"performance": true,
"car spawner": [{
"id": "$carpolice00",
"type": "car",
"frames": [{
"x": 896,
"y": 618,
"w": 32,
"h": 20,
"count": 4
}],
"frames per variant": 4,
"flag military": true,
"flag airport": true,
"flag emergency": true,
"chargeable": false,
"meta":{"tags":{"$carpolice00":{}}}
],
"monthly price": 150,
"build time": 47,
"power": -15,
"water": -15
}
]
User avatar
Ryk_Mak_2050
Settler
Reactions:
Posts: 4
Joined: 25 Dec 2021, 18:57

Re: Cars

#135

Post by Ryk_Mak_2050 »

CommanderABab wrote: 07 Jun 2022, 03:49
  1. You can see how to override cars at the start of this thread, but to add cars to certain types of buildings, use this instead.

    Screenshot_20220606-185227_Chrome.jpg
  2. :)
I've got the easy code to increase Police count in my Dense Police Station plugin. which is:

"service cars": <# of cars

Or in my case:

"service cars": 7

P.S. this reply was veerrry late hehe
User avatar
Londoncuz II
Settler
Reactions:
Posts: 3
Joined: 11 Aug 2022, 14:17

Re: Cars

#136

Post by Londoncuz II »

Hello? Yes, I'm trying to override existing vanilla police/fire/ambulance cars by using this in my code
"Id":"$carswat00"
And adding
"override":"true,
With my code but It wont work. Has the code been changed or am I doing it wrong?
Full code
[
{
"id":"$carswat00",
"v2":true,
"type":"bus",
"override":true,
"frames":[{bmp":"swatvan.png","w":15,"h":"14",count":4}]
}
]
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

#137

Post by Bearbear76 »

Londoncuz II wrote: 02 Nov 2022, 02:17 Hello? Yes, I'm trying to override existing vanilla police/fire/ambulance cars by using this in my code
"Id":"$carswat00"
And adding
"override":"true,
With my code but It wont work. Has the code been changed or am I doing it wrong?
Full code
[
{
"id":"$carswat00",
"v2":true,
"type":"bus",
"override":true,
"frames":[{bmp":"swatvan.png","w":15,"h":"14",count":4}]
}
]
I'm going to assume this is just a typo in the post. Do you get any errors? What do you mean when you say it doesn't work? :)

Code: Select all    Reset

[ { "id":"$carswat00", "v2":true, "type":"bus", "override":true, "frames":[{bmp":"swatvan.png","w":15,"h":"14",count":4}] } ]
JSON checker
Check
User avatar
Londoncuz II
Settler
Reactions:
Posts: 3
Joined: 11 Aug 2022, 14:17

Re: Cars

#138

Post by Londoncuz II »

Sorry should of explained better, the error I have when loading the json code is - "when loading "$carswat00", no value for X"
I double checked the code for the car and it should work as its identical to my other cars I have working in game without issue, that's why I came to the conclusion that theres and issue with the ID, unless I'm wrong.
User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

#139

Post by CommanderABab »

You have no quote in front of bmp.
User avatar
burgernamn
Former aster dude
Reactions:
Posts: 172
Joined: 15 Apr 2022, 10:32
Plugins: Showcase Store

Plugin Creator

Platform

Re: Cars

#140

Post by burgernamn »

is "v2" optional or is it required
Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”