LightController

LED Hook Game


ALED Strip Light Controller Game File or Default File Info:


The game file or default file, tells the Hook Light Engine what output signals too watch out for. Then tied to the output signal, is light controller number(s), with strip number(s), and a command with it’s arguments. There can be multiple light controllers used, but they have to be on their own line. Like the Light Gun DefaultLG game file, that uses output signal, player, and command. The light controller game file uses output signal, light controller and group(s), and command. In the file, empty lines can be anywhere. Also, if the line doesn’t start with ‘:’, ‘!’, or ‘>’, it is ignored. So a user can put notes into the file, as long as the line doesn’t start with the 3 characters. The game file and default file is a simple text file (.txt). Just make sure that the 3 characters are at the front of the line, or they will not work.

When a game is started in HOTR, the Hook Light will first check if there are any light controllers. If there are no light controllers, it does nothing. If there is a light controller, then Hook Light will look for the game file in the ‘lightFiles’ directory. If it cannot find the game file, then it will look for a default file (default.txt) in the same directory. If there is no default file, then it will do nothing.

The ALED Strip display commands are all done on the micro-controller. When a display commands of Flash, Random Flash, and Sequential is running on a strip, a new display commands are ignored. The only exception is this is the Flash display commands, which has a wait option. The wait option puts the command into a command buffer. So when the display command on the strip finishes, then the buffer command runs. The Display Range command is different, as it runs in the background, and the other display commands can run on top of it. Where the Display Range command can be used to display ammo value. Then if the player gets damaged, a red flash can happen, and when finished, goes back to the Display Range.

There are 3 things that the file needs for a command. The first is the output signal, which can be tied to light controller(s) & strip(s), and a command. Or it can be just an output signal. Empty output signals can be used, but discourage in the file. The second thing needed is the light controller and strip(s). There can be multiple non-matching light controllers used. Non-matching means that you cannot re-use the light controller in a different light controller line, attached to an output signal. So, you cannot use light controller !0, two times on 2 different lines after the output signal. The last thing needed is the command that will be executed, when the output signals data meets the requirement. Each command will have it’s own arguments and requirements. These will be detailed later in this file.

Output signals have a ‘:’ in front of them, and need to be at the front of the line. See an example below.

:P1_CtmRecoil

The output signal's value can be inverted. This is done by putting a '~' right after the output signal's name, with no space. Then, if the value is 0, it will be changed to a 1. If the value is 1 or more, then it will be a 0. Please see below to see an example of this inversion.

:P1_LmpStart~

Light Controller and strips have a ‘!’ in front of them, and need to be at the front of the line. See an example below. The first light controller entered is light controller 0. You can see there number by opening the ‘Edit Light Controller’ window. In the combo box, it will have a list of the light controllers, starting with their number. That number is used right after the ‘!’ symbol. Then after the light controller’s number, has to be at least 1 strip number. Multiple strips can be used and need to be separated by a space. See an example below, where light controller 0 is used, with strips 0, 2, and 3.

!0 0 2 3

The controller number is next to the ‘!’ symbol. Then the number(s) after are the strip(s). There must be a strip number, or the file will error out. Multiple controllers can be used, but need to be on their own line. See an example below.

!0 0 2 3
!1 2 3
!4 0 2 3

Commands have a ‘>’ in front of them, and need to be at the front of the line. There are 7 commands for the ALED Strip controller.

If there are different commands needed for an output, because of multiple light controllers. Then after the first command, the new command’s light controllers and groups/strips are put into their on lines. Then followed after is the new command. Below is an example of using Ultimarc device command, with an ALED Strip command after it, using the same output signal.

:P1_Damaged
!0 0
!1 2
>Flash_RGB red 50 40 1
!2 0
!3 1
>Flash_ALED_Strip 150 100 1 red 1

As you can see, it is simple to use different light controllers, and their commands, with an output signal. The hard part is keeping track of the controllers and the groups/strips. It is good to pt in notes in the files, to keep things organized.



Commands:


Flash Commands:


Flash_ALED_Strip (Time On) (Time Off) (Number of Flashes) (Color) (Wait)

Flashes the color for all the strip(s), when the output signal data is not equal to 0. If Wait is a ‘1’, then if a command is already running, the Flash command will be put into a buffer.

example: >Flash_ALED_Strip 150 100 1 red 1


Reload_Flash_ALED_Strip (Time On) (Time Off) (Number of Flashes) (Color) (Player Number) (Wait)

Flashes the color for all the strip(s), when the player’s reload happens. Output signal needs to be player’s ammo value.

example: >Reload_Flash_ALED_Strip 80 80 1 green 1 0


Death_Flash_ALED_Strip (Time On) (Time Off) (Number of Flashes) (Color) (Player Number) (Wait)

Flashes the color for all the strip(s), when the player’s death happens. Output signal needs to be player’s life value.

example: >Death_Flash_ALED_Strip 150 50 5 red 1 1



Random Flash Commands:


Random_Flash_ALED_Strip (Number of LEDs) (Time On) (Time Off) (Number of Flashes) (Color) (Enable 2nd Color) (Probability) (2nd Color)

Randomly flashes number of LEDs with color, on the strip(s). Each strip will have its own random LEDs. A 2nd color can be enabled, with the probabilities of 1/2 to 1/12, by entering 2 to 12. If the probability happens, and is enabled, then the 2nd color will flash. This executes when the output signal’s value is not equal to 0.

example: >Random_Flash_ALED_Strip 5 120 50 1 purple 0
example: >Random_Flash_ALED_Strip 5 120 50 1 purple 1 5 green



Sequence Commands:


Sequence_ALED_Strip (Time Delay) (Number of LEDs per Delay) (Color)

Light up the first LED(s) of the strip, and then delays. Then it will light up the next LED(s) and delay, and loop this until all the LEDs are on. This executes when the output signal’s value is not equal to 0.

example: >Sequence_ALED_Strip 500 2 green

Reload_Sequence_ALED_Strip (Time Delay) (Number of LEDs per Delay) (Color) (Player Number)

Light up the first LED(s) of the strip, and then delays. Then it will light up the next LED(s) and delay, and loop this until all the LEDs are on. This executes when the player’s reload happens. Output signal needs to be player’s ammo value.

example: >Reload_Sequence_ALED_Strip 600 1 blue 1



Display Range Commands:


Display_Range_ALED_Strip (Max Range) (Number of Steps) (Time Off) (Color Map) (Enable Seq Reload) (Time Delay) (Number of LEDs per Delay)

Display Range is used to display information to the player. Also, commands can run on top of the Display Range, like the Background command. The time off from the Display Range command, is the time that the lights are off, before a new command starts. Giving a break between the Display Range and the new command. Since there can be multiple steps, a Color Map is needed, even if 1 step with 1 color is used. A Color Map with 1 color can be created in the ALED Group file. If the output signals value is greater than the last value, then a reload will happen, if it is enabled. If the reload is enabled, then it needs the time delay, and the number of LEDs to turn on, inbetween the delays.

example: >Display_Range_ALED_Strip 30 3 200 DisplayRangeP1 0
example: >Display_Range_ALED_Strip 30 3 200 DisplayRangeP1 1 500 1



Arguments:

Color: Defined RGB Color in the Group File
2nd Color: Defined RGB Color in the Group File
Color Map: Defined Color Map in the Group File

Time On: 1ms - 9,999ms (0.001s - 9.999s)
Time Off: 1ms - 9,999ms (0.001s - 9.999s)
Time Delay: 1us - 9,999us (0.000001s - 0.009999s) **** In us and not ms

Number of Flashes: 1 - 9

Wait: 0 or 1 - Enables or Disables the Flash Command Buffering

Player Number: 1 – 4

Number of LEDs: 1 - 10 Number of LEDs to Light Up During Random Flash

Enable 2nd Color: 0 or 1 - Enables or Disables the 2nd Color on the Random Flash
Probability: 2 - 12 Where 2 is 1/2 (50%), 3 is 1/3 (33%), 4 is 1/4 (25%) ... 12 is 1/12 (8.33%)

Number of LEDs per Delay: 1, 2, 4, 8 Number of LEDs to Turn on In Between Delays

Max Range: 1 - 9,999 The Maxium Number that is Being Displayed. For Example, for HOTD4, I Used 30

Number of Steps: 1 - 9 The Number of Color Steps for the Display Range

Enable Seq Reload: 0 or 1 Enables or Disables Sequential Reload for Display Range