func_rotating complete FIX (removing 1 broken spawnflag)

Discussion in 'Tutorials & Resources' started by ficool2, Nov 28, 2018.

  1. ficool2

    ficool2 L6: Sharp Member

    Messages:
    254
    Positive Ratings:
    204
    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
     
    • Like Like x 3
    • Thanks Thanks x 1
    Last edited: Dec 20, 2018
  2. MaccyF

    aa MaccyF Notoriously Unreliable

    Messages:
    922
    Positive Ratings:
    1,494
    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
     
  3. ficool2

    ficool2 L6: Sharp Member

    Messages:
    254
    Positive Ratings:
    204
    Portal 2 or later only, therefore no for TF2

    AddOutput angles doesn't work either, unfortunately
     
  4. MaccyF

    aa MaccyF Notoriously Unreliable

    Messages:
    922
    Positive Ratings:
    1,494
  5. ficool2

    ficool2 L6: Sharp Member

    Messages:
    254
    Positive Ratings:
    204
    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)
     
  6. henke37

    aa henke37

    Messages:
    2,009
    Positive Ratings:
    482
    Was this just fixed?
     
  7. Mikroscopic

    aa Mikroscopic

    Messages:
    638
    Positive Ratings:
    685
    This update effectively makes this fix obsolete.
     
    • Funny Funny x 1