Page 1 of 1

Player predicted angles

Posted: Thu Mar 15, 2018 6:19 am
by Hymns For Disco
In sourcemod, the OnPlayerRunCmd forward gives access to get/set the player's predicted view angles. I would like to be able to get/set these angles in my sourcepython plugin, but I'm not sure how to do this. Ideally I would like to be able to get/set at directly from the Player reference and not need to do it in the @OnPlayerRunCommand listener

Re: Player predicted angles

Posted: Thu Mar 15, 2018 11:26 am
by Ayuto
In a OnPlayerRunCommand listener you can modify the UserCmd instance:
http://wiki.sourcepython.com/developing ... iew_angles

If you would like to modify the angles outside of the OnPlayerRunCommand listener, you can use this:
http://wiki.sourcepython.com/developing ... view_angle

Re: Player predicted angles

Posted: Thu Mar 15, 2018 7:40 pm
by Hymns For Disco
Thank you for the reply. the documentation is a bit unclear about if the angles are the 'predicted' angles or not. It's important for my purposes to be able to set the predicted angles. My plugin will be repeatedly loading this data for a replay feature. Since the viewing client does not get updated about the angles *every* frame, it looks quite choppy without the predicted angles also being set. I believe setting the Player.view_angles is setting the actual view angles, and not the predicted value. I will try changed the UserCmd.view_angles