• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Make a unit unable to move?

Status
Not open for further replies.
Level 14
Joined
Aug 8, 2010
Messages
1,022
Hi! I want to ask how i can make a unit unable to move and unable to change it's angle (facing point) with GUI? Here is the trigger :
  • Untitled Trigger 001 Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Impale (for scorpion)
      • (Unit-type of (Casting unit)) Equal to Scorpion
    • Actions
      • Set StingerLoc = ((Position of (Triggering unit)) offset by 100.00 towards (Facing of (Triggering unit)) degrees)
      • Wait 0.50 seconds
      • Animation - Play (Triggering unit)'s Morph animation
      • Wait 1.00 seconds
      • Animation - Play (Triggering unit)'s Stand ALTERNATE animation
      • Unit - Create 1 Impale for Player 1 (Red) at (Position of (Triggering unit)) facing (Facing of (Triggering unit)) degrees
      • Unit - Order (Last created unit) to Undead Crypt Lord - Impale StingerLoc
      • Wait 1.00 seconds
      • Animation - Play (Triggering unit)'s Morph ALTERNATE animation
      • Wait 1.00 seconds
      • Animation - Reset (Triggering unit)'s animation
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
nedio95 said:
Why dont you put it 0 move speed ?

Actually this would probably be your best bet. If you simply want the caster to stop moving then you should eliminate the least amount of user control possible. Simply doing:

JASS:
call SetUnitMoveSpeed(yourUnit, 0)

Will stunt the unit from moving until it has its movement speed restored. Aura effects and other movement speed altering abilities may have an unwanted affect on how this operates, so it may be a little bit of additional triggering if you choose to do it this way.

You can also choose to use a dummy unit casting shadow strike or some other ability that alters movement speed to possibly eliminate that extra code. If you set shadow strike's slow to an enormous negative number then you could effectively remove the unit's movement speed and then restore it simply by removing the buff. This has the advantage of allowing the game to maintain the unit's movement speed, rather than possibly screwing things up by setting the unit's movement speed to 0.

Pausing the unit is amateur, the amount of control that is taken away from the unit (in addition to canceling order queues and other UI utilities) just makes it feel as if your unit is being taken from your control which screws up the flow of the game.

Take DotA's hero Pudge as an example. I think now they removed the pause altogether but the Pudge hero used to get paused upon using "Meat Hook". It was only for a split second, but the limit on the UI for even that split second has noticeable implications on game play.

Probably wrote a little too much for a such a simple question. Enjoy.
 
Status
Not open for further replies.
Top