The Skyscraper Simulator Forum

User Projects => Tutorials => Topic started by: Skyscraper Simulator Showcase on November 13, 2018, 02:18:53 pm

Title: Creating a Traffic Signal Intersection
Post by: Skyscraper Simulator Showcase on November 13, 2018, 02:18:53 pm
Traffic Signals
This guide will show you how to create an American-style traffic signal. June's Traffic Signals must be installed in order for you to not have an missing textures. June's Traffic Signals are included in her integration project. There are four components to creating a traffic signal which will be listed below. Roads should be created prior to traffic signals. Textures for the traffic signals must also be loaded first in order for this to work properly!


Sets - Substitute the proper values in place of the sets listed below.
Intersection #: This is the number of the traffic signal intersection you are creating. You should use the same intersection number for the entire intersection when creating a traffic signal.
Signal #: This is the number of the traffic signal you are creating for that particular intersection.
Texture: This is the texture for the pillars for the traffic signal.
Coordinates: Location for the pillars


(https://farm2.staticflickr.com/1964/45141027824_c7eeba0581_z.jpg)

Pillars
Pillars can be created by using the CreateWallBox2 command. A total of four pillars must be created, one for each corner of the intersection including Northeast(NE), Northwest(NW), Southwest(SW), and Southeast(SE).

DrawWalls = true, true, true, true, true, true
CreateWallBox2 external, int#NW, texture, NW X, NW Z, 1.000, 1.000, 25.000, 0, 0, 0, true, true, true, true
CreateWallBox2 external, int#NE, texture, NE X, NE Z,  1.000, 1.000, 25.000, 0, 0, 0, true, true, true, true
CreateWallBox2 external, int#SW, texture, SW X, SW Z,  1.000, 1.000, 25.000, 0,  0, 0, true, true, true, true
CreateWallBox2 external, int#SE, texture, SE X, SE Z,  1.000, 1.000, 25.000, 0, 0, 0, true, true, true, true


(https://farm5.staticflickr.com/4900/45865325321_e0d2fbb6fd_z.jpg)


Span Wire
Two span wires should be created for each intersection, both a lower span wire and an upper span wire.

CreateWallBox external, Spanwire#L, Black,  SW X,  NE X,  NE Z,  SW Z, 0.0625, 17.000, 1, 1, true, true, false, false
CreateWallBox external, Spanwire#U, Black,  SW X,  NE X,  NE Z,  SW Z, 0.0625, 20.000, 1, 1, true, true, false, false


(https://farm2.staticflickr.com/1901/45141027864_078b1089ac_z.jpg)

Hangers
One hanger should be created for each traffic signal. One hanger should be placed in the center of each lane on a span wire.

CreateWallBox2 external, hanger#_#, texture,  X,  Z, 0.250, 0.250, 3, 17.000, 0, 0, true, true, false, true

(https://farm2.staticflickr.com/1914/44952316595_7fc7b50346_z.jpg)


Signals
Creating signals is very similar to creating hangers. Signals should be created at the EXACT same coordinates as their hangers. TextureOverride is used to display the correct traffic signal.

TextureOverride MainNegativeTex, MainPositiveTex, SideNegativeTex, SidePositiveTex, TopTex, BottomTex
CreateWallBox2 external, light#_# standardframe,  X,  Z, 1, 1, 3, 14.000, 1, 1, true, true, true, true


(https://farm2.staticflickr.com/1960/45865325521_723ddf292d_z.jpg)
Title: Re: Creating a Traffic Signal Intersection
Post by: Skyscraper Simulator Showcase on November 13, 2018, 03:12:34 pm
Code for Signals Pictured

DrawWalls = true, true, true, true, true, true
CreateWallBox2 external, int2NW, concretepillar, -17.500, 521.5, 1.000, 1.000, 25.000, 0, 0.0000000000, 0.0000000000, true, true, true, true
CreateWallBox2 external, int2NE, concretepillar, 77.500, 521.5, 1.000, 1.000, 25.000, 0, 0.0000000000, 0.0000000000, true, true, true, true
CreateWallBox2 external, int2SW, concretepillar, -17.500, 479.5, 1.000, 1.000, 25.000, 0, 0.0000000000, 0.0000000000, true, true, true, true
CreateWallBox2 external, int2SE, concretepillar, 77.500, 479.5, 1.000, 1.000, 25.000, 0, 0.0000000000, 0.0000000000, true, true, true, true

CreateWallBox external, Spanwire2L, Black, -17.5, 77.5, 521.5, 479.5, 0.0625, 17.000, 1.0000000000, 1.0000000000, true, true, false, false
CreateWallBox external, Spanwire2U, Black, -17.5, 77.5, 521.5, 479.5, 0.0625, 20.000, 1.0000000000, 1.0000000000, true, true, false, false

CreateWallBox2 external, hanger2_1, lighthanger, 56.500, 521.500, 0.250, 0.250, 3, 17.000, 0.0000000000, 0.0000000000, true, true, false, true
CreateWallBox2 external, hanger2_2, lighthanger, 46.500, 521.500, 0.250, 0.250, 3, 17.000, 0.0000000000, 0.0000000000, true, true, false, true
CreateWallBox2 external, hanger2_3, lighthanger, 36.500, 521.500, 0.250, 0.250, 3, 17.000, 0.0000000000, 0.0000000000, true, true, false, true

CreateWallBox2 external, hanger2_4, lighthanger, 23.000, 479.500, 0.250, 0.250, 3, 17.000, 0.0000000000, 0.0000000000, true, true, false, true
CreateWallBox2 external, hanger2_5, lighthanger, 13.000, 479.500, 0.250, 0.250, 3, 17.000, 0.0000000000, 0.0000000000, true, true, false, true
CreateWallBox2 external, hanger2_6, lighthanger, 3.000, 479.500, 0.250, 0.250, 3, 17.000, 0.0000000000, 0.0000000000, true, true, false, true

CreateWallBox2 external, hanger2_7, lighthanger, 77.500, 490, 0.250, 0.250, 3, 17.000, 0.0000000000, 0.0000000000, true, true, false, true
CreateWallBox2 external, hanger2_8, lighthanger, 77.500, 500, 0.250, 0.250, 3, 17.000, 0.0000000000, 0.0000000000, true, true, false, true

CreateWallBox2 external, hanger2_9, lighthanger, -17.5, 500, 0.250, 0.250, 3, 17.000, 0.0000000000, 0.0000000000, true, true, false, true
CreateWallBox2 external, hanger2_10, lighthanger, -17.5, 510, 0.250, 0.250, 3, 17.000, 0.0000000000, 0.0000000000, true, true, false, true

TextureOverride greenstandard, standardframe, standardframe, standardframe, standardframe, standardframe
CreateWallBox2 external, light2_1, standardframe, 56.500, 521.500, 1.000, 1.000, 3, 14.000, 1.0000000000, 1.0000000000, true, true, true, true
TextureOverride greenstandard, standardframe, standardframe, standardframe, standardframe, standardframe
CreateWallBox2 external, light2_2, standardframe, 46.500, 521.500, 1.000, 1.000, 3, 14.000, 1.0000000000, 1.0000000000, true, true, true, true
TextureOverride redarrowleft, standardframe, standardframe, standardframe, standardframe, standardframe
CreateWallBox2 external, light2_3, standardframe, 36.500, 521.500, 1.000, 1.000, 3, 14.000, 1.0000000000, 1.0000000000, true, true, true, true

TextureOverride standardframe, redarrowleft, standardframe, standardframe, standardframe, standardframe
CreateWallBox2 external, light2_4, standardframe, 23.000, 479.500, 1.000, 1.000, 3, 14.000, 1.0000000000, 1.0000000000, true, true, true, true
TextureOverride standardframe, greenstandard, standardframe, standardframe, standardframe, standardframe
CreateWallBox2 external, light2_5, standardframe, 13.000, 479.500, 1.000, 1.000, 3, 14.000, 1.0000000000, 1.0000000000, true, true, true, true
TextureOverride standardframe, greenstandard, standardframe, standardframe, standardframe, standardframe
CreateWallBox2 external, light2_6, standardframe, 3.000, 479.500, 1.000, 1.000, 3, 14.000, 1.0000000000, 1.0000000000, true, true, true, true


TextureOverride comboframeside, comboframeside, redcombo, comboframe, comboframetop, comboframebottom
CreateWallBox2 external, light2_7, standardframe, 77.500, 500, 1.000, 2.200, 3, 14.000, 1.0000000000, 1.0000000000, true, true, false, true
TextureOverride standardframe, standardframe, redstandard, standardframe, standardframe, standardframe
CreateWallBox2 external, light2_8, standardframe, 77.500, 490, 1.000, 1.000, 3, 14.000, 1.0000000000, 1.0000000000, true, true, true, true

TextureOverride comboframeside, comboframeside, comboframe, redcombo, comboframetop, comboframebottom
CreateWallBox2 external, light2_9, standardframe, -17.5, 500, 1.000, 2.200, 3, 14.000, 1.0000000000, 1.0000000000, true, true, false, true
TextureOverride standardframe, standardframe, standardframe, redstandard, standardframe, standardframe
CreateWallBox2 external, light2_10, standardframe, -17.5, 510, 1.000, 1.000, 3, 14.000, 1.0000000000, 1.0000000000, true, true, true, true
Title: Re: Creating a Traffic Signal Intersection
Post by: gooper1 on November 22, 2018, 11:05:39 am
Would there be a way to use the action system to create a signalling room to change these? I'm pretty sure Kan did this in one of his buildings.
Title: Re: Creating a Traffic Signal Intersection
Post by: Skyscraper Simulator Showcase on November 22, 2018, 11:53:42 am
Would there be a way to use the action system to create a signalling room to change these? I'm pretty sure Kan did this in one of his buildings.
I would hope so. I intend to continue developing the simulator to include slideshow textures. Slideshow textures would allow different textures to be displayed after a certain amount of seconds.

Example in the load data section:
CreateSlideshow 1, true, redlight, 20, greenlight, 25, yellowlight, 3

After that you can apply the texture Slideshow1 to anything that used a texture before.
Title: Re: Creating a Traffic Signal Intersection
Post by: Schindler 7000 on January 13, 2019, 04:00:24 am
Would there be a way to use the action system to create a signalling room to change these? I'm pretty sure Kan did this in one of his buildings.
I would hope so. I intend to continue developing the simulator to include slideshow textures. Slideshow textures would allow different textures to be displayed after a certain amount of seconds.

Example in the load data section:
CreateSlideshow 1, true, redlight, 20, greenlight, 25, yellowlight, 3

After that you can apply the texture Slideshow1 to anything that used a texture before.
Skyscrapersim is dosen't have "CreateSlideshow" command.
Title: Re: Creating a Traffic Signal Intersection
Post by: ZZ9 on January 13, 2019, 06:07:44 am
Skyscrapersim is dosen't have "CreateSlideshow" command.
Not right now, but from what June is saying, it is a feature that she wants to add at some point in the future (and I would actually like it too).
Title: Re: Creating a Traffic Signal Intersection
Post by: Skyscraper Simulator Showcase on January 13, 2019, 11:58:16 am
Skyscrapersim is dosen't have "CreateSlideshow" command.
Not right now, but from what June is saying, it is a feature that she wants to add at some point in the future (and I would actually like it too).
I wish I could add the feature. Unfortunately, I have no idea how to code for ORGE or C++. Does anybody other than Ryan know how to develop the simulator?
Title: Re: Creating a Traffic Signal Intersection
Post by: ZZ9 on January 13, 2019, 02:16:36 pm
Skyscrapersim is dosen't have "CreateSlideshow" command.
Not right now, but from what June is saying, it is a feature that she wants to add at some point in the future (and I would actually like it too).
I wish I could add the feature. Unfortunately, I have no idea how to code for ORGE or C++. Does anybody other than Ryan know how to develop the simulator?
Sadly I don't know any C++ or OGRE code, but if I ever learn either in the future as part of something else I might be able to try and help out.
Title: Re: Creating a Traffic Signal Intersection
Post by: HappyPizza64 on April 27, 2019, 03:06:32 pm
I have a question: could you retexture the lights to your country's ones and reposition them vertically instead of horizontally? Like here in Ireland, they don't hang on poles horizontally, but vertically. Also, I could ask my friend if he could try develop the simulator further as I think he knows some C++.
Title: Re: Creating a Traffic Signal Intersection
Post by: Skyscraper Simulator Showcase on April 28, 2019, 12:48:29 am
I have a question: could you retexture the lights to your country's ones and reposition them vertically instead of horizontally? Like here in Ireland, they don't hang on poles horizontally, but vertically. Also, I could ask my friend if he could try develop the simulator further as I think he knows some C++.

Absolutely! The traffic lights can be re textured to match your country's ones. They can also be placed vertically on poles by just creating a column. Creating Irish style traffic lights is actually easier than creating the span wire boxes that I have created. Span wire traffic signals are common in the Southern United States for major ones such as this one.

(https://live.staticflickr.com/65535/47719065361_7653f51113_z.jpg)