Space Engineers

Space Engineers

64 ratings
Vehicle Light Control (Script)
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
32.360 KB
13 Jun, 2017 @ 12:59am
24 Nov, 2019 @ 1:44am
7 Change Notes ( view )

Subscribe to download
Vehicle Light Control (Script)

Description
This is a script for controling turn and tail/brake light. These on/off automatically to your A, D, Space key input.

How to Setup?

-Note: The script setup method has changed.
Please delete all the custom data of the light, and re-enter the setting.
In the case of turn light, please write "turn".
With the cockpit facing the front of the Vehicle.(If cocpit is mounted on subgrid, like mouse-aimed rotor turret)
And write "Setup" in Argument and press Run once.
("right" or "left" are not necessary. script will automatically determine it)

Block Required
- any Spotlight or Interior Light, set Custom Data like an top image
- Cockpit block, Write Cockpit in custom data.
- 1 Programable block, put in this script, and compile it.
(Timer block is no longer needed, Please remove it if already set up.)

Press timer "Start" button. And see Programable block. If it displayed **System Failure**, block are missing or content of custom data is wrong.

-(Additional) Text panel support added. We can use those like as a light block. Place it to vehicle, and write "front" "rear" etc in the CustomData.

-(Additional) Reverse light added. Place sound block and light block or text panel to vehicle, and write "reverse" in the CustomData to use it.

(Additional)Customizable LCD
Script can now handle multiple light on a single LCD!

Setup
Place LCD and write Custom in Custom Data, and wait 10 second.
Script automatically describes the setting variables like this:
[Vehicle Light Control] Tag=Custom SurfaceSizeList={X:512 Y:512}, SpriteRecipe=
Tag and SurfaceSizeList is not a variable. SurfaceSizeList is the size of the LCD screen.
*Note: This number doesn't seem to be accurate. For example, Small Corner LCD Flat Top says 512*512, but it is actually 512*(about)160.
SpriteRecipe is the setting for what to display on the LCD screen, You need to write settings here.
Enclose a single sprite setting in {}.
Write ; between the variables
If you want to start a new line, write | at the beginning of the line.

Example:
Rear light complex(right side) for Small Corner LCD Flat Top
[Vehicle Light Control] Tag=Custom SurfaceSizeList={X:512 Y:512}, SpriteRecipe= |{Type=TEXTURE;Data=SquareSimple;Tag=Tail;Position=170,80;Size=300,120;Color=TailOff:10,0,0,255;Color=TailOn:50,0,0,255;Color=Brake:100,0,0,255} |{Type=TEXTURE;Data=SquareSimple;Tag=TurnRight;Position=412,80;Size=160,120;Color=TurnOn:235,235,30,255;Color=TurnOff:75,75,30,255} |{Type=TEXTURE;Data=SquareSimple;Position=95,120;Size=170,60;Color=Background:0,0,0,255;} |{Type=TEXTURE;Data=SquareSimple;Tag=Reverse;Position=95,120;Size=150,40;Color=ReverseOn:255,255,255,255 ;Color=ReverseOff:25,25,25,255;} ---
And Left:
[Vehicle Light Control] Tag=Custom SurfaceSizeList={X:512 Y:512}, SpriteRecipe= |{Type=TEXTURE;Data=SquareSimple;Tag=Tail;Position=342,80;Size=300,120;Color=TailOff:10,0,0,255;Color=TailOn:50,0,0,255;Color=Brake:100,0,0,255} |{Type=TEXTURE;Data=SquareSimple;Tag=TurnLeft;Position=100,80;Size=160,120;Color=TurnOn:235,235,30,255;Color=TurnOff:75,75,30,255} |{Type=TEXTURE;Data=SquareSimple;Position=417,120;Size=170,60;Color=Background:0,0,0,255;} |{Type=TEXTURE;Data=SquareSimple;Tag=Reverse;Position=417,120;Size=150,40;Color=ReverseOn:255,255,255,255;Color=ReverseOff:25,25,25,255;} ---

Sprite settings
Tag
This specifies the type of sprite. Select from the below:
Tag=Front
Front light
Tag=Tail
Tail light
Tag=TurnRight
Turn light, Right side
Tag=TurnLeft
Turn light, Left side
Tag=Reverse
Reverse light
(Nothing)
Just displaying on LCD

Type
Select from the below:
Type=TEXTURE
This sprite is texture
Type=TEXT
This sprite is text

Data
When if this sprite is text, fill in the content of text.
When if this sprite is texture, Select from the below:
Offline Online Arrow Cross Danger No Entry Construction White screen Grid DecorativeBracketLeft DecorativeBracketRight SquareTapered SquareSimple IconEnergy IconHydrogen IconOxygen IconTemperature AH_GravityHudNegativeDegrees AH_GravityHudPositiveDegrees AH_TextBox AH_PullUp AH_VelocityVector AH_BoreSight RightTriangle Triangle Circle SemiCircle CircleHollow SquareHollow UVChecker OutOfOrder StoreBlock2 LCD_Economy_Charts LCD_Economy_SC_Here LCD_Economy_Coins LCD_Economy_SingleCoin LCD_Economy_SC_Logo LCD_Economy_SC_Blueprint LCD_Economy_SC_Logo_2 LCD_Economy_Faction_1 LCD_Economy_Poster_1 LCD_Economy_Trade LCD_Economy_Clear LCD_Economy_Graph LCD_Economy_Graph_2 LCD_Economy_Graph_3 LCD_Economy_Graph_4 LCD_Economy_Graph_5 LCD_Economy_SE_Logo_1 LCD_Economy_SE_Logo_2 LCD_Economy_Blueprint_2 LCD_Economy_Blueprint_3 LCD_Economy_Trinity LCD_Economy_KeenSWH LCD_Economy_Badge LCD_Economy_Vending_Bg Screen_LoadingBar Screen_LoadingBar2 LCD_Economy_Detail
*Note:Some texture cannot change color.

RotationOrScale
When if this sprite is text, this is a size of text.
When if this sprite is texture, this is a rotation angle(Radian).

Position
Sprite position.Write like this:
Position=256,256

Size
Sprite size.Write like this:
Size=256,256

Font
Text font. No need to fill in when texture.

Alignment
Text alignment. No need to fill in when texture. Select from the below:
LEFT RIGHT CENTER

Color
Texture or text color.Write like this:
Color=(Color tag):R,G,B,A
For example:
Color=ReverseOn:255,255,255,255
Color tag is select from the below:
FrontOn
Front light color, when light is on
FrontOff
Front light color, when light is off
Brake
Tail light color, when footbrake/handbrake is on
TailOn
Tail light color, when front light is on
TailOff
Tail light color, when light is off
TurnOn
Turn signal light color, when light is on
TurnOff
Turn signal light color, when light is off
ReverseOn
Reverse light color, when light is on
ReverseOff
Reverse light color, when light is off
Foreground
Sprite is colored "Color" in LCD terminal menu
Background
Sprite is colored "Backgr." in LCD terminal menu
Default
For untagged sprite
42 Comments
Into 9 Apr, 2024 @ 1:00pm 
Is it possible to change the orientation of SemiCircle?
ostlandr 6 Mar, 2024 @ 10:40am 
How do you get the turn signals to blink? Set up the light manually?
Captain Drak 4 Jan, 2024 @ 12:49pm 
Just wanted to pop in and ask if there is a possibility of making hinges/rotors act based off control tag like Tag=Tail would cause them to reverse the hinge/rotor. For dynamic aero like a rear wing (This is the reason I ask). I see that it currently works with steering inputs, but that is it?
Normal Human 14 Jun, 2023 @ 10:57am 
Also a feature where the turn signals turn off if you go above a certain speed would be awesome :D
Normal Human 14 Jun, 2023 @ 9:25am 
Is it possible to get a custom data option for the script to not use the screens of the programmable block its placed in?
Entarlas 6 Feb, 2022 @ 12:04pm 
someone please update this... needs some love.
76561198026697978 14 Oct, 2021 @ 8:02pm 
also having the issue of the script overwriting the custom data for the lights. break lights work, but the forward lights and the turn lights don't seem to want to function. also the programmable block that I have the script in is saying

2 unassigned turn light detected.
Please align the cars straight.
[MTX]Rooster 27 Jul, 2021 @ 7:18pm 
I cannot figure out the front lights.. I have turn, tail, and reverse working flawlessly, however the front do nothing for me. Tried spotlights and interior lights, custom I type front, the script rewrites like all other lights do to TAG=Front etc., but the only way to get any lights for the front is hitting 'L' (the lights command in SE, lol) - and interior lights assigned as fronts do not come on (or off, depending on how I last set them).. When I move forward (or hop in the seat?) they should be coming on/off, correct, like all the other lights do?
BOBspiritus 17 Jul, 2021 @ 11:35am 
for those having iseus with the tail lights you have to put 'front' in the custom data of your front lights that worked for me
GerryWJH 30 Oct, 2020 @ 2:07am 
The script overrides MART PBs that has "Turn" tag in custom data, it's kinda annoying. And I couldn't get the Text Panel as Light or multiple light working:steamsad: