• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Prevent Movement

Status
Not open for further replies.
Level 6
Joined
Mar 7, 2011
Messages
124
I want to prevent unit movement while still allowing unit turning. I need this solution to work with air units in particular, but ideally it would work for all movement types

So, no basic PauseUnit native, because I need turning. My first approach was to use entangling roots, which I couldn't get to work against air units no matter what I tried. So I adopted the Web ability to use entangling roots effect, which almost worked, except it'd teleport units to oblivion if they were on a remotely unpathable location when cast. Then I tried modifying bloodlust to use entangling roots effect, which simply didn't do anything, even though its a legal cast. Finally, I gave up on wc3's data ability system wholesale

Then I switched to SetUnitPropWindow(u, 0). This would have been perfect, except it seems like either setting to 0 or then calling SetUnitPropWindow(u, GetUnitDefaultPropWindow(u)) causes the unit to have a movement quirk. After restoring normal movement, the unit will no longer stop to turn before moving forward, they will move forward throughout their turn, causing some imprecision/clumsiness

Can anyone please suggest a solution that meets my needs without creating additional quirks?

Also, the SetUnitPropWindow quirk is potentially useful, especially if it can be undone. A lot of physical interactions require forward momentum to turn, and this does that in a simplistic way. Does anyone know if you can revert this quirk without recreating the unit?
 
Level 6
Joined
Mar 7, 2011
Messages
124
you could just periodically force him to his old location
the unit would then jitter around. it'd look really gross and potentially cause edge case situations when jitter position is problematic. thank you for reading / contributing though

That strange behavior is because the GetUnitDefaultPropWindow(u) returns the value in degrees and SetUnitPropWindow(u, 0) takes value in radians
simple need a conversion SetUnitPropWindow(u, GetUnitDefaultPropWindow(u) * bj_DEGTORAD)
my man. Get/SetUnitDefaultPropWindow is back on the menu and is working perfectly. i'd get mad that the getter for this property returns a different unit than the setter, but i feel like this isn't even the first time i've fallen for this...
 
Status
Not open for further replies.
Top