Replicated RotationRate

Discussions about Coding and Scripting

Replicated RotationRate

Postby Barbie » Sun Nov 20, 2016 6:23 am

I run into a problem: in Map "NaliBoat" is a windmill with rotating wings at a rate of Roll=-4096 (see pic) counterclockwise. If playing locally, it rotates as desired, but on net play it rotates much too fast and even in opposite direction.
Debugging on server showed that Mover1.RotationRate is (0,0,61440) instead of map's value of (0,0,-4096). Remarkable is that 61440=0xF000 and -4096=-FFFFF000, and on Wiki I've read that rotator components are compressed to the size of a byte - so the Roll value seems to be clamped in a way.
Any hints to resolve this?
Sometimes phrasing the question includes the answer... I just passed the problem by with turning the wing wheel 180° around its z-axe and changing the Roll from -4096 to +4096. That value is replicated fine.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Posts: 1648
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Replicated RotationRate

Postby Wormbo » Sun Nov 20, 2016 5:23 pm

A note on the log output: The built-in Rotator to string conversion applies "& 0xFFFF" clamping to the components for output only. If you log the individual components, you'll probably see the correct values on the server side.
User avatar
Posts: 258
Joined: Sat Aug 24, 2013 6:04 pm

Return to Coding, Scripting

Who is online

Users browsing this forum: No registered users and 2 guests