Rotating prop by adding angle value

Discussion in 'Mapping Questions & Discussion' started by FloofCollie, Jan 13, 2021.

  1. FloofCollie

    aa FloofCollie I really suck!

    Messages:
    541
    Positive Ratings:
    463
    I'm trying to make a setup where shooting one of two buttons rotates a prop 90 degrees left or right respectively, and so far my logic setup for one button is:

    Output: OnDamaged
    Target Entities: cow
    Via this Input: AddOutput
    Parameter Override: angles 0 90 0

    However, this just sets the angle to 90 rather than adding an additional 90 degrees. What is the simplest way to achieve this? This logic will need to be duplicated a lot of times so it should preferably be light on additional required entities
     
  2. seth

    aa seth

    Messages:
    1,014
    Positive Ratings:
    719
    Parent a func_rotate to your prop and trigger the func_rotate instead. Make the func_rotate non-solid/invisible and set it on top of the prop's origin.
     
  3. Da Spud Lord

    aa Da Spud Lord Occasionally I make maps

    Messages:
    1,292
    Positive Ratings:
    858
    Yup, prop_dynamic isn't meant to rotate on its own so it doesn't have any way to add to its angles. (Technically, the ability to set its angles is unintentional.)

    There's two solutions I would recommend. If you want smooth rotation, an invisible momentary_rot_button, which the prop is parented to, can be instructed to rotate to arbitrary positions between its open and closed positions via its SetPosition input. Combine this with a math_counter to store and output the position value, which should easily give you what you want.

    If edicts are a concern, you can replace the momentary_rot_button with a logic_case. The logic_case's OnCase outputs each store a different AddOutput angles value. This will require you to explicitly declare each angle the prop could rotate to, which will be tedious but simple.
     
  4. henke37

    aa henke37

    Messages:
    2,044
    Positive Ratings:
    490
    It is recommended that you avoid the OnDamaged output for buttons that are just buttons. Some servers let players +use buttons without firing a shot, but that doesn't work with OnDamaged.
     
  5. FloofCollie

    aa FloofCollie I really suck!

    Messages:
    541
    Positive Ratings:
    463
    I want it to be instantaneous rotation so I suppose I'll either use this method or (since the props will be teleported into place to begin with) I'll use teleport angles.
    This map is for its own specific thing for april fools so this isn't really an issue, but that's good to know