QUESTION F1 rain light status

Discussion in 'Apps' started by LeGuyTremblay, Jul 22, 2021.

  1. LeGuyTremblay

    LeGuyTremblay New Member

    Joined:
    Jan 15, 2021
    Messages:
    8
    Likes Received:
    3
    Location:
    Canada
    When I’m driving a recent Formula One, I would like to know the state of the rain light. Based on what I saw the state are:

    1-OFF, most of the time.
    2-Flashing, when the pit limiter enabled or the battery is recharging.
    3-ON, under rain condition.

    Do you have any idea where can I seek to fulfill those three different states? So far, the AC Remote Telemetry UDP daemon seems to address the pit zone state. Does anybody know how can I get the other information?

    Sincerely,
     
  2. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    two examples from user Xela1 on CSP discord, those are additions to the cars config, whether in
    "...assettocorsa\content\cars\_carname_\extension\ext_config.ini"
    or
    "...assettocorsa\extension\config\cars\_carname_.ini"

    Code:
    ; ks_Audi R8 GT3
    [EMISSIVE_WIPERS_MODE_...] ; FOGLIGHT rear
    NAME=LIGHT_m_brake
    COLOR=15,1,1,80
    
    ; ks BMW Z4_GT3
    [EMISSIVE_WIPERS_MODE_...] ; FOGLIGHT rear Xela1
    NAME=LIGHT_CENTRAL_STOP
    COLOR=15,1,1,30
     
  3. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    @Dany Hillary maybe its interesting for others too:
    you put it in 'extended' CSP car config, whether in
    \assettocorsa\content\cars\yourcar\extension\ext_config.ini
    or
    \assettocorsa\assettocorsa\extension\config\cars\yourcar.ini
    (here you should search any sub folder for existing configs)

    You have to know the name of the thing you want to have as that rain light, you can find out in showroom (or ingame with ObjectInspector):

    upload_2021-8-4_17-45-12.png

    In case of the vrc_formula_alpha_2007 there is no config in "loaded" folder, it has its own config:
    "...cars\vrc_formula_alpha_2007_f07\extension\ext_config.ini"

    There simply insert this:
    Code:
    [EMISSIVE_WIPERS_MODE_...]
    NAME=EXT_rainlight
    COLOR=15,1,1,30
    upload_2021-8-4_17-45-23.png
     
    Last edited: Aug 4, 2021
  4. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    @Dany Hillary
    if you want it to blink add this:

    BLINK_REPEAT=1
    BLINK_FREQENCY_HZ=4 ;;; make it blink faster (Hz is per second)

    updated the CSP wiki on Github with correct info about this.
     
    Last edited: Aug 5, 2021
  5. Dany Hillary

    Dany Hillary New Member

    Joined:
    Aug 3, 2021
    Messages:
    2
    Likes Received:
    0
    :) it worked. yep i checked it. is this one for adjusting the brightness of tail light?
    BRAKELIGHT_LIGHT_MULT = 0.2
    BRAKELIGHT_LIGHT_RANGE_MULT = 0.5
     
  6. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    no, its in the color line:
    COLOR = r, g, b, brightness

    COLOR=15, 1, 1, 60 ; 60 is twice as bright than 30 :)
     
  7. Dany Hillary

    Dany Hillary New Member

    Joined:
    Aug 3, 2021
    Messages:
    2
    Likes Received:
    0
    :lol:i need twice n heavy rain. anyway pal u helped me a lot..no more annoying..thank you:)
     
  8. LeGuyTremblay

    LeGuyTremblay New Member

    Joined:
    Jan 15, 2021
    Messages:
    8
    Likes Received:
    3
    Location:
    Canada
    First that for your help. This is my first app and my spare time is limited but I hope to finish a first release this month.

    After reading your comments, I used Object Inspector with a “Formula Hybrid 2021” car. I found under the mesh ERS_Harvest, the variable ksEmissive was 0,0,0 when light OFF and 333,0,0 when the light is ON. I can't comment if this is the right way or not. What I can say is I don’t think this is the right approach for me because each car model will use a different object name. I am sure there is another way having those informations.

    My goal is to activate a real F1 light (McLaren Rainlight-3) when the virtual one is activated. That light is fully programable and so far, I can do anything with it. Honestly any light can do the job, I just want to learn what a thru one can do including CAN protocol. My missing part is how can I bridge the light activation with games like AC. For now, I will limit myself to F1 cars. The light can also accommodate LMP FIA rules with two zones (rain, braking). This maybe consider for another release, but I don't have the interest for now.

    On my initial question, I was wrong with the 3 different states. Under rain the light isn’t always ON anymore, it is always flashing like when ERS is recharging.

    I will keep searching/testing into the share memory to make sure I can cover all the scenarios.

    Sincerely,
     
    Last edited: Aug 9, 2021
  9. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    there is no standard way to access stuff, every car is different, everyone needs a different config then...
     
    LeGuyTremblay likes this.
  10. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    "I am sure there is another way having those informations."
    no there is not :(
     
    LeGuyTremblay likes this.
  11. LeGuyTremblay

    LeGuyTremblay New Member

    Joined:
    Jan 15, 2021
    Messages:
    8
    Likes Received:
    3
    Location:
    Canada
    Now I see a lot of fun to come. Thanks for the hint!
     
    fughettaboutit likes this.
  12. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    what works in an app is this:

    RainParams = ac.ext_rainParams() # get current rain/wipers state from patch
    print( RainParams[0] * 100 + ' percent rainy')
     
  13. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    see all available new "ac.ext_..." python-functions in this file:
    Documents\Assetto Corsa\logs\custom_shaders_patch.log
    upload_2021-8-8_23-18-38.png

    For usage of a particular one, just ask here :whistle:
     
  14. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
  15. LeGuyTremblay

    LeGuyTremblay New Member

    Joined:
    Jan 15, 2021
    Messages:
    8
    Likes Received:
    3
    Location:
    Canada
    My Python app working fine (rain, KERS charge, pit limiter). I was able doing it without being restricted to any specific car light object.

    My last error is with with a USB-Serial relay to activate or not the rear light. I don't know why but I can't import the serial lib that all Python bundle have. Does anybody having an idea?

    ***py.log***
    [backLight: error] Traceback (most recent call last):
    File "apps/python/backLight\backLight.py", line 20, in <module>
    import serial
    ImportError: No module named 'serial'

    ***backlight.py***
    16 import os
    17 import sys
    18 import math
    19 import time
    20 import serial
    21 import ac
    22 import acsys
    23
    24 import platform
    25 if platform.architecture()[0] == "64bit":
    26 sysdir='apps/python/backLight/third_party/stdlib64'
    27 else:
    28 sysdir='apps/python/backLight/third_party/stdlib'
    29 sys.path.insert(0, sysdir)
    30 os.environ['PATH'] = os.environ['PATH'] + ";."
    31 sys.path.insert(len(sys.path), 'apps/python/backLight/third_party')
    32 from sim_info import info

    Sincerely
     
  16. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    AC uses its own implementation/pack of python 3.3, if you unpack
    assettocorsa\system\x64\Python33.zip
    there is no serial module

    You have to provide it yourself in the app folder maybe, but it might be that it needs other modules...
     
  17. LeGuyTremblay

    LeGuyTremblay New Member

    Joined:
    Jan 15, 2021
    Messages:
    8
    Likes Received:
    3
    Location:
    Canada
  18. LeGuyTremblay

    LeGuyTremblay New Member

    Joined:
    Jan 15, 2021
    Messages:
    8
    Likes Received:
    3
    Location:
    Canada
    Working just fine. For those who wants to try, here is the app. DSC06268.JPG
     

    Attached Files:

    fughettaboutit likes this.
  19. fughettaboutit

    fughettaboutit aka leBluem

    Joined:
    Jul 21, 2014
    Messages:
    1,113
    Likes Received:
    378
    wth, didnt expect this :)
     
    Last edited: Aug 14, 2021
  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