Unsolved Flowgraph questions: Hit cones and Reverse gear

Discussion in 'Mod Support' started by Gunslinger711, May 2, 2025.

  1. Gunslinger711

    Gunslinger711
    Expand Collapse

    Joined:
    Mar 4, 2025
    Messages:
    24
    I'm working on a rock crawling flowgraph mission and I have two questions hopefully someone can help me with.

    1) How would I detect when the player has put their car in reverse? Ideally it would detect them shifting into reverse and the car moving backwards (that 2nd part I think I have figured out) but right now I'm looking something involving gears as one of my checks for if player drives backwards.

    2) How would I detect when a player has bumped into/knocked over a physics object like a cone? I'm not sure if it would be something that tracks the movement/position of the physics object vs damage to the object because I'm sure if just nudging the cone with your car would actually register as damage.

    Any help is appreciated.
     
  2. MSLDev

    MSLDev
    Expand Collapse

    Joined:
    Mar 31, 2025
    Messages:
    7
    Hello! Can't answer the second question, but for #1, you can use the "Get Electrics Value" node, pass it a vehiD, and set the key input to "gear". If the car is in reverse, it will output "R" as a string. You can chain this with a branch or compare node to do whatever you want with that information. (Note: for park, it outputs "P", for neutral, it's "N", and for drive it's "D"). This info is pretty obscure, but for more info on this kinda stuff, check out the Electrics section of the docs: https://documentation.beamng.com/modding/vehicle/vehicle_system/electrics/ you can find a bunch of valuable info about the vehicle on there
     
    • Like Like x 1
  3. jamessimo

    jamessimo
    Expand Collapse

    Joined:
    Nov 28, 2018
    Messages:
    105
    for this. I just add a collider around the Physics object I the world editor.
    You can also get a physical objects damage value and use that.
     
    • Like Like x 1
  4. Gunslinger711

    Gunslinger711
    Expand Collapse

    Joined:
    Mar 4, 2025
    Messages:
    24
    This is what I thinking about but I wasn't sure if something like a cone can even be "damaged". Alternatively I was going to see if there's something that can get and store an objects location, then trigger something if that object gets moved from that location. I realize neither solution is 100% foolproof (either the cone is not hit hard enough to "damage" it or the cone gets knocked but doesn't move from its spot) but it might have to be good enough.
     
  5. MSLDev

    MSLDev
    Expand Collapse

    Joined:
    Mar 31, 2025
    Messages:
    7
    Hey, so I figured out an alternative solution for detecting if a cone was hit. Essentially, you'll check if the cone was moved, using its velocity property. You can grab the cone's velocity through the "Get Vehicle Data" node, then "Compare" that velocity to 0 with a "Compare" node. (P.S., I would suggest comparing to a non-zero number like .05 because in my testing the cones would move ever so slightly if I drove too close, so you don't want any false positives.)

    Note: make sure you're properly getting the cone's vehID because I had some trouble with the node grabbing the velocity for my vehicle, which would automatically detect the "cone" as "moved".
     
    • Like Like x 1
  6. Gunslinger711

    Gunslinger711
    Expand Collapse

    Joined:
    Mar 4, 2025
    Messages:
    24
    I love the solution! Much better than my damage idea.
     
  7. MSLDev

    MSLDev
    Expand Collapse

    Joined:
    Mar 31, 2025
    Messages:
    7
    Glad I was able to help!
    --- Post updated ---
    jamessimo! I loved your flow graph tutorials on YouTube, helped me out a lot. Nice to see you active in the forums
     
  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