func_rotating complete FIX (removing 1 broken spawnflag)

ficool2

L4: Comfortable Member
Oct 28, 2017
161
232
This fix is obsolete! Valve has fixed this in the 20/12/2018 update.

func_rotating has been broken in TF2 since release due to a spawnflag that has never been fixed.

func_rotating has a spawnflag with the number 16, and this is defined as Clientside Rotation in code. However, this spawnflag has been broken since release and Valve has never fixed it.
Also, the FGD lists this spawnflag as "Acc/Dec", which is completely wrong (unless you use my FGD which has this fixed and listed as Clientside Rotation)

upload_2018-11-28_16-43-50.png


However, there is a trick you can do to remove this spawnflag so that the func_rotating works correctly.
First, create your func_rotating as usual.
Second, go into the spawnflags and tick Acc/Dec, or Clientside Rotation if you are using my FGD, this will be needed so we can calculate the spawnflag number easily.
Next, change all the other flags/keyvalues you want, and give the func_rotating a name.
Turn off SmartEdit and look at the "spawnflags" keyvalue, and the number. You need to subtract 16 from this number, and then keep the result as it will be used in a moment.
Next, create a logic_auto, and give it the following output:

OnMapSpawn - <func_rotating name> - AddOutput - spawnflags <result number>

Repalce result number with the number you got earlier from the subtraction.
This small tweak effectively makes the logic_measure_movement workaround obsolete.

Congratulations you now have a working func_rotating, but before you get too excited with the entity, you need to beware of this 1 issue:
  • The func_rotating has an angle limit of -36000 or 36000. If it exceeds this angle, it will stop working. The faster your func_rotating, the faster it will get to this limit
 
Last edited:

ficool2

L4: Comfortable Member
Oct 28, 2017
161
232
Does func_rotating accept SetLocalAngles as an input? I know that that the error thrown when you exceed the angle limit is "Bad SetLocalAngles(angle >/<36000)".

If so you could just periodically reset the entity's angle and it shouldn't exceed the limit

Portal 2 or later only, therefore no for TF2

AddOutput angles doesn't work either, unfortunately
 

ficool2

L4: Comfortable Member
Oct 28, 2017
161
232

There is a theoretical workaround you could possibly do, which is creating a timer system. As the func_rotating spins, it hits some entity/trigger, which then resets the fimer. If the func_rotating stops spinning, the timer would not reset and therefore hit its end. That in turn could either kill the func_rotating and respawn it with a point_template, or make the func_rotating go in reverse

You could also use an entity that senses the func_rotatings angles, and compares them (I can't recall the entity that did such thing though, and it would be expensive for I/O bandwidth)
 

henke37

aa
Sep 23, 2011
2,075
515
Was this just fixed?