• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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