Script Library for Morse Code and Marine Buoy light flashes for use by scripters.
If you are building an asset requiring coded lighting flashes, (eg- Airport Morse Beacon or Marine Navigation Buoy), this library will flash that code to the light in your asset.
Your forwarding asset script must send the correct asset and corona info to this library. See below.
Forwarding object should send 4 string types and 2 object types.
LibStrings[0] = The name of the corona lighting effect in your config file.
LibStrings[1] = Letter(s) or number(s) you want to see flashing, separated by a comma if more than one.
LibStrings[2] = A string saying 'On' or 'Off' only!
LibStrings[3] = A float number as a string specifing the duration in seconds of required 'dot' length.
Objects[0] = Your asset.
Objects[1] = The name of the corona texture 'Asset' you are using and have declared in your script.
Codelib.LibraryCall = Flashlib is the name of the Library variable you need to declare in your script to point to THIS asset. You may designate any name here.
('Flasher', LibStrings, Objects) = 'Flasher' is the function call in THIS asset. This name cannot be changed.
(Note - All the inverted commas in the example below should in fact be double commas!)
Individual letters or numbers entered in LibStrings[1] will encode to Morse Code. Each character should be sent as a separate element, separated by a comma.
In addition, special multi-character codes exist for Marine Buoys.
Sending LibStrings[1] = 'NC'; (or 'SC' or 'EC' or 'WC') will provide correct flashing for N,S,E & W Cardinal Buoys.
Sending the letters, 'GPFL' as the first element, followed by a number for the next and subsequent elements will produce Group Flashes.
eg - LibStrings[1] = 'GPFL,1,2'; will produce 1 flash followed by 2 flashes, (repeated).
Sending the letters, 'OC' as the first element will produce occulting flashes. ie - light is on and 'flashes' are dark.
Sending LibStrings[1] = 'OC,2'; will produce occulting morse code for the number 2.
Sending LibStrings[1] = 'OC,GPFL,1,2'; will produce occulting 1+2 flashes.
Note that sending any multi-character elements other than those above or any characters other than plain letters or numbers, will result in an unrecognised character Exception.
The MAXIMUM number off your assets this Library will accept is 59. After that you will have to clone this asset.