• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Making unit immobile but can attack

Status
Not open for further replies.
Level 6
Joined
Jan 2, 2015
Messages
171
Anyone knows how to make my hero become immobile but can still attack like towers after using transformation spell based of tinker robo goblin spell. I tried to use dummy unit to web my hero after he use that robo goblin spell but after hero got web debuff, hero cant use the robo goblin spell to return to his original form. any idea?
 
Level 18
Joined
Nov 21, 2012
Messages
835
JASS:
//  DisableUnitMovement /* v1.0.0.1
//    *   Disables unit movement. They can still turn, but will stay in
//    *   place. It simulates an ensnare-like effect, except that it will
//    *   not ground units, it does not have buffs, does not interrupt
//    *   channeled casts and appears to have no downsides.
//    *   Full credits to WaterKnight for discovering this technique.
//--------------------------------------------------------------------      
function DisableUnitMovement takes unit u returns nothing
    call SetUnitPropWindow(u, 0)
endfunction
//--------------------------------------------------------------------   
function EnableUnitMovement takes unit u returns nothing
    call SetUnitPropWindow(u, GetUnitDefaultPropWindow(u) * bj_DEGTORAD)
endfunction
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
The Prop Window is the angle in which you can cast spells and attack etc.
So you can have a Prop Window difference between your facing angle and the angle between you and the target.

That it stops the movement of said unit, is just something weird assuming the unit never really faces that angle (but it can rotate... and it doesnt apply on movement).
 
Level 6
Joined
Jan 2, 2015
Messages
171
JASS:
//  DisableUnitMovement /* v1.0.0.1
//    *   Disables unit movement. They can still turn, but will stay in
//    *   place. It simulates an ensnare-like effect, except that it will
//    *   not ground units, it does not have buffs, does not interrupt
//    *   channeled casts and appears to have no downsides.
//    *   Full credits to WaterKnight for discovering this technique.
//--------------------------------------------------------------------     
function DisableUnitMovement takes unit u returns nothing
    call SetUnitPropWindow(u, 0)
endfunction
//--------------------------------------------------------------------  
function EnableUnitMovement takes unit u returns nothing
    call SetUnitPropWindow(u, GetUnitDefaultPropWindow(u) * bj_DEGTORAD)
endfunction

do you have GUI Version for it? i am not JASS user. hehe
 
Status
Not open for further replies.
Top