• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Login
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 6 Jun 2024, 13:23

    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
    • S
      speed2
      last edited by 7 Jun 2024, 11:39

      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 9 Jun 2024, 00:43

        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
        2 out of 3
        • First post
          2/3
          Last post