• 🏆 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!

[solved] Custom script : Adding 'Amov' back ?

Status
Not open for further replies.
Level 3
Joined
May 17, 2019
Messages
45
Hello,

I need to be able to add or remove the abilty 'amov' at will. Sometimes I want my unit to be able to move and sometimes I need it to be stuck completely.

Thus I used this custom script :

call UnitRemoveAbility(gg_unit_H002_0008, 'Amov')

It works fine.

The issue is that when I am giving the abilty back this way :

call UnitAddAbility(gg_unit_H002_0008, 'Amov')

It does not work !

I have also tried to use call SetPlayerAbilityAvailable(Player(0), 'Amov', true), but is has no effect at all.

Any help would be appreciated.

Thanks.
 
Level 13
Joined
May 10, 2009
Messages
868
It's not possible to add it back. Maybe this new native can be useful
JASS:
native BlzUnitDisableAbility                       takes unit whichUnit, integer abilId, boolean flag, boolean hideUI returns nothing
or set their propulsion window to 0.
JASS:
native          SetUnitPropWindow   takes unit whichUnit, real newPropWindowAngle returns nothing

// +
native          GetUnitPropWindow       takes unit whichUnit returns real
native          GetUnitDefaultPropWindow        takes unit whichUnit returns real
Just be careful with its GUI equivalent as it prevents you from setting a unit's prop window to 0.
 
Status
Not open for further replies.
Top