Scenario lua detecting player input?

Discussion in 'Programming' started by Occam's Razer, Jul 17, 2020.

  1. Occam's Razer

    Occam's Razer
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    1,152
    Is it possible to tell when the player, say, honks their horn during a scenario? I've been milling through all of the scenario files and I can't find any references anywhere. The closest I can find is the bus routes mode detecting whether the bus is kneeling and the doors are open, and even that relies on a call from the vehicle-specific lua (so it can't work on just any input from just any unmodified vehicle).

    If necessary, I'm willing to look into a flowgraph option.
     
  2. jondfb

    jondfb
    Expand Collapse

    Joined:
    Jun 16, 2020
    Messages:
    116
    hey can you collab with me on making a mod pls or help me by making a tutorial.
     
  3. Ome Joey

    Ome Joey
    Expand Collapse

    Joined:
    Aug 27, 2020
    Messages:
    2
    You could override the default electrics.horn(state) with a function of your own.
     
    • Like Like x 1
  4. Occam's Razer

    Occam's Razer
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    1,152
    Oh. Yeah, sorry, I forgot to say that I was able to figure it out by perusing the flowgraph node lua. This is the line I eventually wound up using:
    Code:
    horn_input = playerData.states.horn
     
  5. umustbeloggedintododat

    umustbeloggedintododat
    Expand Collapse

    Joined:
    Feb 16, 2019
    Messages:
    1,382
    Sorry for bump, but please don't post off-topic posts on a help thread.
     
  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