Road decoration

Learn here how to create and use plugins.

Moderator: Plugin Moderators

User avatar
22Alpha
Inhabitant of a Conurbation
Reactions:
Posts: 448
Joined: 23 Sep 2017, 14:29

Platform

Re: Road decoration

#26

Post by 22Alpha »

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?

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

Platform

Re: Road decoration

#27

Post by Lobby »

It is part of the game, it is a road decoration and it uses on click fun.

User avatar
Lakan Haraya
Metropolitan
Reactions:
Posts: 131
Joined: 28 Mar 2019, 09:34
Location: Philippines
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

#28

Post by Lakan Haraya »

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

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

Plugin Creator

Platform

Re: Road decoration

#29

Post by CommanderABab »

Have you tried making the animation used for those frames "rotation aware"?

User avatar
star Lee
Villager
Reactions:
Posts: 19
Joined: 06 Jul 2020, 04:57

Plugin Creator

Platform

Re: Road decoration

#30

Post by star Lee »

Excuse me, why road decoration can't be put on the railway?

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

Platform

Re: Road decoration

#31

Post by JustAnyone »

Code: Select all    Reset

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

User avatar
star Lee
Villager
Reactions:
Posts: 19
Joined: 06 Jul 2020, 04:57

Plugin Creator

Platform

Re: Road decoration

#32

Post by star Lee »

JustAnyone wrote:
22 Jul 2020, 11:13

Code: Select all    Reset

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

thank you! :D

User avatar
Lakan Haraya
Metropolitan
Reactions:
Posts: 131
Joined: 28 Mar 2019, 09:34
Location: Philippines
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

#33

Post by Lakan Haraya »

Would it be possible to support road deco in slopes in the near future? 🤔

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: Road decoration

#34

Post by CERRERA »

Is there a code for animation that is active when the car steps in the road decoration

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: Road decoration

#35

Post by CERRERA »

Tutorials for 64 frames of road deco

User avatar
Pederont
Small-town resident
Reactions:
Posts: 25
Joined: 10 Aug 2019, 09:01
Location: South Korea
Plugins: Showcase Store
Contact:

Plugin Creator

Platform

Re: Road decoration

#36

Post by Pederont »

Is it possible to make road deco react when vehicle is on the tile? just like military checkpoint.

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

Plugin Creator

Platform

Re: Road decoration

#37

Post by CommanderABab »

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.

User avatar
ian`
Supporter
Reactions:
Posts: 117
Joined: 04 Apr 2020, 17:36
Location: Indonesien
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

#38

Post by ian` »

Yes, but it's not easy to make. :?

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

Plugin Creator

Platform

Re: Road decoration

#39

Post by CommanderABab »

That's cool!

User avatar
imajoke
Inhabitant of a Conurbation
Reactions:
Posts: 532
Joined: 27 Oct 2019, 02:39
Plugins: Showcase Store
Version: Beta

Re: Road decoration

#40

Post by imajoke »

*confused screaming*

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: Road decoration

#41

Post by THEMAX »

ian` wrote:
05 Feb 2021, 05: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.

User avatar
ian`
Supporter
Reactions:
Posts: 117
Joined: 04 Apr 2020, 17:36
Location: Indonesien
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Road decoration

#42

Post by ian` »

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
Interactive Lua editor
Run

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: Road decoration

#43

Post by THEMAX »

How can i add night animations to a road animation (for example, to a lamp post)

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

Plugin Creator

Platform

Re: Road decoration

#44

Post by CommanderABab »

Add

Code: Select all

"light": true,
"light switching":true
to the lit at night part.

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: Road decoration

#45

Post by THEMAX »

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 ?

Post Reply Previous topicNext topic

Return to “Tutorials and Documentation”