Hello everyone! It's a tutorial about how to make automatic lights for a map. This tutorial recorded on 0.22 but it works on 0.23 too I saw some questions about adding automatic lights to a map, so here's a tutorial for it. Well, back to the main subject. Here's what you should do: 1. Add spot/point lights to your map. 2. Add a new group to your map. 3. (You don't need to do it but doing it is recommended). Rename that group to whatever you want. It's not important at all but a I prefer rename it to "auto_lights". 4. Select the lights that you want to make them automatic, drag them, then drop them in the new group. 5. Save the level. 6. Close the game 7. Go to Beamng.drive/content/levels. Open small_island file. Next, go to levels/small_island, then you'll see a lua file called "mainLevel.lua". Copy it (or extract it, then copy it). 8. Go to 0.23/levels. Then you'll see the folder of your edited map. Open it, then paste the mainLevel.lua file. 9. Open the lua file, next, in the 27, 28 and 29 lines, you can see needed codes. Don't edit other lines (In this case, I don't need the line 29 so I delete it, because I have just 1 group that I want to make it automatic. If you have several groups that you want to make them automatic, you should write several lines.) Now, delete the harbour_lights and write the group name instead. 10. Save the lua file 11. Finish. Now you have automatic lights! Here's a video for all of these steps in the attachment files. (Sorry I don't have time to upload it on the YouTube) If you have any question, ask me here.
i edited a runway with adding light on a map called river high way. the problem is, i cant find the mainLevel.lua inside it, that file doesnt exists inside it, any solution?
wait so just create "mainLevel.lua" that was empty? i mean its empty so what do i do with that auto light thing "line 27 - 29" or whatever?
Is it possible to make two or more light groups (SceneTree folders) that turn on and off at different times of day? How should the lua file be re-written to separate the groups?
Of course it's possible. I haven't tried it yet but this code should work. Just change the time of day of each group and change GROUP1_NAME, GROUP2_NAME and GROUP3_NAME to the name of your groups. You can also copy the codes of each group to have more than 3 groups. Just change the number of the value and lastValue to 4, 5 and more.
This method still works great in case anyone references it. i had to watch the video posted for clarity but worked like a charm once i did!