Rotating prop by adding angle value

FloofCollie

I really suck!
aa
Nov 5, 2016
600
669
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
 

Da Spud Lord

Occasionally I make maps
aa
Mar 23, 2017
1,339
994
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.
 

henke37

aa
Sep 23, 2011
2,075
515
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.
 

FloofCollie

I really suck!
aa
Nov 5, 2016
600
669
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.
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.
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.
This map is for its own specific thing for april fools so this isn't really an issue, but that's good to know