Hello Ken,
an interesting idea.
As far as I know, lights can only be defined in a TOC file.
If Stu likes the idea, he could create a toc together with the tsc file (and include the toc call).
I played a bit with traffic lights, with the aim to have an automatic switching between green - yello - red.
With the below lines I managed to get a 22 sec green, 2 sec yellow and 22 sec red phase. The disadvantge is, that scenproc then only generates the same signal colors for the whole city. And random color is not possible; otherwise the signals would not sequence the colors.
# Traffic signals
CreateAF2Light|highway="traffic_signals"|1.0;0.0;0.0|5|0.15;0;6|5
CreateAF2Light|highway="traffic_signals"|0.0;1.0;0.0|5|0.15;3;6|5
But with Stu's program he maybe could assign the following:
All streets in E-W direction which have the attribut highway="traffic_signal" get this light:
<[light][element][4333]
<[vector3_float64][position][7.581755 52.272758 5.000000]>
<[vector3_float32][color][1.000000 0.000000 0.000000]>
<[float32][intensity][5.000000]>
<[vector4_float32][flashing][0.150000 0.000000 6.000000 0]>
<[uint32][group_index][0]>
>
<[light][element][4334]
<[vector3_float64][position][7.581755 52.272758 5.000000]>
<[vector3_float32][color][0.000000 1.000000 0.000000]>
<[float32][intensity][5.000000]>
<[vector4_float32][flashing][0.150000 3.000000 6.000000 0]>
<[uint32][group_index][0]>
>
Display More
and all streets in N-S direction which have the attribut "traffic_signal" get that light:
<[light][element][4330]
<[vector3_float64][position][7.591755 52.292758 5.000000]>
<[vector3_float32][color][0.000000 1.000000 0.000000]>
<[float32][intensity][5.000000]>
<[vector4_float32][flashing][0.150000 0.000000 6.000000 0]>
<[uint32][group_index][0]>
>
<[light][element][4331]
<[vector3_float64][position][7.591755 52.292758 5.000000]>
<[vector3_float32][color][1.000000 0.000000 0.000000]>
<[float32][intensity][5.000000]>
<[vector4_float32][flashing][0.150000 3.000000 6.000000 0]>
<[uint32][group_index][0]>
>
Display More
Optionally the toc generation could also take care of lights assigned to a model:
high chimneys, wind generators, railroad crossings and signals ...
What do you and Stu think?