Solved Check state of fog lights

Discussion in 'Mod Support' started by Skirmisher, Jun 17, 2016.

  1. Skirmisher

    Skirmisher
    Expand Collapse

    Joined:
    Oct 26, 2013
    Messages:
    27
    I'm writing a scenario that involves driving without working headlights as the sun is going down, and you have to rely on fog lights to see once it gets dark. (Disabling the headlights alone was a mess.) Problem is, electrics.setLightsState(n) exists to set the headlights to a certain state, but no such thing exists for fog lights, only electrics.toggle_fog_lights(). How can I tell if the vehicle's fog lights are already activated so that I can always enable them when the scenario is started or restarted?
     
    #1 Skirmisher, Jun 17, 2016
    Last edited: Jun 17, 2016
  2. meywue

    meywue
    Expand Collapse
    Administrator
    BeamNG Team

    Joined:
    Nov 19, 2015
    Messages:
    321
    Hey,

    sorry for the late reply.

    electrics.fog is what you're searching for!

    Cheers!
     
  3. Diamondback

    Diamondback
    Expand Collapse
    Moderator
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,565
    Funny coincidence, a few days ago I've implemented direct set access for fog lights and lightbars. So after the next update you can set those values directly without any toggle logic.
     
  4. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,622
    Thanks meywue, I also was looking for the answer to this.
    That's great! The direct access to lightbars can be used to fix the annoying scenario bug(s) where you respawn at the wrong time and the toggle state gets flipped to the incorrect state.

    If only there was a brake interface (need to cut brake lines for scenarios like this one)... ;););)

    Thanks for all that you devs do.
     
  5. Svpracer

    Svpracer
    Expand Collapse

    Joined:
    Aug 21, 2013
    Messages:
    224
    Not to bump this thread, but how would I toggle the hazards if I wanted them to go off without user input?
     
  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