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

    single axis Projectile Acceleration

    Scheduled Pinned Locked Moved Modding & Tools
    3 Posts 3 Posters 303 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
      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
        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
          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
          • First post
            Last post