Space Engineers

Space Engineers

67 ratings
Corsairs Dream LED Controller Script
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
10.508 KB
2 Jun, 2017 @ 11:45pm
3 Jun, 2017 @ 5:46pm
6 Change Notes ( view )

Subscribe to download
Corsairs Dream LED Controller Script

Description
To my fellow PCMR, I present to you the Corsairs Dream: A fully customization led controller that is easy to setup, incredibly flexible,
extremely light weight, and works in RGB!

Lights can be interior lights, corner lights, or double corner lights. This works both on small and large ships.

Setup:
1. Place a programming block and a timer.
2. Put this script into the programming block.
3. Setup the timer to run this script every tick (trigger now-> programming block-> start)
4. Group all you lights together, name it whatever you want, and add the tag [LED: ***].
5. Refer to bellow modes for ***. Remember to run the"rescan"argument every time you change a tag.

Tag format:

A LEd tag is composed of two parts. The first part specifies the animation mode and the second part is a list of optional settings, all of which could be found bellow.

Tag format: [LED: Mode option1:value2 option2:value2 option3:value3]
Example tag: [LED: Noise spd:0.6 scale:0.15]

Each part of the tag is separated by a space, and the option names and desired values are separated by a ':'. Invalid options will be ignored. Some options may not require a value.

Modes and options:

Noise:

The most basic animation, this creates a random pulsating sea of colors with your LEDs.

Noise options:
spd: The animation speed of the noise.
scale: The scale of the animation. Smaller values make the blobs bigger.

Pulse:


The most usefull animation, the pulse animation is waves that travel through 3D space and your ship. LEDs that that waves hit are lit up, creating wave patterns on the ship.

Pulse options:
spd: The speed the waves travel at, in m/s.
r: The color of the waves. (Red component)
g: The color of the waves. (Green component)
b: The color of the waves. (Blue component)
dirX: The x component of the vector the waves travel in the direction of.
dirY: The y component of the vector the waves travel in the direction of.
dirZ: The z component of the vector the waves travel in the direction of.
space: The spacing between each wave, in blocks small and large.
width: The width of each wave in blocks.
falloff: The falloff of the waves. 1 or above creates soft pulses while 0 to 1 creates sharp waves.
noise: Whether to map color to random colors or not. This option does not require a value! Putting it in by itself is sufficient.
noisescale: If you're using noise, this is the scale of the noise.
noisespd: If you're using noise, this is the speed the noise will be animated at independent of the wave speed.

Ripple:

Like a ripple in a pond, a spherical waves are created from a specified point in your ship. LEDs that that waves hit are lit up, creating ripple patterns on the ship.

Ripple options:
spd: The speed the waves travel at, in m/s.
x: The x coordinate of the block the wave is emitted from.
y: The y coordinate of the block the wave is emitted from.
z: The z coordinate of the block the wave is emitted from.
r: The color of the waves. (Red component)
g: The color of the waves. (Green component)
b: The color of the waves. (Blue component)
space: The spacing between each wave, in blocks small and large.
width: The width of each wave in blocks.
falloff: The falloff of the waves. 1 or above creates soft pulses while 0 to 1 creates sharp waves.

Sweep:


Useful for spinning lights, this works very similarly to a lighthouse. An axis of rotation and center point is specified. Spinning walls mounted on that axis will hit LEDs that light up to create sweeping patterns.

Sweep options:
spd: The speed the waves travel at, in m/s.
waves: The number of waves in this animation.
r: The color of the waves. (Red component)
g: The color of the waves. (Green component)
b: The color of the waves. (Blue component)
x: The x coordinate of the center of the sweep.
y: The y coordinate of the center of the sweep.
z: The z coordinate of the center of the sweep.
dirX: The x component of the axis of rotation.
dirY: The y component of the axis of rotation.
dirZ: The z component of the axis of rotation.
falloff: The falloff of the waves. 1 or above creates soft pulses while 0 to 1 creates sharp waves.
ratio: The ratio of wave to actualy space. For example, if you have four waves, the circle will be first broken up into four. Each wave gets 90 degrees. From there on, it is multiplied by this ratio, which is 0.2 by default. The actuall waves would only take up arc of lengths 90*0.2 = 18 degrees. The rest will be space.

Rand (Random):

The most basic of all animations, the random animation is basically your Christmas tree.

Random options:
period: How many seconds does it take for the lights to rearrange?
cutoff: For each light, this is the probability from 0~1 that the light will be turned on.

Still can't find something? Tell me in the comments or try to code a LEDGroup class yourself. My code should be pretty self explanatory. As me anything on the comments if you need help.

TODO: Make input idiot proof. Redo the horrible regex.
48 Comments
Guesn 25 Feb, 2022 @ 1:22am 
@Jerry If you read, can you just add an autorun in the script ?
Alturvexs 25 Jan, 2022 @ 8:00pm 
I subscribed but this is not showing up in the workshop in-game window. Can't use the script... NOT found.
Cpt.Friendly 26 Nov, 2021 @ 1:16pm 
Timerblock set to trigger its self, and programming block can only be set to Run and Run (have tryd to put the trigger now in argument) and run whit defult argument, i have grouped the LED's and named the group: Base Lights [LED: Noise spd:0.6 scale:0.15] nothing happends...
Cpt.Friendly 26 Nov, 2021 @ 1:08pm 
i dont get it. is this outdated?
Cpt.Friendly 25 Nov, 2021 @ 6:09pm 
I did make the light work but its now changing color ist just stuck at RGB colors no Noise or what its called
Stavinair Caeruleum 24 Oct, 2021 @ 6:02pm 
Also how do I find the coordinate of a block?
Stavinair Caeruleum 23 Oct, 2021 @ 11:24pm 
Stavinair Caeruleum 23 Oct, 2021 @ 9:06pm 
anybody got any decent presets?
Stavinair Caeruleum 18 Oct, 2021 @ 8:40am 
It works just fine, you just need to make the timer block also trigger itself.
QUICKSHIFT13 30 Sep, 2021 @ 5:49pm 
Doesn't work