1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  4. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  5. The Secrets of Warcraft 3 have revealed interesting works. The RESULTS for Abelhawk's Mini-Mapping Contest #15 have come out!
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Night Rider gained several songs for his journey. The poll for the 12th Music Contest has started. Check it out!
    Dismiss Notice
  9. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

SetUnitPropWindow --> DisableUnitMovement

Discussion in 'World Editor Help Zone' started by WaterKnight, Nov 4, 2011.

  1. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,031
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    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?
     
  2. andreasaspenberg

    andreasaspenberg

    Joined:
    Mar 2, 2010
    Messages:
    3,016
    Resources:
    0
    Resources:
    0
    that is way too advanced for me to make sense of but maybe if you explain it better i can help you. you could try to tell me what you want to accomplish.
     
  3. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,427
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    That sounds promising. However, what were the downsides of setting movement speed to 0 again?

    Although, if the prop window works without bugs, then it is the best option. I'll try testing it later.
     
  4. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,031
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    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.
     
  5. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,193
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    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.

    Code (vJASS):
    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.
    Pic

    [​IMG]


    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.
     
  6. Frotty

    Frotty

    Wurst Reviewer

    Joined:
    Jan 1, 2009
    Messages:
    1,406
    Resources:
    11
    Models:
    3
    Tools:
    1
    Maps:
    5
    Tutorials:
    1
    Wurst:
    1
    Resources:
    11
    Also did a few tests, didnt find any downsides yet - so probably a clean and fast way.
     
  7. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,999
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    I wrote a script based on this in the last few days, which just keeps one system from enabling unit movement if another system still wants it disabled. I can say it works and this is a really fantastic find.
     
  8. Ironside

    Ironside

    Joined:
    Feb 3, 2009
    Messages:
    2,723
    Resources:
    4
    Maps:
    3
    Tutorials:
    1
    Resources:
    4
    Interesting find, although I prefer it to place a buff and effect (sure could be done via trigger).