I've been working on a custom toggle ability that locks the direction a hero's facing, but lets them continue to auto attack and cast spells. MODIFIER_PROPERTY_DISABLE_TURNING works great for disabling turning, but makes auto attacks and abilities feel bad. I've been thinking about ways to make this better, and have a couple ideas.
-
Increase the cast angle for abilities and auto attacks.
MODIFIER_PROPERTY_IGNORE_CAST_ANGLEis the right idea, but I want to be able to limit it to say, 45 degrees instead of a full 360. Is this even possible? I haven't found anything in the scripting API, but this feels like the best solution. -
Stop using
MODIFIER_PROPERTY_DISABLE_TURNINGand capture the units YAW upon toggle usingGetLocalAngles. Then when the unit would turn, limit how far in either direction it can go (usingRotateOrientation?). If I understand how it works, I thinkOnIntervalThinkand friends would work for this, but it feels heavy handed. Is there a way to trigger effects when a unit is turning, instead of during the entire time the ability is toggled on?