Cars

Find tutorials, documentation, and resources for creating and using TheoTown plugins.
Previous topicNext topic
User avatar
Zman The Man
Inhabitant of a Conurbation
Reactions:
Posts: 458
Joined: 01 Oct 2020, 02:19
Location: New Zealand, New Plymouth
Plugins: Showcase Store
Version: Beta

Re: Cars

Post by Zman The Man »

That car is playing GTA IV but the pedestrians are wiser NOT to walk
User avatar
CommanderABab
AB
Reactions:
Posts: 11269
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by CommanderABab »

More disturbing is that you are overriding the default fire truck which fights fires and giving it only the ability to act as an ambulance.

byframes101.png
bigrescars.png
You do not have the required permissions to view the files attached to this post.
my avatar:
User avatar
TheFennekin
Inhabitant of a Galaxy Cluster
Reactions:
Posts: 2715
Joined: 24 Aug 2017, 09:17
Location: honsing around
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by TheFennekin »

I also got this issue in my drifitng AE86 and other self made cars I did but just move each car frame up and down and try to see if it fits the road nicely. Basically just trial and error.
Image
User avatar
Zoll
Settler
Reactions:
Posts: 6
Joined: 29 Oct 2020, 04:12

Re: Cars

Post by Zoll »

Zman The Man wrote: 08 Nov 2020, 06:48 That car is playing GTA IV but the pedestrians are wiser NOT to walk
Ye, actually.. the truck went for its safety.
Tero_20-11-05_12.11.14.png


CommanderABab wrote: 08 Nov 2020, 13:01 More disturbing is that you are overriding the default fire truck which fights fires and giving it only the ability to act as an ambulance.
What is the fifth frame of green car represent?
I spaced it 2 pixel on purpose, is it bad?

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
VehiclesTest_20-11-15_07.22.40.png
you see no potato
You do not have the required permissions to view the files attached to this post.
User avatar
CommanderABab
AB
Reactions:
Posts: 11269
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by CommanderABab »

Lol, I see a potato.

The fifth frame is only an error check. :)
my avatar:
User avatar
Lakan Haraya
Metropolitan
Reactions:
Posts: 131
Joined: 28 Mar 2019, 07:34
Location: Philippines
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by Lakan Haraya »

Diagonal oriented Cars is here... v1966
"ᜀᜃᜓ ᜀᜅ᜔ ᜁᜌᜓᜅ᜔ ᜑᜇᜌ"
CEO of Haráya Motors

“TheoTown Philippines Council”
“Kapulungan Ng Mga Nagkakaisang Lungsod”
User avatar
TheFennekin
Inhabitant of a Galaxy Cluster
Reactions:
Posts: 2715
Joined: 24 Aug 2017, 09:17
Location: honsing around
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by TheFennekin »

Lakan Haraya wrote: 10 Jan 2021, 04:29 Diagonal oriented Cars is here... v1966
Wait... what?
Image
User avatar
Yakka Works
Inhabitant of a Conurbation
Reactions:
Posts: 412
Joined: 06 Jan 2020, 07:57
Location: Java-indonesia
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by Yakka Works »

Where is Diagonal car tutorial?
My plugins,up to date and it's free on my website. So check it out.
My website
Community/Creators Discord Server List
User avatar
JustAnyone
Honorary Contributor
Reactions:
Posts: 3666
Joined: 23 Jul 2017, 10:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Cars

Post by JustAnyone »

Diagonal cars just use 8 instead of 4 frames.
4 for diagonal axis and 4 normally.

All you just need to do is specify "frames per variant": 8 attribute for the car drafts.

The following example is how diagonal firetrucks are implemented

Code: Select all    Reset

[{ "id":"$carfirebrigade00", "type":"car", "frames":[ {"x":512,"y":657,"w":32,"h":18,"count":4},{"x": 128,"y": 365,"w": 32,"h": 19,"count": 4,"offset y": 3072} // This array has 8 frames ], "frames per variant": 8, // We let the game know that we use 8 frames per variant, otherwise it would treat 8 frames as 2 separate variants "animation":[ { "id":"$animationcaralertlights00", "pos":[16,-10, 10,-4, -4,-9, 4,-13], "important":true }, { "id":"$animationcaralertlights00", "pos":[18,-9, 12,-5, -2,-8, 6,-14], "important":true }, { "id": "carlight_red", "pos": [11, 4, 0, 0, 0, 0, 25, 1], "frames": [0, 3] }, { "id": "carlight_red", "pos": [13, 5, 0, 0, 0, 0, 27, 0], "frames": [0, 3] }, { "id": "carlight_yellow", "pos": [0, 0, 19, 5, 3, 0, 0, 0], "frames": [1, 2] }, { "id": "carlight_yellow", "pos": [0, 0, 21, 4, 5, 1, 0, 0], "frames": [1, 2] } ], "flag military":true, "flag airport":true, "flag emergency": true, "chargeable": false, "meta":{"tags":{"fire brigade":{}}} }]
JSON checker
Check
In regard to the order of frames it works the same like before for the first 4 frames (which will have different order when v2 is set to true). The next four, diagonal frames are always ordered like this:
image.png
You do not have the required permissions to view the files attached to this post.
User avatar
Yakka Works
Inhabitant of a Conurbation
Reactions:
Posts: 412
Joined: 06 Jan 2020, 07:57
Location: Java-indonesia
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by Yakka Works »

Dominykas wrote: 13 Jul 2021, 14:47 Diagonal cars just use 8 instead of 4 frames.
4 for diagonal axis and 4 normally.

All you just need to do is specify "frames per variant": 8 attribute for the car drafts.

The following example is how diagonal firetrucks are implemented
Should the frame is same size as non diagonal cars one?
I mean something like this:
BB301 GL DIA.png
BB301 GL.png
Show
note
The image is sample from Indonesia renewal pack,which also my testing plugin before applying to real Indonesia renewal pack plug-in, please credit me if you want to reuse the image
You do not have the required permissions to view the files attached to this post.
My plugins,up to date and it's free on my website. So check it out.
My website
Community/Creators Discord Server List
y
yusuf8a684
Reactions:

Re: Cars

Post by yusuf8a684 »

I think diagonal should be longer
User avatar
Yakka Works
Inhabitant of a Conurbation
Reactions:
Posts: 412
Joined: 06 Jan 2020, 07:57
Location: Java-indonesia
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by Yakka Works »

Can anyone provide an example for very long vehicle,like more than 22pixel in width,in this case i need a example for 1 tile long
My plugins,up to date and it's free on my website. So check it out.
My website
Community/Creators Discord Server List
User avatar
Patchouli Knowledge
Townsman
Reactions:
Posts: 64
Joined: 26 Sep 2020, 07:42

Re: Cars

Post by Patchouli Knowledge »

If count of car’s frame is 8,how to How do I draw a picture in this case?
User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4313
Joined: 14 Sep 2017, 15:30
Location: Astrellia, UHAE
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by THEMAX »

If I want to add night animations to the diagonal variants of my trains, can I still use a v2 night animation frame like I did it before except it would be for 8 different frames or does it only work with 2 or 4 rotations ?

@JustAnyone @Lobby
Emperor of Atlantean federated empire
Image
Founder state of Internationxal council
Leader of AEOY and steel pact
User avatar
Wepf
Inhabitant of a Megacity
Reactions:
Posts: 257
Joined: 14 Oct 2021, 08:19
Location: Your lucid dream
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by Wepf »

WTH(What the heck) is

Code: Select all

"v2":true
I play music and create theotown plugin (rarely)


Btw I'm from 🇹🇭 and I'm 13
User avatar
Kulche
Inhabitant of a Continent
Reactions:
Posts: 1194
Joined: 07 Jun 2017, 18:28
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by Kulche »

Wepf wrote: 18 Nov 2021, 09:35 WTH(What the heck) is

Code: Select all

"v2":true
Please read the tutorial.
THEMAX wrote: 18 Nov 2021, 08:33 If I want to add night animations to the diagonal variants of my trains, can I still use a v2 night animation frame like I did it before except it would be for 8 different frames or does it only work with 2 or 4 rotations ?

@JustAnyone @Lobby
Diagonal cars have 8 frames, so you would add animations to each of them, so probably yes.
get yoked!!
User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4313
Joined: 14 Sep 2017, 15:30
Location: Astrellia, UHAE
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by THEMAX »

Kulche wrote: 18 Nov 2021, 14:50
Wepf wrote: 18 Nov 2021, 09:35 WTH(What the heck) is

Code: Select all

"v2":true
Please read the tutorial.
THEMAX wrote: 18 Nov 2021, 08:33 If I want to add night animations to the diagonal variants of my trains, can I still use a v2 night animation frame like I did it before except it would be for 8 different frames or does it only work with 2 or 4 rotations ?

@JustAnyone @Lobby
Diagonal cars have 8 frames, so you would add animations to each of them, so probably yes.
Will do some testing then.
Emperor of Atlantean federated empire
Image
Founder state of Internationxal council
Leader of AEOY and steel pact
User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4313
Joined: 14 Sep 2017, 15:30
Location: Astrellia, UHAE
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by THEMAX »

Kulche wrote: 18 Nov 2021, 14:50
Wepf wrote: 18 Nov 2021, 09:35 WTH(What the heck) is

Code: Select all

"v2":true
Please read the tutorial.
THEMAX wrote: 18 Nov 2021, 08:33 If I want to add night animations to the diagonal variants of my trains, can I still use a v2 night animation frame like I did it before except it would be for 8 different frames or does it only work with 2 or 4 rotations ?

@JustAnyone @Lobby
Diagonal cars have 8 frames, so you would add animations to each of them, so probably yes.
I have done some tests and it indeed does not work, but with the update coming, it's now a requirement imo, and I cant afford the time to modify all my trains texture.
Emperor of Atlantean federated empire
Image
Founder state of Internationxal council
Leader of AEOY and steel pact
User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4313
Joined: 14 Sep 2017, 15:30
Location: Astrellia, UHAE
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by THEMAX »

So essentially, I would like to be able to do this :
Themax_Train_Real_33_Bombardier_Innovia_200_LasVegas_End.png
Themax_TrainNight_Real_33_Bombardier_Innovia_200_LasVegas_End.png
And be able to have both over each ones, like it is possible with a json like that :

Code: Select all    Reset

[ { "id": "$Themax_TrainNight_Real_33_Innovia_200_LasVegas_End", "type": "animation", "light": true, "light switching": true, "frames": [ { "bmp": "Themax_TrainNight_Real_33_Innovia_200_LasVegas_End.png", "count": 4, "h": 19, "w": 21 } ], "rotation aware": true }, { "author": "Themax", "flag normal": false, "flag train": false, "flag monorail": true, "frames": [ { "bmp": "Themax_Train_Real_33_Innovia_200_LasVegas_End.png", "count": 4, "h": 19, "w": 21 } ], "id": "$Themax_Train_Real_33_Innovia_200_LasVegas_End", "animation": [{"id": "$Themax_TrainNight_Real_33_Innovia_200_LasVegas_End", "x":0,"y":-11}], "speed": 2.5, "type": "car", "v2": true } ]
JSON checker
Check
Except with a vehicle with 8 parts :
Cadillac_CT6 White.png
Cadillac_CT6-Night.png

Code: Select all    Reset

[ { "id": "$Themax_CarNight_Real_1_Cadillac_CT6", "type": "animation", "light": true, "light switching": true, "frames": [ { "bmp": "Themax_CarNight_Real_1_Cadillac_CT6.png", "count": 8, "h": 10, "w": 15 } ], "rotation aware": true }, { "author": "Themax", "flag pkw": true, "flag normal": false, "frames": [ { "bmp": "Themax_Car_Real_1_Cadillac_CT6.png", "count": 8, "h": 10, "w": 15 } ], "id": "$Themax_Car_Real_1_Cadillac_CT6", "animation": [{"id": "$Themax_CarNight_Real_1_Cadillac_CT6", "x":0,"y":-2}], "speed": 2.5, "frames per variant": 8, "type": "car", "v2": true } ]
JSON checker
Check
This would truly be of great help and reduce the workload BY A LOT also allowing me to update the railroad expansion plugin faster.
You do not have the required permissions to view the files attached to this post.
Emperor of Atlantean federated empire
Image
Founder state of Internationxal council
Leader of AEOY and steel pact
User avatar
Yakka Works
Inhabitant of a Conurbation
Reactions:
Posts: 412
Joined: 06 Jan 2020, 07:57
Location: Java-indonesia
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Cars

Post by Yakka Works »

THEMAX wrote: 18 Nov 2021, 19:39 So essentially, I would like to be able to do this :
Themax_Train_Real_33_Bombardier_Innovia_200_LasVegas_End.pngThemax_TrainNight_Real_33_Bombardier_Innovia_200_LasVegas_End.png

This would truly be of great help and reduce the workload BY A LOT also allowing me to update the railroad expansion plugin faster.
I Agree.
My plugins,up to date and it's free on my website. So check it out.
My website
Community/Creators Discord Server List
Previous topicNext topic