SetUnitPropWindow --> DisableUnitMovement

Level 25
Joined
Aug 18, 2009
Messages
4,081
That is the movement window of a unit and I do not have more precise information other than it somehow defines in which angle range to the facing the unit can walk in.

If you set it to 0, which you can do ingame via
SetUnitPropWindow
then the unit cannot move anymore, not even straightforward, at least could not achieve this in test. However, it can still turn around. So I wonder if this would be a good replacement for the Ensnare-casting dummy, to render units immovable. I have not seen the use of it til yet so I ask.

Advantages are that it is immediate, does not drag air units to the ground, has no buff display, does not interrupt channels, probably cheaper and almost no map changes a unit's prop window ingame, so you can use the function
GetUnitDefaultPropWindow
to restore the previous value without the need of a custom value assignment.

Any downsides?
 
Level 25
Joined
Aug 18, 2009
Messages
4,081
That sounds promising. However, what were the downsides of setting movement speed to 0 again?

That the lowest possible speed is 1. If you do it via SetUnitMoveSpeed, this function will only affect the base speed but bonus effects stack nonetheless and you will also need to store the actual value and monitor/catch changes. Definitely, I see more projects using this function than SetUnitPropWindow. If you do it via ability, I guess Item: Movement Speed Bonus (AIms) is the only one without buff and it cannot reduce movement speed. Would also alter the display when hovering over unit's armor tooltip.

@andreasaspenberg: To render a unit temporarily immovable during runtime but with turning and without hassles. Have looked through the forum. Most only were told that they should set min speed in gameplay constants to 0, which I have just said is not enough. Others proposed to use Entangling Roots, which is even worse than Ensnare, as it fiddles with additional unit interaction like disabling attack.
 
Level 35
Joined
Mar 6, 2006
Messages
9,244
I was testing that one day, giving units different prop window values. For some reason, I did it in GUI. Seeing this thread, I wondered how I did not experience the no-movement thing.

JASS:
function SetUnitPropWindowBJ takes unit whichUnit, real propWindow returns nothing
    local real angle = propWindow
    if (angle <= 0) then
        set angle = 1
    elseif (angle >= 360) then
        set angle = 359
    endif
    set angle = angle * bj_DEGTORAD

    call SetUnitPropWindow(whichUnit, angle)
endfunction

CURSE YOU GUI!

This is really useful for my skill selection system.




I need to have the unit selected while in the screen to display comman card, but obviously I don't want it to move. Instead of using a trigger that catches all orders and stops the unit after a timer expires, I can just set prop window to 0. Neat.
 
Top