Road decoration

Find tutorials, documentation, and resources for creating and using TheoTown plugins.
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3756
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: Road decoration

Post by Lobby » 07 Jun 2019, 08:21

It's up to you to specify for which alignment of the road which frames/animations should be drawn. Therefore it's also possible to use exactly two frames :)

:66: contains new attributes; I added them to the first post.
User avatar
22Alpha
Inhabitant of a Conurbation
Reactions:
Posts: 448
Joined: 23 Sep 2017, 12:29

Platform

Re: Road decoration

Post by 22Alpha » 05 Aug 2019, 12:26

Hello guys, anyone remember the road barrier plugin? Not sure if Lobby or Commander made it. But can it work as a road deco? or it would remain as an on click fun plugin?
:mine
User avatar
Lobby
Inhabitant of a Supercluster
Reactions:
Posts: 3756
Joined: 26 Oct 2008, 10:34
Plugins: Showcase Store

Re: Road decoration

Post by Lobby » 28 Aug 2019, 21:23

It is part of the game, it is a road decoration and it uses on click fun.
User avatar
Lakan Haraya
Metropolitan
Reactions:
Posts: 129
Joined: 28 Mar 2019, 07:34
Location: Philippines
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

Post by Lakan Haraya » 14 May 2020, 13:49

Hi :)

How can I create a rotation aware road deco for frame 5 and 10 (straight road) of the road, because rotation 0 (default) and 2 build the same road deco :/ and I don't want it into my plugin
Hmm...
"ᜀᜃᜓ ᜀᜅ᜔ ᜁᜌᜓᜅ᜔ ᜑᜇᜌ"
CEO of Haráya Motors

“TheoTown Philippines Council”
“Kapulungan Ng Mga Nagkakaisang Lungsod”
User avatar
CommanderABab
AB
Reactions:
Posts: 11263
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

Post by CommanderABab » 14 May 2020, 16:09

Have you tried making the animation used for those frames "rotation aware"?
my avatar:
User avatar
star Lee
Villager
Reactions:
Posts: 18
Joined: 06 Jul 2020, 02:57

Plugin Creator

Platform

Re: Road decoration

Post by star Lee » 22 Jul 2020, 04:27

Excuse me, why road decoration can't be put on the railway?
User avatar
JustAnyone
Honorary Contributor
Reactions:
Posts: 3664
Joined: 23 Jul 2017, 10:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Road decoration

Post by JustAnyone » 22 Jul 2020, 09:13

Code: Select all    Reset

"required flag train": true
JSON checker
Check
controls it
User avatar
star Lee
Villager
Reactions:
Posts: 18
Joined: 06 Jul 2020, 02:57

Plugin Creator

Platform

Re: Road decoration

Post by star Lee » 22 Jul 2020, 13:49

JustAnyone wrote: 22 Jul 2020, 09:13

Code: Select all    Reset

"required flag train": true
JSON checker
Check
controls it

thank you! :D
User avatar
CERRERA
Townsman
Reactions:
Posts: 48
Joined: 25 Jan 2020, 04:19
Location: Philippines
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

Post by CERRERA » 07 Nov 2020, 17:27

Is there a code for animation that is active when the car steps in the road decoration
Everything you can imagine is real
User avatar
CERRERA
Townsman
Reactions:
Posts: 48
Joined: 25 Jan 2020, 04:19
Location: Philippines
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

Post by CERRERA » 25 Jan 2021, 15:57

Tutorials for 64 frames of road deco
Everything you can imagine is real
User avatar
Pederont
Small-town resident
Reactions:
Posts: 32
Joined: 10 Aug 2019, 07:01
Location: South Korea
Plugins: Showcase Store

Plugin Creator

Platform

Re: Road decoration

Post by Pederont » 04 Feb 2021, 15:28

Is it possible to make road deco react when vehicle is on the tile? just like military checkpoint.
If my links doesn't work, turn off your ad blocker
I'm just a furry artist and graphic designer :img
User avatar
CommanderABab
AB
Reactions:
Posts: 11263
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

Post by CommanderABab » 04 Feb 2021, 18:57

You could try a fun using "road usage" in the condition statement. Keep in mind that it probably includes all levels of road at that tile: road, bridge(s), and tunnel.
my avatar:
User avatar
ian`
Metropolitan
Reactions:
Posts: 117
Joined: 04 Apr 2020, 15:36
Location: 日本
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

Post by ian` » 05 Feb 2021, 03:06

Yes, but it's not easy to make. :?
:bc
User avatar
CommanderABab
AB
Reactions:
Posts: 11263
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

Post by CommanderABab » 05 Feb 2021, 17:05

That's cool!
my avatar:
imajoke
Inhabitant of a Conurbation
Reactions:
Posts: 528
Joined: 27 Oct 2019, 00:39
Plugins: Showcase Store
Version: Beta

Platform

Re: Road decoration

Post by imajoke » 10 Mar 2021, 21:11

*confused screaming*
Eugh. I remembered this account existed and all I did.
I'm a better person now. Most likely to stay inactive.
Awesome community by the way y'all are peak 🗣️🗣️

The YouTube account isn't mine anymore by the way, a different family member uses it now.
User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4311
Joined: 14 Sep 2017, 15:30
Location: Astrellia, UHAE
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

Post by THEMAX » 22 Mar 2021, 21:24

ian` wrote: 05 Feb 2021, 03:06
Yes, but it's not easy to make. :?
Do you have any json / lua that can show me how this is done ? cause it could be really interesting for me since i am working on a train expansion plugin.
Emperor of Atlantean federated empire
Image
Founder state of Internationxal council
Leader of AEOY and steel pact
User avatar
ian`
Metropolitan
Reactions:
Posts: 117
Joined: 04 Apr 2020, 15:36
Location: 日本
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

Post by ian` » 25 Mar 2021, 03:18

The code looks like this :

Code: Select all    Reset

local lastCounterRight = Array{0, 0, 0} local lastCounterLeft = Array{0, 0, 0} local timer = 0 local x,y,level local isTrainOnTheTrack = false function script:update() if City.countRoads(Draft.getDraft'$road_barrier_open00') > 0 then x,y,level = City.getRoad(1, Draft.getDraft'$road_barrier_open00') elseif City.countRoads(Draft.getDraft'$road_barrier_closed00') > 0 then x,y,level = City.getRoad(1, Draft.getDraft'$road_barrier_closed00') end if timer == 0 then lastCounterRight[1] = Tile.getRoadCarCount(x+4, y+1, level) lastCounterRight[2] = Tile.getRoadCarCount(x+3, y+1, level) lastCounterRight[3] = Tile.getRoadCarCount(x+5, y+1, level) lastCounterLeft[1] = Tile.getRoadCarCount(x-4, y+1, level) lastCounterLeft[2] = Tile.getRoadCarCount(x-3, y+1, level) lastCounterLeft[3] = Tile.getRoadCarCount(x-5, y+1, level) Builder.buildRoad(Draft.getDraft'$road_barrier_open00',x,y,x,y) isTrainOnTheTrack = false timer = 1 elseif timer > 250 then lastCounterRight[1] = Tile.getRoadCarCount(x+4, y+1, level) lastCounterRight[2] = Tile.getRoadCarCount(x+3, y+1, level) lastCounterRight[3] = Tile.getRoadCarCount(x+5, y+1, level) lastCounterLeft[1] = Tile.getRoadCarCount(x-4, y+1, level) lastCounterLeft[2] = Tile.getRoadCarCount(x-3, y+1, level) lastCounterLeft[3] = Tile.getRoadCarCount(x-5, y+1, level) Builder.buildRoad(Draft.getDraft'$road_barrier_open00',x,y,x,y) isTrainOnTheTrack = false timer = 0 elseif timer > 1 then Builder.buildRoad(Draft.getDraft'$road_barrier_closed00',x,y,x,y) end if Tile.getRoadCarCount(x+4, y+1, level) ~= lastCounterRight[1] then if isTrainOnTheTrack then isTrainOnTheTrack = false end if not isTrainOnTheTrack and Tile.getRoadCarCount(x+3, y+1, level) ~= lastCounterRight[2] then timer = timer + 1 isTrainOnTheTrack = true if isTrainOnTheTrack then if Tile.getRoadCarCount(x-3, y+1, level) ~= lastCounterLeft[2] then if Tile.getRoadCarCount(x-4, y+1, level) ~= lastCounterLeft[1] then timer = 0 end end end elseif isTrainOnTheTrack and Tile.getRoadCarCount(x+5, y+1, level) ~= lastCounterRight[3] then isTrainOnTheTrack = false timer = 0 end elseif Tile.getRoadCarCount(x-4, y+1, level) ~= lastCounterLeft[1] then if isTrainOnTheTrack then isTrainOnTheTrack = false end if not isTrainOnTheTrack and Tile.getRoadCarCount(x-3, y+1, level) ~= lastCounterLeft[2] then timer = timer + 1 isTrainOnTheTrack = true if isTrainOnTheTrack then if Tile.getRoadCarCount(x+3, y+1, level) ~= lastCounterRight[2] then if Tile.getRoadCarCount(x+4, y+1, level) ~= lastCounterRight[1] then timer = 0 end end end elseif isTrainOnTheTrack and Tile.getRoadCarCount(x-5, y+1, level) ~= lastCounterLeft[3] then isTrainOnTheTrack = false timer = 0 end end end
Lua editor
Run
:bc
User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4311
Joined: 14 Sep 2017, 15:30
Location: Astrellia, UHAE
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

Post by THEMAX » 31 Mar 2021, 16:16

How can i add night animations to a road animation (for example, to a lamp post)
Emperor of Atlantean federated empire
Image
Founder state of Internationxal council
Leader of AEOY and steel pact
User avatar
CommanderABab
AB
Reactions:
Posts: 11263
Joined: 07 Jun 2016, 19:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

Post by CommanderABab » 31 Mar 2021, 16:25

Add

Code: Select all

"light": true,
"light switching":true
to the lit at night part.
my avatar:
User avatar
THEMAX
Inhabitant of a Universe
Reactions:
Posts: 4311
Joined: 14 Sep 2017, 15:30
Location: Astrellia, UHAE
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

Post by THEMAX » 31 Mar 2021, 21:21

Does someone have the json + the textures of the lamp post & the night animation of the lamp post so i can see how those are made ?
Emperor of Atlantean federated empire
Image
Founder state of Internationxal council
Leader of AEOY and steel pact