Question regarding knock back (SetVelocity)

twilitebluetwiliteblue bug stalker Join Date: 2003-02-04 Member: 13116Members, NS2 Playtester, Squad Five Blue
edited March 2015 in Modding
Hi fellow modders!

I have been experimenting with push/knockback abilities, and experienced a problem.

When I use SetVelocity(v) to push another player, it would fail to do anything, despite the code is being commonly used in game by Infantry Portal, Phase Gate, and Exo.

Would anyone help explain what I'm doing wrong? Does there exist any alternate ways to push a player ?

Comments

  • IronsoulIronsoul Join Date: 2011-03-12 Member: 86048Members
    Hey, it's 1am right now so I can't do too much in terms of direct help. But when i was experimenting with changing movement speed it wasn't the actual speed variable that affected things, it was an acceleration versus friction style formula. So you might be looking at the wrong function entirely.

    Let me know if you solve it or don't solve it, I'm going to be doing a bit of modding research tomorrow so I may have a chance to attempt to help solve that problem you're having.
  • twilitebluetwiliteblue bug stalker Join Date: 2003-02-04 Member: 13116Members, NS2 Playtester, Squad Five Blue
    edited March 2015
    Remi.D has written an explaining it to me. In short, velocity change to another entity need to be done on the server (such as IP push), or by agreeing predicted physics models (eg PredictedProjectile). Otherwise the movement change will be discarded.

    Luckily, through some trial and error, I got Onos charge push working by doing it server-side with a recurring AddTimedCallback. :)
  • IronsoulIronsoul Join Date: 2011-03-12 Member: 86048Members
    is the callback necessary?
  • twilitebluetwiliteblue bug stalker Join Date: 2003-02-04 Member: 13116Members, NS2 Playtester, Squad Five Blue
    edited March 2015
    Ironsoul wrote: »
    is the callback necessary?

    The AddTimedCallback is used as a loop, (similar to how IP knockback works) when the function called returns "true", so it will keep calling until the function returns "false". In my case, it stops calling KnockDownPlayers() the Onos stops charging.
Sign In or Register to comment.