Space Engineers

Space Engineers

Ground vehicle lights script
24 Comments
The_Maegges  [author] 19 Jun, 2024 @ 2:58am 
@Into: Contrary to real life the turn indicators only work as long as the vehicle is actually turning, as the script measures if a lateral force is being applied to the grid. So if the vehicle stops, no force is applied and therefore the turning indicators are being turned off.

I am considering a rewrite of the script and will take some of the suggestions here into consideration.
Greystone 10 Jun, 2024 @ 2:12am 
Can you add a Hazard Light option that allows brake lights and marker light to flash if activated?
Into 9 Apr, 2024 @ 8:51am 
using your script for indicator lights, but they go out of you stay still, what would I have to do to change it?
Maja 25 Feb, 2024 @ 4:41pm 
Such a basic and yet amazing script. Short code, lightweight and does exactly what you need in any ground based vehicle.
Haddock 28 Mar, 2023 @ 1:07am 
Or take a Benz and there is no need for turning lights... :-P
The_Maegges  [author] 27 Mar, 2023 @ 2:54pm 
Thanks! Unfortunately I can't do much about the delay, as the sideway force can only detected as it builds up. So turning indicators are more in the style of an Audi driving down a german highway ;-)
Haddock 27 Mar, 2023 @ 6:08am 
Hi, here the feedback like desired: The turning lights are working in the correct directions while the driver is placed exactly above the fwd wheel (smal grid, 3x3). Only disadvantage is a time delay till the turn lights are comming up. But anyway a good idea and job.
Entarlas 7 Feb, 2022 @ 2:42am 
breaking and turn indication...
That sounds cool :) looking forward to that too then. this will be the light mod to end all light mods! :summer2019flag: Let's Gooo! lol
Entarlas 7 Feb, 2022 @ 2:37am 
I did some further testing. The break lights DO register however not in a useful way. They only turn on when used at dangerously high speeds and only for a fraction of a second even then. The threshold for them needs to be turned WAY down so they register when space-bar is pressed at all preferably or at least when moving at low speed like 5m/s+
The_Maegges  [author] 7 Feb, 2022 @ 2:22am 
I haven't yet integrated the logic for combined breaking and turn indication. I will look into that during the next days ;-)
Entarlas 7 Feb, 2022 @ 1:49am 
also I originally had the reverse lights and break lights set to the same lights (its just how i wanted it for this build) set them to just break lights for the follow up test and post though as they work fine for reverse but don't work as breaks in either case. However the script recognizes them as both / either and compiles fine.
Entarlas 7 Feb, 2022 @ 1:47am 
ok, so it didn't work. and break lights won't come on either. Here is a link to the vehicle as is. thank you for your help.

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?edit=true&id=2745977652
Entarlas 7 Feb, 2022 @ 1:15am 
@The_Maegges : sure no problem. If that doesn't work I'll post the bp on workshop as WIP Rover Logic for you to take a look at. fingers crossed though ;p Thank you for the speedy response.
The_Maegges  [author] 6 Feb, 2022 @ 11:52pm 
@SilverFire: It should be sufficient to set linkAmbientLights = false

However, if that doesn't work, is there a way to share your vehicle blueprint with me?
Entarlas 6 Feb, 2022 @ 7:41pm 
just a thought. for people that want a reverse beeper... assign a sound block w/ chosen sound to [Reverse] ;)
Entarlas 6 Feb, 2022 @ 7:40pm 
Pressing "L" still turns on all unassigned lights along with headlights, and break lights only occasionally work but its working great that aside. Can't wait for Fog lights update (my unassigned lights) lol. Should I label them [Ambient] for now and set the ambient setting in script to false instead of = true?
Thanks
The_Maegges  [author] 8 Dec, 2020 @ 12:57pm 
I updated the script to make it a bit more robust. Also it now uses predefined tags, you can enter in your light block names, so there is no longer the need to edit the script itself when adding blocks.

Please make sure to hit "recompile" in the programmable block after adding new blocks.

I am open to suggestions regarding new features, so feel free to ask. Enjoy and thanks for your support!
The_Maegges  [author] 8 Dec, 2020 @ 10:35am 
@Hell Jumper: 942: Feel free to use the script in your blueprints, I didn't create it just for myself.
The_Maegges  [author] 8 Dec, 2020 @ 10:30am 
@ThePandaNetwork: I'll look into it.
@R41N: My guess is that either you haven't named the blocks correctly or one of your lights might have gone missing somehow (block destroyed). Anyways, since I'll give it a bit more love anyways, I will try to make it a bit more robust.
TuxRiley 2 Dec, 2020 @ 10:46am 
is it possible to use the brake light as a blinker at the same time i don't like it when there are 4 lamps behind my car
=BIA=RaiN 2 Dec, 2020 @ 1:49am 
Hello there, I've just checked your script on reddit and tried it out but I get a bunch of errors right from the start, as soon as I load the script in the PB. I do not know how to copy\paste the error, it goes something like this:
Caught exception during execution of script: Index was out of range.

And goes on.

I'm the only one with this issue?
Lanthire 29 Nov, 2020 @ 7:56pm 
Man, I was just thinking the other day using the new lights how it'd be neat to do have something like this. Thanks a bunch for uploading!

Is it cool if I use this in future workshop blueprints of mine? I'd give you full credit for your work in the description.
Spug 29 Nov, 2020 @ 3:38pm 
Awesome script, a must for all vehicle builds.

You should install and learn how to use "SEWT" (SE Workshop Tool) which lets you give your script a thumbnail. Give it a cool design and add some images to this post and the algorithm will put this on the front page (where it belongs). It'll be worth the effort
The Stranger 29 Nov, 2020 @ 12:04pm 
Greetings from Reddit