Create traffic lights

From Valve Developer Community
Revision as of 14:39, 24 May 2011 by Kostya (talk | contribs) (I translate. sorry for baD english! ^-^)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Русский

Traffic lights :) outputs and inputs

I think that you see in Half-Life 2 model of traffic lights? о_0 But it's simple model... Here I tell you how make a realy working lights.

What we need to make? о_0

  • Model props_c17\Traffic_Light001a.mdl prop_dynamic
  • color lights: point_spotlights on each lights =).
  • model properties:
Disable Shadows=Yes
Collide with world=Not solid (if you don't do this, light does not appear in game).
  • one logic_auto, two logic_relay.


CBETOFOPkpacHbIu.jpg
CBETOFOPredYellow.jpg
CBETOFOPgreen.jpg
CBETOFOPyellow.jpg

In details...

Time. Traffic lights lights for different time. Because road can be wide and big, can be small. If road wide then lights lights longer.

Red and Green - 30 seconds

yellow - 3 sec

outputs!

1. give targetnames for each of 3 point_spotlight with names: "greenLight" "redLight" "YellowLight". 1 logic_relay call traffLightRelay1, 2 - traffLightRelay2.

2. select logic_auto

3. in outputs

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnMapSpawn traffLightRelay1 Trigger   0.00 Yes Turn on this! :D

4. Select traffLightRelay1.

5. in outputs this:

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger yellowLight LightOn   28.00 No yellow in 28 sec
Io11.png OnTrigger redLight LightOff   30.00 No Red
Io11.png OnTrigger greenLight LightOn   30.00 No Green
Io11.png OnTrigger yellowLight LightOff   30.00 No Turn off yellow
Io11.png OnTrigger traffLightRelay2 Trigger   32.00 No Continue in second part
Примечание:In this system we need to create 2 logic_relay for make them cicle. First: red -> green. Second: green -> red. Each logic_relay connected with each other.

6. Select traffLightRelay2.

7. In Outputs:

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger greenLight LightOff   28.00 No green blink
Io11.png OnTrigger greenLight LightOn   28.50 No blink
Io11.png OnTrigger greenLight LightOff   29.00 No blink
Io11.png OnTrigger greenLight LightOn   29.50 No blink
Io11.png OnTrigger greenLight LightOff   30.00 No End blink. Turn off green
Io11.png OnTrigger yellowLight LightOn   30.00 No Turn off yellow
Io11.png OnTrigger redLight LightOn   32.00 No turn on red
Io11.png OnTrigger traffLightRelay1 Trigger   32.00 No activate first part
Io11.png OnTrigger yellowLight LightOff   32.00 No we forget turn off yellow! :D

It is all! ;).

I make schematics for this chaos:)

--]{o$Tya It is me B-) 14:39, 24 May 2011 (UTC)