Solved Set the Speed (without acceleration)

Discussion in 'Mod Support' started by Stiegfried, Jun 15, 2018.

  1. Stiegfried

    Stiegfried
    Expand Collapse

    Joined:
    Feb 17, 2018
    Messages:
    16
    Hello everyone,

    does anyone know a way of setting the speed of an vehicle without the need of acceleration so that I could pause the game, set the speed and when I unpause the vehicle already has the speed?

    I found other threads asking for a possibilty of setting the speed where the ai was suggested to automatically accelerate to the speed needed, but sadly that doesn't help me at all.

    Tbh I don't think there is a way to do this but I "need" a confirmation on that (which I wasn't able to find anywhere as all the other threads accepted the ai solution).

    Thanks in advance,
    Stiegfried
     
  2. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    nope you can't do that, you can move around the vehicle without losing the velocity but you CANNOT 'assign' a velocity
     
  3. Stiegfried

    Stiegfried
    Expand Collapse

    Joined:
    Feb 17, 2018
    Messages:
    16
    I see.
    Then I can let the ai hit a certain speed and then automatically pause and teleport. I've found the function vehicleSetPositionRotation() for the teleportation, problem for this purpose appears to be that the rotation is relative to the direction the vehicle faces when it is teleported. That would require the ai to face the right direction when hitting the speed (as due to certain circumstances I cannot accelerate manually or correct the direction the vehicle is facing).
    Is there a way to teleport the vehicle and give an absolute rotation (for both the vehicle and its velocity of course) instead of a relative one? That would make it easier to use as I wouldn't need to declare a straight ai-route but only make sure the ai has the space required to hit the speed.
     
  4. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    if you use the rotation function it will reset the velocity.
    The vehicle need to be driven by the AI in the right direction and then you teleport it to the position you need.

    just the position
    Video - Click to Play - Direct Link



    position with rotation will completely reset the vehicle and kill the velocity
    Video - Click to Play - Direct Link
     
    #4 thomatoes50, Jun 15, 2018
    Last edited by a moderator: Jun 18, 2018
    • 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