Difference between revisions of "CityLite"

imported>NelsonJenkins
imported>NelsonJenkins
(Emergency Signal Program)
 
(46 intermediate revisions by the same user not shown)
Line 1: Line 1:
The CityLite (also known as ShittyLite) is a programmable traffic signal system.
+
{{ infobox product
 +
| title            = CityLite
 +
| image            = [[File:VendorImage5 - CityLite Traffic Signals.jpg|200px|center]]
 +
| caption          = CityLite vendor image.
 +
| inventor        = [[Nelson Jenkins]]
 +
| launch year      = 2006
 +
| company          = [[Gentek]]
 +
| available        = Marketplace & In-World
 +
| url              = '''[https://marketplace.secondlife.com/p/CityLite-Traffic-Signal-Pack-Fully-Programmable-Mesh-Traffic-Signals/3727118 Marketplace Listing]'''
 +
}}
  
'''Fix LODs, extra signal textures, signal case colors, 4-ways from bottom'''
+
The '''CityLite''' is a programmable traffic signal system originally designed in 2006, updated up until 2009, and then re-released in mesh in July 2012.
 +
 
 +
{{MkINote|Although components of this pack are made by [[ac14 Hutson]] and [[Hal Berkmans]], please contact [[Nelson Jenkins]] with questions. ac14 and Hal can not and will not help you.}}
 +
 
 +
'''The latest version of the CityLite is v4.1 - if you have an older version, please rez the Update Box.'''
 +
The latest update includes the following:
 +
* GREENFLASH and REDYELLOWFLASH commands added on local signal override
 +
* REDFLASH, YELLOWFLASH, GREENFLASH, and REDYELLOWFLASH commands added on controller (manual override and custom programming)
 +
* Flashing animation fixed so it is visible from long distance
 +
* Fixed pedestrian signal countdown getting stuck if OFF command sent
 +
* All signals now modify for linking
 +
* All signals sized slightly smaller
 +
* API released
 +
* IntelliLight compatibility added (for future use)
 +
 
 +
==Basic Setup - [http://www.youtube.com/watch?v=LgG-lRRQAOs VIDEO TUTORIAL]==
 +
# Choose which signal you want which is labeled '''*BASIC*'''.
 +
# Right click any object in-world and select Edit. This should open your Edit window.
 +
# Rez the intersection or signal by dragging it out of your inventory onto the ground.
 +
# If you're using a multi-signal intersection, position the set of signals so they are centered on the middle of the intersection.
 +
# If you've rezzed a 3-way signal/intersection, rotate it so that all directions are signaled. With the intersection, the alignment prim will show directions of traffic flow - make sure that the set of signals is rotated properly.
 +
# Move each individual signal/pole so it's on the corner of the sidewalk, if necessary.
 +
# If you're using a multi-signal intersection, delete the alignment prim with the text and arrows.
 +
# Rez a controller. It will automatically start up after a few seconds. You're done!
 +
# Repeat steps 1-7 for other intersections in the same region. Do not rez more than one controller per region for basic signals.
 +
 
 +
==Advanced Setup - [http://www.youtube.com/watch?v=hOpt3UABPxE VIDEO TUTORIAL]==
 +
'''STOP! STOP! STOP!'''
 +
The following signals will work out of the box:
 +
* 3-Head Signal
 +
* 2-Head Signal
 +
* 3-Head Left Turn Signal
 +
* 2-Head Left Turn Signal
 +
'''''ALL OTHER SIGNALS WILL NOT WORK WITHOUT CONFIGURATION.''''' You '''MUST''' set the signals' ID to either "X-Normal", "Y-Normal", "X-Left", or "Y-Left" to work with the controller ''without'' a custom program. '''It is highly recommended to learn how to use the custom programming function if you intend to use any nonstandard signals.'''
  
==Setup==
 
 
# Rez poles.
 
# Rez poles.
# Rez signals and set their signal IDs.
+
# Rez signals and set their signal IDs. Click each signal, select Config, and set a signal ID. Do not use signals marked with '''*BASIC*'''.
## For 1-Way signals, click each signal, select Config, and set a signal ID.
+
## X-Normal and Y-Normal are normal "ball" signals. X and Y are different roads; X is usually the main road, and Y is the crossroad. These are only shown for normal signals.
### X-Normal and Y-Normal are normal "ball" signals. X and Y are different roads; X is usually the main road, and Y is the crossroad. These are only shown for Normal signals.
+
## X-Left and Y-Left are protected left turn signals. These are only shown for Left Turn signals, which are optional and require a change in the _config notecard (see XLEFT and YLEFT).
### X-Left and Y-Left are protected left turn signals. These are only shown for LeftTurn signals, which are optional and require a change in the _config notecard.
+
## Custom allows you to set a custom signal ID. This is only used for custom-programmed controllers. Any alphanumeric string works (A-Z, 0-9) - ''do not'' use spaces or special characters. '''If you are not using a custom program, you MUST set the signals' ID to either "X-Normal", "Y-Normal", "X-Left", or "Y-Left" for them to work.'''
### Custom allows you to set a custom signal ID. This is only used for custom-programmed controllers.
 
## For 4-Way and 3-Way signals, look at the top of the signal (you should see little X and Y markers). Rotate the signal to your liking.
 
## All other signals can only be used with custom programming, or are standalone.
 
 
# If you want, rez pedestrian signals and set their signal IDs.
 
# If you want, rez pedestrian signals and set their signal IDs.
## X-Normal and Y-Normal are the two default options, they are the same as the traffic signals.
+
## X-Normal and Y-Normal are the two default options, they are the same as the traffic signals. Custom can also be used.
# If you don't want all signals in the region synchronized, or you have different intersection configurations (some have left turn signals, some don't, etc.) you will need to set each signal's intersection. Click it, select Config, select Intersection, and type an intersection ID in. More information on intersections is below.
+
# If you don't want all signals in the region synchronized, or you have different intersection configurations (some have left turn signals, some don't, etc.) you will need to set each signal's intersection. Click it, select Config, select Intersection, and type an intersection ID in. Any alphanumeric string works (A-Z, 0-9) - ''do not'' use spaces or special characters. You need to do this for every signal in the intersection.
# Rez a controller for each intersection ID (if you didn't set any, just rez one controller - this will control all signals in the region).
+
# Rez a controller for each intersection ID (if you didn't set any, just rez one controller - this will control all signals in the region). '''Do not''' rez multiple controllers if you haven't changed the intersection IDs!
# Edit the _config notecard in the controller. Each setting has a comment with instructions. If you don't know what to do, you can just leave it alone - the system will work automatically with just normal signals out of the box.
+
# Edit the _config notecard in the controller. Each setting has a comment with instructions, and should be self-explanatory.
 
# The signals should start up once the notecard is finished loading.
 
# The signals should start up once the notecard is finished loading.
  
 
==Signal Types==
 
==Signal Types==
You can set the signal ID to X-Left or Y-Left to change the signal to a protected left turn signal. Protected left turn signals are not enabled by default - they'll just remain red. If you have an X-Left signal, you'll need to set XLEFT to 1 in the controller's _config notecard - similarly, if you have a Y-Left signal, you'll need to set YLEFT to 1. This only works with the default sequence; these settings are ignored if you're using a custom programming sequence.
+
[[File:CITYLITE CHART.png|300px|thumb|Signal Guide (for advanced users only)]]
 +
* Protected left turn signals are not enabled by default - they'll just remain off. If you have an X-Left signal, you'll need to set XLEFT to something greater than 0 (preferably around 4-8) in the controller's _config notecard - similarly, if you have a Y-Left signal, you'll need to set YLEFT to something greater than 0. This only works with the default sequence; these settings are ignored if you're using a custom programming sequence.
 +
* Signals other than the 3-Head and 2-Head Normal and Left Turn signals all use the signal ID "DefaultSig" and must be configured manually.
  
CityLite has many different types of signals.
+
==Customization==
* '''1-Way Signal''': normal 3-head, 1-way signal.
+
You can change the housing colors on any signals by clicking them, selecting Config, then selecting HousingColor. You can then choose from the following color combinations:
* '''3-Way & 4-Way Signals''': can be used like normal single signals, but work for all 3 or 4 directions - their X and Y directions are hard-coded; just look at the top of the signal to see which direction is which.
+
* Black: black.
* '''2-Head/3-Head Left Turn Signal''': protected left turn arrow signal with a red arrow indication on the 3-head signal for preventing turns.
 
* '''2-Head Red & Green Signal''': normal 1-Way signal without a yellow indication. Sending the yellow color will indicate both red and green.
 
* '''Left/Right Pedestrian Signal''': pedestrian crossing signals mounted either to the left or right of the pole.
 
 
 
The rest of the signals cannot be used with the default sequence - they can only be used with a custom programming sequence.
 
* '''2-Head/3-Head Right Turn Signal''': protected right turn arrow signal with a red arrow indication on the 3-head signal for preventing turns.
 
* '''2-Head/3-Head Straight-Only Signal''': protected straight-only arrow signal with a red arrow indication on the 3-head signal for preventing turns.
 
* '''Transit Signal''': specialized signals for buses and trams.
 
* '''2-Head/3-Head Left/Right Lane Control Signal''': red X and green arrow indicators for lane control - 3-head signal has either a left or right yellow diagonal arrow.
 
* '''2-Head/3-Head Emergency Signal''': emergency signal for fire departments - comes with a separate emergency signal controller, but can be used through custom programming.
 
 
 
The CityLite pack also includes some flashing beacons:
 
* '''1-Head Red/Yellow Beacons''': standalone flashing beacon.
 
* '''2-Head Red/Yellow Beacons''': standalone alternating beacon.
 
* '''4-Way Red Beacon''': standalone multi-directional red flashing beacon.
 
* '''4-Way Red & Yellow Beacon''': standalone multi-directional flashing beacon with yellow X and red Y.
 
 
 
==Signal Customization==
 
You can customize any signals by clicking them, selecting Config, then selecting Colors. You can then choose from the following color combinations:
 
 
* Green: dark green.
 
* Green: dark green.
* Black: black.
 
 
* Yellow: yellow.
 
* Yellow: yellow.
* YlwBlack: yellow casing with a black surround.
+
* YlwBlack: yellow housing with a black surround plate. Not shown on pedestrian signals, and only useful if surround is shown.
* BlackWht: black casing with a yellow edge on the surround (European style).
+
* BlackWht: black housing with a white edge on the surround plate (European style). Not shown on pedestrian signals, and only useful if surround is shown.
 +
* BlackFlr: black housing with a fluorescent yellow edge on the surround plate for high visibility (only use this in poor-visibility areas). Not shown on pedestrian signals, and only useful if surround is shown.
  
 
You can customize 1-Way signals by clicking them, selecting Config, and using Tgl Surround or Tgl Mount. These will toggle the surround plate and the hanging mount, respectively.
 
You can customize 1-Way signals by clicking them, selecting Config, and using Tgl Surround or Tgl Mount. These will toggle the surround plate and the hanging mount, respectively.
 +
 +
You can customize pedestrian signals by clicking them, selecting Config, and using Tgl Grille or Chg Mount. These will toggle the grille and change/remove the mount, respectively.
 +
 +
The 5 poles included with the kit are modifiable, so they can be recolored and stretched (within reason) to your liking.
  
 
==Access Settings & Manual/Override Controls==
 
==Access Settings & Manual/Override Controls==
The access settings in the _config notecard (ACCESS, WHITELIST, and BLACKLIST) are used to access the controller's manual intersection controls AND the signals' override controls for the same intersection. Anyone that has access can do the following:
+
The access settings in the _config notecard (ACCESS, WHITELIST, and BLACKLIST) are used to access the controller's manual intersection controls AND the signals' override controls for the same intersection. However, signals must have a controller with their intersection (the same intersection ID) for access settings to work, otherwise only the owner will have access. For example, if you had one controller controlling multiple intersections through the use of a custom program sequence, only the intersection that has the same ID as the controller would use those access settings.
 +
 
 +
Anyone that has access can do the following:
  
 
* Controller Manual Controls (click the controller)
 
* Controller Manual Controls (click the controller)
 
** '''Automatic''': Returns control to the automatic sequence (if in manual mode).
 
** '''Automatic''': Returns control to the automatic sequence (if in manual mode).
 
** '''Manual''': Disengages the automatic sequence and lets the user control lights manually. Also opens the Set Colors menu.
 
** '''Manual''': Disengages the automatic sequence and lets the user control lights manually. Also opens the Set Colors menu.
** '''Set Colors''' ''(NOTE: These controls, except for Sig Custom, only work for the default signal IDs - X-Straight, Y-Straight, X-Left, and Y-Left.)''
+
** '''Set Colors'''
*** '''X Ylw/Y Red''': X flashes yellow, Y flashes red.
+
*** '''All Off''': All signals turn off, including custom signals referenced in the custom program sequence (if used).
*** '''X Red/Y Ylw''': X flashes red, Y flashes yellow.
 
*** '''All Red''': X and Y flash red.
 
*** '''All Yellow''': X and Y flash yellow.
 
*** '''All Off''': X and Y turn off.
 
 
*** '''Sig X-Normal, Sig Y-Normal, Sig X-Left, Sig Y-Left''': Lets you change the color for all signals with that ID.
 
*** '''Sig X-Normal, Sig Y-Normal, Sig X-Left, Sig Y-Left''': Lets you change the color for all signals with that ID.
*** '''Sig X-All, Sig Y-All''': Lets you change the color for all X or all Y signals.
 
 
*** '''Sig Custom''': Lets you change the color for all signals with specified custom ID.
 
*** '''Sig Custom''': Lets you change the color for all signals with specified custom ID.
 +
*** '''Reset''': Resets the controller.
  
 
* Signal Override Controls (click an individual signal)
 
* Signal Override Controls (click an individual signal)
Line 72: Line 95:
 
** '''Override''': Ignores the controller and lets the user control the light manually. Also opens the Set Color menu.
 
** '''Override''': Ignores the controller and lets the user control the light manually. Also opens the Set Color menu.
 
** '''Set Color''': Lets you change the color for that signal only.
 
** '''Set Color''': Lets you change the color for that signal only.
 +
 +
'''NOTE''': If you use the signal override controls, '''make sure''' you choose '''Rtn Control''' when you're done so the controller can access them - otherwise, you'll complain to me that they don't work, and I'll hate you.
 +
 +
There is also a '''Config''' menu option in the signal menu, but this is only shown to the owner.
  
 
==Intersections==
 
==Intersections==
 
CityLite works through the use of intersection IDs. Most users want to keep things simple, so in this case, just don't change intersection IDs anywhere (signals or controller) and everything will be synced together.
 
CityLite works through the use of intersection IDs. Most users want to keep things simple, so in this case, just don't change intersection IDs anywhere (signals or controller) and everything will be synced together.
  
However, if you want to separately-controlled intersections, you'll have to set an intersection ID. Click each signal in the intersection and select Config, then select Intersection, then enter your ID. In a separate controller, edit the _config notecard and change the ID. Now, that controller will control only the signals with the same intersection ID. You can set multiple intersections to the same ID, and they'll be synced as well.
+
However, if you want to separately-controlled intersections, you'll have to set an intersection ID. Click each signal in the intersection and select Config, then select Intersection, then enter your ID. In a separate controller, edit the _config notecard and change the ID. Now, that controller will control only the signals with the same intersection ID. You can set multiple intersections to the same ID, and they'll be synced as well. Any alphanumeric string works (A-Z, 0-9) - ''do not'' use spaces or special characters.
  
 
Remember, intersection IDs are separate from signal IDs.
 
Remember, intersection IDs are separate from signal IDs.
  
All intersections using the same ID should be configured the same way. This means, if you have one intersection with just normal signals, you shouldn't use the same ID for an intersection with normal and left turn signals.
+
All intersections using the same ID should be configured the same way. This means, if you have one intersection with just normal signals, you shouldn't use the same ID for an intersection with normal and left turn signals. This will cause a timing problem.
  
 
==Custom Programming Sequence==
 
==Custom Programming Sequence==
You can now program your signals to whatever sequence you want. Just type in the sequence you want in the _program notecard in the controller and set Custom in the _config notecard to Yes.
+
Expert users - you can now program your signals to whatever sequence you want. Just type in the sequence you want in the _program notecard in the controller and set Custom in the _config notecard to Yes.
  
 
Programming is done using these commands:
 
Programming is done using these commands:
Line 93: Line 120:
 
  ANYINPUT [channel] [command]
 
  ANYINPUT [channel] [command]
  
Each commands needs to be on a separate line. The _program notecard that comes with the controller has an example which simulates the default settings in the _config notecard. Let's decode it:
+
And here's a list of what each of those variables is for:
 
+
* '''[signalID]''': the signal ID of the signal you want to set.
X-Normal RED
+
* '''[intersectionID]''': the intersection ID of the signal you want to set. This must be specified if the signal is in a different intersection from the intersection ID set in the _config notecard.
X-Left RED
+
* '''[color]''': the color of the signal. Acceptable values are RED, YELLOW, GREEN, REDYELLOW, REDFLASH, YELLOWFLASH, GREENFLASH, REDYELLOWFLASH, and OFF. These colors may do different things for specialized signals, so check the signal's color options by clicking the signal, clicking Override or Set Color, then playing with the color options. Remember to click it again and select Rtn Control when you're done.
Y-Normal RED
+
* '''[time]''': the time to wait in seconds. This can be an integer (1, 4, etc.) or a floating-point decimal (5.5, 0.84, etc.) although these times are approximate, and can vary due to lag.
Y-Left RED
+
* '''[channel]''': the channel to listen on. Can be any channel, positive or negative, or zero if you really want.
Set all signals to red.
+
* '''[command]''': the command to listen for. Can be any string but ''cannot include spaces'', so structure your commands around this limitation.
  
WAIT 1
+
Each command needs to be on a separate line. The _program notecard that comes with the controller has an example which simulates the default settings in the _config notecard. Let's decode it:
Wait 1 second.
 
  
 
  X-Normal GREEN
 
  X-Normal GREEN
Line 114: Line 140:
 
  X-Normal RED
 
  X-Normal RED
 
  WAIT 1
 
  WAIT 1
Set X-Normal to red and wait 1 second. (This is the ALLRED config setting.)
+
Set X-Normal to red and wait 1 second. (This is what the ALLRED config setting does for the default sequence.)
  
 
And so on, and so forth. Once the notecard reaches the end, it restarts from the beginning.
 
And so on, and so forth. Once the notecard reaches the end, it restarts from the beginning.
  
 
Here's an example of a program that would control an intersection ID with turn signals and an intersection ID without turn signals at the same time (IntTurn and IntNoTurn):
 
Here's an example of a program that would control an intersection ID with turn signals and an intersection ID without turn signals at the same time (IntTurn and IntNoTurn):
IntTurn X-Normal RED
 
IntTurn X-Left RED
 
IntTurn Y-Normal RED
 
IntTurn Y-Left RED
 
IntNoTurn X-Normal RED
 
IntNoTurn Y-Normal RED
 
WAIT 1
 
 
  IntTurn X-Left GREEN
 
  IntTurn X-Left GREEN
 
  IntNoTurn X-Normal GREEN
 
  IntNoTurn X-Normal GREEN
Line 153: Line 172:
 
  IntNoTurn Y-Normal YELLOW
 
  IntNoTurn Y-Normal YELLOW
 
  WAIT 3
 
  WAIT 3
In this case, IntNoTurn's normal signals are set to green while IntTurn's left turn sequence runs through. If you used the default sequence and just one intersection ID, the normal signals in intersections with no left turn signals would just remain red while the left turn sequence runs through. This program eliminates that extended red period, but you have to set two a different intersection ID for each type of intersection.
+
IntTurn Y-Normal RED
 +
IntNoTurn Y-Normal RED
 +
WAIT 1
 +
In this case, IntNoTurn's normal signals are set to green while IntTurn's left turn sequence runs through. If you used the default sequence and just one intersection ID, the normal signals in intersections with no left turn signals would just remain red while the left turn sequence runs through. This program eliminates that extended red period without the need for an extra controller, but you have to set a different intersection ID for each type of intersection.
  
Alternatively, you can use the INPUT command to wait for external commands:
+
''WARNING'': The above program will not work correctly with pedestrian signals. Pedestrian signals are timed based off of the first WAIT command after they are set to GREEN - so, for example:
 +
IntTurn X-Left GREEN
 +
IntNoTurn X-Normal GREEN
 +
WAIT 4
 +
IntTurn X-Left YELLOW
 +
WAIT 3
 +
IntTurn X-Left RED
 +
WAIT 1
 +
IntTurn X-Normal GREEN
 +
WAIT 8
 +
IntTurn X-Normal YELLOW
 +
IntNoTurn X-Normal YELLOW
 +
IntNoTurn's X-Normal pedestrian signal would get the time of 4 seconds, even though it should remain green until the end of the code snippet (a total of 16 seconds). However, IntTurn's X-Normal will get the time of 8 seconds, so it will work properly. Additionally, pedestrian signals require a time of at least 6 seconds for the countdown to show up, so this will cause them to remain in the WALK indication until they are given the YELLOW command. Keep this in mind when making programs!
 +
 
 +
You can use the INPUT command to wait for external commands:
 
  X-Normal RED
 
  X-Normal RED
 
  INPUT 1 go
 
  INPUT 1 go
Line 162: Line 198:
 
  X-Normal YELLOW
 
  X-Normal YELLOW
 
  WAIT 3
 
  WAIT 3
This program would wait for something owned by the owner of the signal controller to say "go" on channel 1, and then switch to green for a few seconds, then yellow, then back to red, and repeat.
+
Once it reaches the "INPUT 1 go" line, this program would wait for something owned by the owner of the signal controller to say "go" on channel 1, and then switch to green for a few seconds, then yellow, then back to red, and repeat. This could be adapted to make an actuated emergency signal - just flip the colors to GREEN, YELLOW, and RED instead, and lengthen the WAIT 4 command. You'll probably also want to change the input command to something different, and make a button or some other activation tool.
  
 
Note that the ANYINPUT is the same as INPUT, but allows objects owned by anyone (or any avatar) to issue the commands, not just objects owned by the same person (or the owner themselves).
 
Note that the ANYINPUT is the same as INPUT, but allows objects owned by anyone (or any avatar) to issue the commands, not just objects owned by the same person (or the owner themselves).
Line 175: Line 211:
 
  X-Normal GREEN
 
  X-Normal GREEN
 
  INPUT 500 reset
 
  INPUT 500 reset
This sequence accepts input on channel 500. When you're ready to begin, send "ready" and the signals turn on as red. To go, send "go" and the signals turn from yellow to green. To reset the signals, send "reset" and they turn off.
+
This sequence accepts input on channel 500. When you're ready to begin, send "ready" and the signals turn on as red. To go, send "go" and the signals turn from yellow to green. To reset the signals, send "reset" and they turn off. Note that commands are only acceptable when the controller has hit that INPUT line - so if we had another INPUT line later in the program, it wouldn't have any affect. For example, if we tried to send "go" while the controller was waiting for the "ready" command, nothing would happen - it wouldn't skip to the "go" input line. Keep this in mind when writing API's!
 +
 
 +
==Emergency Signal Program==
 +
Many customers have asked for an emergency signal, so here's a simple program sequence and accompanying LSL script to control it.
 +
 
 +
# Rez out a controller and a 3-Head Signal or 2-Head Signal (the normal one).
 +
# Edit the controller's _config notecard to change the '''Custom''' setting to '''Yes'''.
 +
# Additionally, edit the controller's _config notecard to change the '''ID''' (Intersection ID) to '''EmergencyIntersection''' or something unique. Save it.
 +
# Edit the controller's _program notecard and replace the program with the contents of the textbox below. Save it.
 +
# Click the signal and change its signal ID to '''EmergencySignal''' (Config -> Sig Custom).
 +
# Click the signal and change its intersection ID to '''EmergencyIntersection''' or whatever you used in step 3 (Config -> Intersection).
 +
# Create a prim and create a new script in it. Copy the contents of the LSL script (second textbox below) into the new script and save it.
 +
 
 +
EmergencySignal GREEN
 +
INPUT 911 signalON
 +
EmergencySignal YELLOW
 +
WAIT 3
 +
EmergencySignal RED
 +
INPUT 911 signalOFF
 +
 
 +
And here is an LSL script, just put it in a prim and set the prim's texture to whatever you like:
 +
// ACCESS SETTING
 +
// Use "Owner", "Group", or "Everyone"
 +
string access="Group";
 +
// DO NOT EDIT ANYTHING BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING
 +
integer active=FALSE;
 +
default
 +
{
 +
    touch_start(integer total_number)
 +
    {
 +
        if (llToUpper(access)=="EVERYONE"||(llToUpper(access)=="GROUP"&&llSameGroup(llDetectedKey(0)))||llGetOwner()==llDetectedKey(0))
 +
        {
 +
            if (!active)
 +
            {
 +
                llRegionSay(911,"signalON");
 +
                llSetColor(<1,0,0>,ALL_SIDES);
 +
                active=TRUE;
 +
            }
 +
            else
 +
            {
 +
                llRegionSay(911,"signalOFF");
 +
                llSetColor(<0,1,0>,ALL_SIDES);
 +
                active=FALSE;
 +
            }
 +
        }
 +
    }
 +
}
 +
 
 +
This LSL script works similarly to the emergency signal controller in the old Tredpro signals; if you want to allow everyone to access it, or you only want yourself to have access, change the access variable at the top of the script.
 +
 
 +
==CiteLite LSL API==
 +
You can control your CityLites manually without a controller as well, although this is only recommended in situations where a controller program would be unsuitable. All CityLites are controlled using the following command:
 +
llRegionSay(-9834922,llDumpList2String([intersectionID,signalID,color,time],"#$"));
 +
This is similar to controller programming, with the exception of the '''time''' variable. This is only used by the pedestrian signal (all other signals will ignore it). Time is used as follows:
 +
* When time > 12, the signal will split the time between WALK and flashing WAIT, then go to WAIT.
 +
* When 12 > time > 5, the pedestrian signal will allow for (time - 5) seconds for the WALK indication, then 5 seconds of flashing WAIT, then WAIT.
 +
* When time < 5, the pedestrian signal will show a WALK indication, and must be set to WAIT manually.
 +
So, for example:
 +
llRegionSay(-9834922,llDumpList2String(["Default","X-Normal","GREEN","10"],"#$"));
 +
Keep in mind, this command will only work if the signal is not in override mode.
  
Feel free to experiment with programming! We're excited to see what our customers come up with on this.
+
{{Gentek}}

Latest revision as of 00:54, 2 March 2014

CityLite
VendorImage5 - CityLite Traffic Signals.jpg

CityLite vendor image.
Creator Nelson Jenkins
Launch year 2006
Company Gentek
Availability Marketplace & In-World
Marketplace Listing

The CityLite is a programmable traffic signal system originally designed in 2006, updated up until 2009, and then re-released in mesh in July 2012.

The latest version of the CityLite is v4.1 - if you have an older version, please rez the Update Box. The latest update includes the following:

  • GREENFLASH and REDYELLOWFLASH commands added on local signal override
  • REDFLASH, YELLOWFLASH, GREENFLASH, and REDYELLOWFLASH commands added on controller (manual override and custom programming)
  • Flashing animation fixed so it is visible from long distance
  • Fixed pedestrian signal countdown getting stuck if OFF command sent
  • All signals now modify for linking
  • All signals sized slightly smaller
  • API released
  • IntelliLight compatibility added (for future use)

Basic Setup - VIDEO TUTORIAL

  1. Choose which signal you want which is labeled *BASIC*.
  2. Right click any object in-world and select Edit. This should open your Edit window.
  3. Rez the intersection or signal by dragging it out of your inventory onto the ground.
  4. If you're using a multi-signal intersection, position the set of signals so they are centered on the middle of the intersection.
  5. If you've rezzed a 3-way signal/intersection, rotate it so that all directions are signaled. With the intersection, the alignment prim will show directions of traffic flow - make sure that the set of signals is rotated properly.
  6. Move each individual signal/pole so it's on the corner of the sidewalk, if necessary.
  7. If you're using a multi-signal intersection, delete the alignment prim with the text and arrows.
  8. Rez a controller. It will automatically start up after a few seconds. You're done!
  9. Repeat steps 1-7 for other intersections in the same region. Do not rez more than one controller per region for basic signals.

Advanced Setup - VIDEO TUTORIAL

STOP! STOP! STOP! The following signals will work out of the box:

  • 3-Head Signal
  • 2-Head Signal
  • 3-Head Left Turn Signal
  • 2-Head Left Turn Signal

ALL OTHER SIGNALS WILL NOT WORK WITHOUT CONFIGURATION. You MUST set the signals' ID to either "X-Normal", "Y-Normal", "X-Left", or "Y-Left" to work with the controller without a custom program. It is highly recommended to learn how to use the custom programming function if you intend to use any nonstandard signals.

  1. Rez poles.
  2. Rez signals and set their signal IDs. Click each signal, select Config, and set a signal ID. Do not use signals marked with *BASIC*.
    1. X-Normal and Y-Normal are normal "ball" signals. X and Y are different roads; X is usually the main road, and Y is the crossroad. These are only shown for normal signals.
    2. X-Left and Y-Left are protected left turn signals. These are only shown for Left Turn signals, which are optional and require a change in the _config notecard (see XLEFT and YLEFT).
    3. Custom allows you to set a custom signal ID. This is only used for custom-programmed controllers. Any alphanumeric string works (A-Z, 0-9) - do not use spaces or special characters. If you are not using a custom program, you MUST set the signals' ID to either "X-Normal", "Y-Normal", "X-Left", or "Y-Left" for them to work.
  3. If you want, rez pedestrian signals and set their signal IDs.
    1. X-Normal and Y-Normal are the two default options, they are the same as the traffic signals. Custom can also be used.
  4. If you don't want all signals in the region synchronized, or you have different intersection configurations (some have left turn signals, some don't, etc.) you will need to set each signal's intersection. Click it, select Config, select Intersection, and type an intersection ID in. Any alphanumeric string works (A-Z, 0-9) - do not use spaces or special characters. You need to do this for every signal in the intersection.
  5. Rez a controller for each intersection ID (if you didn't set any, just rez one controller - this will control all signals in the region). Do not rez multiple controllers if you haven't changed the intersection IDs!
  6. Edit the _config notecard in the controller. Each setting has a comment with instructions, and should be self-explanatory.
  7. The signals should start up once the notecard is finished loading.

Signal Types

Signal Guide (for advanced users only)
  • Protected left turn signals are not enabled by default - they'll just remain off. If you have an X-Left signal, you'll need to set XLEFT to something greater than 0 (preferably around 4-8) in the controller's _config notecard - similarly, if you have a Y-Left signal, you'll need to set YLEFT to something greater than 0. This only works with the default sequence; these settings are ignored if you're using a custom programming sequence.
  • Signals other than the 3-Head and 2-Head Normal and Left Turn signals all use the signal ID "DefaultSig" and must be configured manually.

Customization

You can change the housing colors on any signals by clicking them, selecting Config, then selecting HousingColor. You can then choose from the following color combinations:

  • Black: black.
  • Green: dark green.
  • Yellow: yellow.
  • YlwBlack: yellow housing with a black surround plate. Not shown on pedestrian signals, and only useful if surround is shown.
  • BlackWht: black housing with a white edge on the surround plate (European style). Not shown on pedestrian signals, and only useful if surround is shown.
  • BlackFlr: black housing with a fluorescent yellow edge on the surround plate for high visibility (only use this in poor-visibility areas). Not shown on pedestrian signals, and only useful if surround is shown.

You can customize 1-Way signals by clicking them, selecting Config, and using Tgl Surround or Tgl Mount. These will toggle the surround plate and the hanging mount, respectively.

You can customize pedestrian signals by clicking them, selecting Config, and using Tgl Grille or Chg Mount. These will toggle the grille and change/remove the mount, respectively.

The 5 poles included with the kit are modifiable, so they can be recolored and stretched (within reason) to your liking.

Access Settings & Manual/Override Controls

The access settings in the _config notecard (ACCESS, WHITELIST, and BLACKLIST) are used to access the controller's manual intersection controls AND the signals' override controls for the same intersection. However, signals must have a controller with their intersection (the same intersection ID) for access settings to work, otherwise only the owner will have access. For example, if you had one controller controlling multiple intersections through the use of a custom program sequence, only the intersection that has the same ID as the controller would use those access settings.

Anyone that has access can do the following:

  • Controller Manual Controls (click the controller)
    • Automatic: Returns control to the automatic sequence (if in manual mode).
    • Manual: Disengages the automatic sequence and lets the user control lights manually. Also opens the Set Colors menu.
    • Set Colors
      • All Off: All signals turn off, including custom signals referenced in the custom program sequence (if used).
      • Sig X-Normal, Sig Y-Normal, Sig X-Left, Sig Y-Left: Lets you change the color for all signals with that ID.
      • Sig Custom: Lets you change the color for all signals with specified custom ID.
      • Reset: Resets the controller.
  • Signal Override Controls (click an individual signal)
    • Rtn Control: Returns control to the controller (if in override mode).
    • Override: Ignores the controller and lets the user control the light manually. Also opens the Set Color menu.
    • Set Color: Lets you change the color for that signal only.

NOTE: If you use the signal override controls, make sure you choose Rtn Control when you're done so the controller can access them - otherwise, you'll complain to me that they don't work, and I'll hate you.

There is also a Config menu option in the signal menu, but this is only shown to the owner.

Intersections

CityLite works through the use of intersection IDs. Most users want to keep things simple, so in this case, just don't change intersection IDs anywhere (signals or controller) and everything will be synced together.

However, if you want to separately-controlled intersections, you'll have to set an intersection ID. Click each signal in the intersection and select Config, then select Intersection, then enter your ID. In a separate controller, edit the _config notecard and change the ID. Now, that controller will control only the signals with the same intersection ID. You can set multiple intersections to the same ID, and they'll be synced as well. Any alphanumeric string works (A-Z, 0-9) - do not use spaces or special characters.

Remember, intersection IDs are separate from signal IDs.

All intersections using the same ID should be configured the same way. This means, if you have one intersection with just normal signals, you shouldn't use the same ID for an intersection with normal and left turn signals. This will cause a timing problem.

Custom Programming Sequence

Expert users - you can now program your signals to whatever sequence you want. Just type in the sequence you want in the _program notecard in the controller and set Custom in the _config notecard to Yes.

Programming is done using these commands:

[signalID] [color]
[intersectionID] [signalID] [color]
WAIT [time]
INPUT [channel] [command]
ANYINPUT [channel] [command]

And here's a list of what each of those variables is for:

  • [signalID]: the signal ID of the signal you want to set.
  • [intersectionID]: the intersection ID of the signal you want to set. This must be specified if the signal is in a different intersection from the intersection ID set in the _config notecard.
  • [color]: the color of the signal. Acceptable values are RED, YELLOW, GREEN, REDYELLOW, REDFLASH, YELLOWFLASH, GREENFLASH, REDYELLOWFLASH, and OFF. These colors may do different things for specialized signals, so check the signal's color options by clicking the signal, clicking Override or Set Color, then playing with the color options. Remember to click it again and select Rtn Control when you're done.
  • [time]: the time to wait in seconds. This can be an integer (1, 4, etc.) or a floating-point decimal (5.5, 0.84, etc.) although these times are approximate, and can vary due to lag.
  • [channel]: the channel to listen on. Can be any channel, positive or negative, or zero if you really want.
  • [command]: the command to listen for. Can be any string but cannot include spaces, so structure your commands around this limitation.

Each command needs to be on a separate line. The _program notecard that comes with the controller has an example which simulates the default settings in the _config notecard. Let's decode it:

X-Normal GREEN
WAIT 10

Set X-Normal to green and wait 10 seconds. All other signals will remain red.

X-Normal YELLOW
WAIT 3

Set X-Normal to yellow and wait 3 seconds.

X-Normal RED
WAIT 1

Set X-Normal to red and wait 1 second. (This is what the ALLRED config setting does for the default sequence.)

And so on, and so forth. Once the notecard reaches the end, it restarts from the beginning.

Here's an example of a program that would control an intersection ID with turn signals and an intersection ID without turn signals at the same time (IntTurn and IntNoTurn):

IntTurn X-Left GREEN
IntNoTurn X-Normal GREEN
WAIT 4
IntTurn X-Left YELLOW
WAIT 3
IntTurn X-Left RED
WAIT 1
IntTurn X-Normal GREEN
WAIT 8
IntTurn X-Normal YELLOW
IntNoTurn X-Normal YELLOW
WAIT 3
IntTurn X-Normal RED
IntNoTurn X-Normal RED
WAIT 1
IntTurn Y-Left GREEN
IntNoTurn Y-Normal GREEN
WAIT 4
IntTurn Y-Left YELLOW
WAIT 3
IntTurn Y-Left RED
WAIT 1
IntTurn Y-Normal GREEN
WAIT 8
IntTurn Y-Normal YELLOW
IntNoTurn Y-Normal YELLOW
WAIT 3
IntTurn Y-Normal RED
IntNoTurn Y-Normal RED
WAIT 1

In this case, IntNoTurn's normal signals are set to green while IntTurn's left turn sequence runs through. If you used the default sequence and just one intersection ID, the normal signals in intersections with no left turn signals would just remain red while the left turn sequence runs through. This program eliminates that extended red period without the need for an extra controller, but you have to set a different intersection ID for each type of intersection.

WARNING: The above program will not work correctly with pedestrian signals. Pedestrian signals are timed based off of the first WAIT command after they are set to GREEN - so, for example:

IntTurn X-Left GREEN
IntNoTurn X-Normal GREEN
WAIT 4
IntTurn X-Left YELLOW
WAIT 3
IntTurn X-Left RED
WAIT 1
IntTurn X-Normal GREEN
WAIT 8
IntTurn X-Normal YELLOW
IntNoTurn X-Normal YELLOW

IntNoTurn's X-Normal pedestrian signal would get the time of 4 seconds, even though it should remain green until the end of the code snippet (a total of 16 seconds). However, IntTurn's X-Normal will get the time of 8 seconds, so it will work properly. Additionally, pedestrian signals require a time of at least 6 seconds for the countdown to show up, so this will cause them to remain in the WALK indication until they are given the YELLOW command. Keep this in mind when making programs!

You can use the INPUT command to wait for external commands:

X-Normal RED
INPUT 1 go
X-Normal GREEN
WAIT 4
X-Normal YELLOW
WAIT 3

Once it reaches the "INPUT 1 go" line, this program would wait for something owned by the owner of the signal controller to say "go" on channel 1, and then switch to green for a few seconds, then yellow, then back to red, and repeat. This could be adapted to make an actuated emergency signal - just flip the colors to GREEN, YELLOW, and RED instead, and lengthen the WAIT 4 command. You'll probably also want to change the input command to something different, and make a button or some other activation tool.

Note that the ANYINPUT is the same as INPUT, but allows objects owned by anyone (or any avatar) to issue the commands, not just objects owned by the same person (or the owner themselves).

Here's one that demonstrates the use of multiple INPUT commands in the same program - a simple starting signal for a racetrack:

X-Normal OFF
INPUT 500 ready
X-Normal RED
INPUT 500 go
X-Normal YELLOW
WAIT 1
X-Normal GREEN
INPUT 500 reset

This sequence accepts input on channel 500. When you're ready to begin, send "ready" and the signals turn on as red. To go, send "go" and the signals turn from yellow to green. To reset the signals, send "reset" and they turn off. Note that commands are only acceptable when the controller has hit that INPUT line - so if we had another INPUT line later in the program, it wouldn't have any affect. For example, if we tried to send "go" while the controller was waiting for the "ready" command, nothing would happen - it wouldn't skip to the "go" input line. Keep this in mind when writing API's!

Emergency Signal Program

Many customers have asked for an emergency signal, so here's a simple program sequence and accompanying LSL script to control it.

  1. Rez out a controller and a 3-Head Signal or 2-Head Signal (the normal one).
  2. Edit the controller's _config notecard to change the Custom setting to Yes.
  3. Additionally, edit the controller's _config notecard to change the ID (Intersection ID) to EmergencyIntersection or something unique. Save it.
  4. Edit the controller's _program notecard and replace the program with the contents of the textbox below. Save it.
  5. Click the signal and change its signal ID to EmergencySignal (Config -> Sig Custom).
  6. Click the signal and change its intersection ID to EmergencyIntersection or whatever you used in step 3 (Config -> Intersection).
  7. Create a prim and create a new script in it. Copy the contents of the LSL script (second textbox below) into the new script and save it.
EmergencySignal GREEN
INPUT 911 signalON
EmergencySignal YELLOW
WAIT 3
EmergencySignal RED
INPUT 911 signalOFF

And here is an LSL script, just put it in a prim and set the prim's texture to whatever you like:

// ACCESS SETTING
// Use "Owner", "Group", or "Everyone"
string access="Group";
// DO NOT EDIT ANYTHING BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING
integer active=FALSE;
default
{
    touch_start(integer total_number)
    {
        if (llToUpper(access)=="EVERYONE"||(llToUpper(access)=="GROUP"&&llSameGroup(llDetectedKey(0)))||llGetOwner()==llDetectedKey(0))
        {
            if (!active)
            {
                llRegionSay(911,"signalON");
                llSetColor(<1,0,0>,ALL_SIDES);
                active=TRUE;
            }
            else
            {
                llRegionSay(911,"signalOFF");
                llSetColor(<0,1,0>,ALL_SIDES);
                active=FALSE;
            }
        }
    }
}

This LSL script works similarly to the emergency signal controller in the old Tredpro signals; if you want to allow everyone to access it, or you only want yourself to have access, change the access variable at the top of the script.

CiteLite LSL API

You can control your CityLites manually without a controller as well, although this is only recommended in situations where a controller program would be unsuitable. All CityLites are controlled using the following command:

llRegionSay(-9834922,llDumpList2String([intersectionID,signalID,color,time],"#$"));

This is similar to controller programming, with the exception of the time variable. This is only used by the pedestrian signal (all other signals will ignore it). Time is used as follows:

  • When time > 12, the signal will split the time between WALK and flashing WAIT, then go to WAIT.
  • When 12 > time > 5, the pedestrian signal will allow for (time - 5) seconds for the WALK indication, then 5 seconds of flashing WAIT, then WAIT.
  • When time < 5, the pedestrian signal will show a WALK indication, and must be set to WAIT manually.

So, for example:

llRegionSay(-9834922,llDumpList2String(["Default","X-Normal","GREEN","10"],"#$"));

Keep in mind, this command will only work if the signal is not in override mode.