FAForever Forums
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Login

    single axis Projectile Acceleration

    Scheduled Pinned Locked Moved Modding & Tools
    3 Posts 3 Posters 251 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      Resin_Smoker
      last edited by

      While we currently have proj:SetAcceleration(accel), can this be abused to change the acceleration of just a single axis after its already in flight? The Wiki doesn't appear to show anything one way or the other.

      Quick example:

      local x = 0
      local y = -1
      local z = 0
      proj:SetAcceleration(x,y,z)
      

      Kykhu Oss https://youtu.be/JUgyGTgeZb8
      Unit Thrower https://youtu.be/iV8YBXVxxeI
      Beam Tentacle https://youtu.be/le5SNwHvC4c
      Blackhole https://www.youtube.com/watch?v=D9NGQC5rr0c
      Resurection https://www.youtube.com/watch?v=WdbIQ4vHkMs

      1 Reply Last reply Reply Quote 0
      • speed2S Offline
        speed2
        last edited by

        That would probably be https://github.com/FAForever/fa/blob/develop/engine/Sim/Projectile.lua#L174 Get/SetVelocity.
        Acceleration is used for the projectile to reach it's max speed

        1 Reply Last reply Reply Quote 1
        • N Offline
          Nomander
          last edited by

          You can adjust this with Projectile:SetBallisticAcceleration(y). Gravity is -4.9 by default.
          The documentation is a bit outdated, but you can also do SetBallisticAcceleration(x, y, z) for acceleration in any direction; I just tested it. Make sure your projectile's MaxSpeed is high enough for it to accelerate how you want it to.

          1 Reply Last reply Reply Quote 1

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post