• 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.

Modifying abilities of individual units with triggers, but not other units who have the ability.

Level 7
Joined
Mar 16, 2014
Messages
169
The ability editing functions added in 2020 around the time of Reforged are very useful, but as far as I know and have been using them up until now, they edit that ability for all units.

According to this thread, you can edit it for a specific unit.

Changing Ability data with triggers.

I don't know how. I go up in GUI to any ability field, and it has no option for what unit to edit the ability for, just the ability in general, as seen below.

image.png
 
Level 7
Joined
Mar 16, 2014
Messages
169
Some of these set ability fields have that when you click on them, others don't. When I go to change the icon of an ability with the set Ability Icon action, there is no unit - get ability field, only event response - ability being cast.

image.png
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
No, I think that’s actually the wrong action. The correct one uses an Ability input (the actual instance of the ability), not an AbilityCode input (rawcode like Ability Being Cast returns). There is a ‘set unit ability field’ action you should see if you use the GUI action search box. They are sorted differently in the list and don’t appear if you choose the category and look over the list. I would type “ability” or “field” in the search and scroll through until you find them. Or maybe your game install is not up to date.

Note that some fields are fucked for GUI because the devs labeled the actions wrong, defined the internal ability field variable incorrectly, or pulled the wrong list of modifiable fields for that data type. These can be overcome with JASS/Lua custom scripts. Also what you want to change may be a ‘level’ field (even if the ability only has 1 level) so don’t forget to look there; to be certain you can increase the ability’s levels to >1 (revert afterward) and then any level-linked field will clearly show “Level N” text in the OE. Most, but not all fields are 0-indexed.
 
Level 7
Joined
Mar 16, 2014
Messages
169
JASS:
a
    Events
    Conditions
    Actions
        Ability - Set Ability: (Unit: Paladin 0000 <gen>'s Ability with Ability Code: Holy Light)'s String Level Field: Icon - Normal ('aart') of Level: 0 to ReplaceableTextures\CommandButtons\BTNMagicLariet.blp
        Ability - Set Ability: (Unit: Paladin 0000 <gen>'s Ability with Ability Code: Holy Light)'s String Level Field: Icon - Normal ('aart') of Level: 1 to ReplaceableTextures\CommandButtons\BTNMagicLariet.blp
        Ability - Set Ability: (Unit: Paladin 0000 <gen>'s Ability with Ability Code: Holy Light)'s String Level Field: Icon - Normal ('aart') of Level: 2 to ReplaceableTextures\CommandButtons\BTNMagicLariet.blp

Well, I found where to edit the ability raw code on icons, but actually testing it it seems to do nothing.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Many changes do not propagate until the ability is refreshed in some way. I would try level/delevel or disable (hide)/enable (show).

It could also just be nonfunctional. A search should show other threads of people trying to modify icons detailing their success.

What specifically are you trying to accomplish? There may be a relatively okay workaround.
 
Level 17
Joined
Mar 21, 2011
Messages
1,611
JASS:
a
    Events
    Conditions
    Actions
        Ability - Set Ability: (Unit: Paladin 0000 <gen>'s Ability with Ability Code: Holy Light)'s String Level Field: Icon - Normal ('aart') of Level: 0 to ReplaceableTextures\CommandButtons\BTNMagicLariet.blp
        Ability - Set Ability: (Unit: Paladin 0000 <gen>'s Ability with Ability Code: Holy Light)'s String Level Field: Icon - Normal ('aart') of Level: 1 to ReplaceableTextures\CommandButtons\BTNMagicLariet.blp
        Ability - Set Ability: (Unit: Paladin 0000 <gen>'s Ability with Ability Code: Holy Light)'s String Level Field: Icon - Normal ('aart') of Level: 2 to ReplaceableTextures\CommandButtons\BTNMagicLariet.blp

Well, I found where to edit the ability raw code on icons, but actually testing it it seems to do nothing.
This function is buggy, it doesn't work. You can only change icons globally.
What you can do is change the icon for a player with GetLocalPlayer(). You can achieve what you want with a Selection Event.
 
Top