• 🏆 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] Is it possible to change the icon of an ability for only one unit?

Status
Not open for further replies.
Level 6
Joined
Jul 12, 2021
Messages
95
Is it possible to change the icon of an ability for only one unit?


I tried like this, but it doesn't work:
  • 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\BTNAbomination.blp
This function seems broke, doesn't do anything.


I tried like this, but it changes for all the units of one player:
  • Custom script: if (GetLocalPlayer() == Player(1)) then
  • Ability - Set Icon of Holy Light to ReplaceableTextures\CommandButtons\BTNAcolyte.blp
  • Custom script: endif
If the function GetLocalUnit() existed it would work.


I tried with the abililty Engineering Upgrade, but it doesn't work. The upgrades work for Icon - Research but not for Icon - Normal, which is what I want.


I tried a workaround of removing the ability I want the item icon to be changed and add an ability with the new icon. It worked, but didn't like this option.
 
Last edited:
Level 6
Joined
Jul 12, 2021
Messages
95
an easy workaround - just replace that specific unit with a clone of the original that is actually it's own unit type, and have that clone have the same ability with a different icon.
Thank you for your reply. Extremely interesting idea, I'll exploit it.

So far what's bothering me about this workaround is that when a hero gets replaced the glow changes. Any idea about how to prevent this?
 
Level 6
Joined
Jul 12, 2021
Messages
95
Using your second method, change the icon when selecting the unit.
Another brilliant idea! Thank you. It gets a little tricky when you select several units at the same time (drag-selection), because once you do this the UI shows all the units you have selected, and you can click on each one without triggering an event. Nevertheless, I'm sure I can exploit your idea too.



Everyone, more ideas please! Don't be shy ^^
 
Last edited:
Level 20
Joined
Jul 10, 2009
Messages
477
Instead of replacing the unit, you can kind of replace the ability.

Make a copy of the ability in object editor, change the icon as desired.
Ingame, hide the original ability for the specific unit only, add the copy to the unit.
If you want to undo, remove the copy, show the original.

  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Unit - For Footman 0000 <gen>, Ability Defend, Disable ability: True, Hide UI: True
      • Unit - Add Defend (Custom Copy) to Footman 0000 <gen>
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
Instead of replacing the unit, you can kind of replace the ability.

Make a copy of the ability in object editor, change the icon as desired.
Ingame, hide the original ability for the specific unit only, add the copy to the unit.
If you want to undo, remove the copy, show the original.

  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Unit - For Footman 0000 <gen>, Ability Defend, Disable ability: True, Hide UI: True
      • Unit - Add Defend (Custom Copy) to Footman 0000 <gen>
yeah that is the obvious solution... silly me...
 
Status
Not open for further replies.
Top