1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.35 Bug Reporting thread
    Solutions and more information may already be available.

SOLVED Map light editing

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by W220, Jan 4, 2025.

  1. W220

    W220
    Expand Collapse

    Joined:
    Jun 5, 2024
    Messages:
    11
    I've found a very interesting script that makes spotlights turn on/off automatically. But I don't like the time they turn on and off. How can I edit the time?
    P.s. script was made and edited by essej818 about 4-5 years ago, but it works on 0.34
     
  2. Barbent Servo GT

    Barbent Servo GT
    Expand Collapse

    Joined:
    Jun 4, 2023
    Messages:
    651
    If you like to show the script,we can talk about what exactly has to be edited. But basically there are two values compared with the current game time as greater than and smaller than. The values are coded as decimal from 0 to 1. Where 0 ist noon, 0.5 is mid night and 1 is noon again.
     
    • Agree Agree x 1
  3. W220

    W220
    Expand Collapse

    Joined:
    Jun 5, 2024
    Messages:
    11
    Script from this thread
    https://www.beamng.com/threads/solved-street-lights-at-night.72220/
    --- Post updated ---
    i ask because i tried to change "tod.time" but nothing changed
     
  4. Barbent Servo GT

    Barbent Servo GT
    Expand Collapse

    Joined:
    Jun 4, 2023
    Messages:
    651
    See the line
    if tod.time > 0.2 and tod.time < 0.8 then

    tod.time is the current game time and is continously updated by BeamNG.
    0.2 and 0.8 are the comparison values. Imagine a day span: 0 to 0.5 to 1 as described above.
    In the script 0.2 is the coded time when the light should switch on, and 0.8 when they switch off.

    In the World Editor there is a slider, where you can tamporarily change the daytime:
    upload_2025-1-4_14-47-43.png

    There you can set the time to your liking and divide the value by 100. This can then be used to edit the code line above accordingly with the new daytime values.
     
    • Like Like x 1
  5. W220

    W220
    Expand Collapse

    Joined:
    Jun 5, 2024
    Messages:
    11
    Ah thank you, a kind stranger, i owe you
     
    • Like Like x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice