1. The 3rd Melee Mapping Contest is ON! Join in on a ride of a 4v4 melee experience!
    Dismiss Notice
  2. 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
  3. We have a new contest going on right now! Join the 11th Music Contest! You are to make a Cinematic modern sound-track for this contest, so come and compete with other people for fun.
    Dismiss Notice
  4. The Aftermath has been revealed! Choose which entry should win in the 19th Terraining Contest Poll.
    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 at 8:02 PM.

  1. xyke

    xyke

    Joined:
    Sunday
    Messages:
    2
    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

    Joined:
    Jun 13, 2016
    Messages:
    242
    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:
    595
    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 at 4:44 PM
  4. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    930
    Resources:
    9
    Tools:
    1
    Maps:
    2
    Spells:
    5
    Tutorials:
    1
    Resources:
    9
    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:
    Sunday
    Messages:
    2
    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:
    916
    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 at 7:10 PM
  7. FeelsGoodMan

    FeelsGoodMan

    Joined:
    Dec 13, 2018
    Messages:
    45
    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.