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.
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
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.
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.
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".
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