Player predicted angles

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
Hymns For Disco
Member
Posts: 32
Joined: Wed Nov 22, 2017 7:18 am
Contact:

Player predicted angles

Postby Hymns For Disco » Thu Mar 15, 2018 6:19 am

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
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Player predicted angles

Postby Ayuto » Thu Mar 15, 2018 11:26 am

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
User avatar
Hymns For Disco
Member
Posts: 32
Joined: Wed Nov 22, 2017 7:18 am
Contact:

Re: Player predicted angles

Postby Hymns For Disco » Thu Mar 15, 2018 7:40 pm

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

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 24 guests