Solved Flowgraph Editor - vec3 only updating X value, Y and Z 0

Discussion in 'Mod Support' started by ffzero58, Feb 4, 2022.

  1. ffzero58

    ffzero58
    Expand Collapse

    Joined:
    Nov 18, 2018
    Messages:
    55
    I am running into an odd behavior on BeamNG 0.24. Only X is being updated on the "position" vec3 in the "Set Object Field" node.

    upload_2022-2-4_13-27-46.png

    I am feeding proper vec3 data into the pin from Get Vehicle Data/position:

    upload_2022-2-4_13-28-46.png

    However, only X is being updated on the Object - Y and Z are being set to 0.

    upload_2022-2-4_13-30-43.png

    So when the vehicle moves, it only moves along the X-axis.

    Is there something else I need to set to make this update properly? Y and Z are forced to 0 value and I am unsure why. Any help is appreciated!
     
  2. ffzero58

    ffzero58
    Expand Collapse

    Joined:
    Nov 18, 2018
    Messages:
    55
    Ok... the "bug" is still there but I was able to work around this by creating my own node which accepted the position vector (copied from lua\ge\extensions\flowgraph\nodes\scene\setObjectField.lua).

    upload_2022-2-4_20-13-9.png

    Now the object is following the position and rotation of the vehicle. Hope this helps.
     
  3. angelo234

    angelo234
    Expand Collapse
    Programmer
    BeamNG Team

    Joined:
    Aug 11, 2017
    Messages:
    587
    The bug isn't your fault but because the string representation of the vector inserted into the obj:setField function includes commas between the vector values when it should just be spaces. So instead of this at line 34 in setObjectField.lua:
    Code:
    val = table.concat(val,', ')
    It should be this:
    Code:
    val = table.concat(val,' ')
     
    #3 angelo234, Feb 5, 2022
    Last edited: Apr 26, 2022
    • Like Like x 1
  4. ffzero58

    ffzero58
    Expand Collapse

    Joined:
    Nov 18, 2018
    Messages:
    55
    Thanks! My eyes glaze over when it comes to debugging code and I ended up re-inventing the wheel...

    I'll try this out.
     
  5. ffzero58

    ffzero58
    Expand Collapse

    Joined:
    Nov 18, 2018
    Messages:
    55
    Sorry, I forgot to close the loop on this one - I changed the code in setObjectField.lua as suggested by angelo234 and that resolved the issue. Thank you!
     
  6. angelo234

    angelo234
    Expand Collapse
    Programmer
    BeamNG Team

    Joined:
    Aug 11, 2017
    Messages:
    587
    Btw, this has already been fixed in the official game :)
     
    • Like Like x 1
  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