1. The 30th edition of the Modeling Contest is finally up! The Portable Buildings need your attention, so come along and have a blast!
    Dismiss Notice
  2. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    Dismiss Notice
  3. Melee Mapping Contest #3 - Results are out! Congratulate the winners and check plenty of new 4v4 melee maps designed for this competition!
    Dismiss Notice
  4. The winners of our cinematic soundtrack competition have been decided! Step by the Music Contest #11 - Results to check the entries and congratulate the winners!
    Dismiss Notice

Setting unit's movement speed to 0 but can still turn. How?

Discussion in 'World Editor Help Zone' started by xyke, Jan 13, 2019.

  1. xyke

    xyke

    Joined:
    Jan 13, 2019
    Messages:
    8
    Resources:
    0
    Resources:
    0
    Hey guys! This is my first time posting

    I am working on a new map which is a moba just like dota. I have some few knowledge already with
    GUI but nothing on Jass.

    Anyway, I made a unit which is a neutral monster. I want it to stand still in a zone so I changed its
    movement speed amount to 0 but at the same time, I also still want it to turn. Having 0
    movement speed loses the ability to turn.
    I also dont want to change the game constant to 0 minimum speed and give it a 1 speed because
    it's a moba game and if a unit's speed gets reduced to 0 by spamming slowing spells, that will be
    imbalance for the game.

    TLDR: I want my unit to be able to turn to its attack target without moving away from its position. Any tips, guys?
    Thanks in advance
     
  2. Sir Moriarty

    Sir Moriarty

    Spell Reviewer

    Joined:
    Jun 13, 2016
    Messages:
    279
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    One of the easiest ways to accomplish this I can think of is to turn the unit into a building, and then use triggers to manually set the facing angle of the unit whenever it starts an attack.

    Alternatively, it may also be worth trying to remove the "Move" ability from the unit via triggers as well.
     
  3. noob

    noob

    Joined:
    Sep 28, 2011
    Messages:
    645
    Resources:
    0
    Resources:
    0
    When an unit does not have the move ability it will probably still move when it wants to attack an unit out of range.
    so for example a footmen gets close enough to a move speed 1 tower without the move ability for the tower to shoot at it then the footmen flees the tower will probably pursue with its move speed of 1.
     
    Last edited: Jan 14, 2019
  4. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,007
    Resources:
    10
    Tools:
    2
    Maps:
    2
    Spells:
    5
    Tutorials:
    1
    Resources:
    10
    there is this set proper window angle to 0 to make an unit unable to move.
    But don't use the gui version it prevents using 0.
    Code (vJASS):

        call SetUnitPropWindow( udg_<variableName>, 0.00 )
     


    or you permanently cast an ensnare spell on the unit.
     
  5. xyke

    xyke

    Joined:
    Jan 13, 2019
    Messages:
    8
    Resources:
    0
    Resources:
    0
    thanks you guys, i will try these suggestions when I get back to work, just a little busy lately
    will update this thread as soon as I did these
    i hope thats okay with this site.
    thanks everyone!
     
  6. Hermit

    Hermit

    Joined:
    May 29, 2013
    Messages:
    1,023
    Resources:
    2
    Models:
    1
    Icons:
    1
    Resources:
    2
    You don't need any triggers for this; just set the 'Art - Propulsion Window (degrees)' field in the Object Editor to 0. However, make sure the shift key is pressed while opening the field.
     
    Last edited: Jan 15, 2019
  7. FeelsGoodMan

    FeelsGoodMan

    Joined:
    Dec 13, 2018
    Messages:
    80
    Resources:
    1
    Maps:
    1
    Resources:
    1
    If you want to go the trigger way I am sure you can just do this:

    • Face attacker
      • Events
        • Unit - A unit Is attacked
      • Conditions
        • (Unit-type of (Attacking unit)) Equal to Rifleman
      • Actions
        • Unit - Make (Attacking unit) face (Attacked unit) over 0.10 seconds


    Haven't tested it myself.
     
  8. xyke

    xyke

    Joined:
    Jan 13, 2019
    Messages:
    8
    Resources:
    0
    Resources:
    0
    I'm really not that good with JASS, at least for now.
    But the ensnaring the unit works great, they aint moving, they still attack, they're turning
    problem solve. thanks man!

    also, thanks to those who replied, i appreciate it

    how do I mark this solved? im new here lol
     
  9. Hermit

    Hermit

    Joined:
    May 29, 2013
    Messages:
    1,023
    Resources:
    2
    Models:
    1
    Icons:
    1
    Resources:
    2
    I think my solution is better, since Ensnare will leave a permanent buff in the status indicator.
     
    Last edited: Jan 18, 2019
  10. xyke

    xyke

    Joined:
    Jan 13, 2019
    Messages:
    8
    Resources:
    0
    Resources:
    0
    I tried that and it didn't work but thanks anyways. In the mean time, the ensnaring thing will do. I customized the buff, instead, the tooltip there tells info about the unit so it doesnt look like it's ensnared. I also removed the ensnare art effect so yeah, it's good. I also added a trigger that works periodically that when there's a scenario that the ensnare buff got purged or removed in any way from the unit. It will be ensnared again.
     
  11. Hermit

    Hermit

    Joined:
    May 29, 2013
    Messages:
    1,023
    Resources:
    2
    Models:
    1
    Icons:
    1
    Resources:
    2
    Trust me, it works. I used this trick many times and even tested it again just to make sure.

    You only need to change the propulsion window to 0; don't change any other field. You probably mistakenly changed the unit's movement speed and/or turn rate to 0; they should NOT be 0 in order for this to work.
     
    Last edited: Jan 20, 2019
  12. xyke

    xyke

    Joined:
    Jan 13, 2019
    Messages:
    8
    Resources:
    0
    Resources:
    0
    But that's my aim, I gotta make a unit that doesn't move but turns. If the movement speed is not 0. It will move at a slowest 75 speed. I cannot change the game constant's minimum speed lower than 75 because it's a MOBA game and having a minimum speed lower than 75 will be imbalance for the game.
     
  13. Hermit

    Hermit

    Joined:
    May 29, 2013
    Messages:
    1,023
    Resources:
    2
    Models:
    1
    Icons:
    1
    Resources:
    2
    I know it seems counterintuitive to set the movement speed to anything larger than 0, but I know what I'm talking about; the unit will NOT be able to move, only turn.

    If you still don't believe me, select any standard unit in the Object Editor (e.g. Footman, Ghoul, Archer, etc.), change its propulsion window to 0, (without changing anything else); place the unit somewhere on the map and test it.
     
    Last edited: Jan 22, 2019
  14. xyke

    xyke

    Joined:
    Jan 13, 2019
    Messages:
    8
    Resources:
    0
    Resources:
    0
    It worked and you were right! The reason why it didn't work for me before is because the unit's speed was 0. How come no one used or said this very simple solution before? Except you. Lol Both the ensnaring and this are good solutions. I will both take note of these for future use. But in my situation right now, I am definitely using your method Hermit. Thank you so much and apologize for taking a while for me to get it.
     
  15. Hermit

    Hermit

    Joined:
    May 29, 2013
    Messages:
    1,023
    Resources:
    2
    Models:
    1
    Icons:
    1
    Resources:
    2
    Tasyen mentioned 'SetUnitPropWindow', which is the exact same thing, but done with triggers.
     
  16. xyke

    xyke

    Joined:
    Jan 13, 2019
    Messages:
    8
    Resources:
    0
    Resources:
    0
    yeah i noticed, but i mean, no one suggested to do it like what you said. even in other sites/forums. this is the first time I saw this being suggested by someone. or maybe i jst missed theirs. thanks again Hermit. Do I have to mark this thread solved or something?
     
  17. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,007
    Resources:
    10
    Tools:
    2
    Maps:
    2
    Spells:
    5
    Tutorials:
    1
    Resources:
    10
    best you do.
     
  18. Death Adder

    Death Adder

    Joined:
    Nov 3, 2013
    Messages:
    820
    Resources:
    0
    Resources:
    0
    Footman 'Defend' ability works the same as ensnare without showing any buff, it can be quite useful if you want something like a Siege tank's Siege mode where the unit can move or only stay stationary depending on the toggle.

    Though this appears to already be solved.
     
  19. xyke

    xyke

    Joined:
    Jan 13, 2019
    Messages:
    8
    Resources:
    0
    Resources:
    0
    yeah but thanks anyway, that's another method, can be useful, ya never know