• 🏆 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] Is it possible to make a hero user interface icon for a unit?

Level 8
Joined
May 20, 2012
Messages
78
I want to give a normal unit a hero icon in the interface (the top left one). I tried doing it with a dummy hero via triggers, but there's a delay when deselecting the dummy hero to select the unit, and tbh looks kind of crappy. I saw a post 6 years ago that said there wasn't a solution to this. Has this changed after reforged? Or is it still solution-less?
 
Level 12
Joined
May 7, 2008
Messages
334
I want to give a normal unit a hero icon in the interface (the top left one). I tried doing it with a dummy hero via triggers, but there's a delay when deselecting the dummy hero to select the unit, and tbh looks kind of crappy. I saw a post 6 years ago that said there wasn't a solution to this. Has this changed after reforged? Or is it still solution-less?

As far as I know only Heroes can have portraits on the upper left side of the screen.

You can trigger this of course to your liking by using RUID but it will take you time and some basic understanding of JASS code.
 
Level 39
Joined
Feb 27, 2007
Messages
5,023
Morph a hero (alternate) into a unit (normal). It retains the hero icon to the left.
Just tested this and you're right! There are side effects that I found, though. The unit inherits the original hero's armor value as well as its max health & mana. It keeps the original hero icon of course and does not change that to the unit's icon.

So @Locrito I think you would be best off using a donor hero with exactly the stats you want your unit to have, but with the real unit's icon.
 
Level 8
Joined
May 20, 2012
Messages
78
Thanks a lot. I have one more question. Is it possible with editor 1.27? or is latest patch necessary? Or am I missing something? Because I try to morph a unit into a hero, but don't have the values in the object editor when creating a new unit.
 
Level 8
Joined
May 20, 2012
Messages
78
Thanks a lot! Worked almost perfectly. Just one little thing. The unit it's transforming to has no mana. Is there a way to delete the blue bar under the hero icon up left that represents mana?

EDIT

I have tried to make a 64x8 transparent blp image and replace it in the following path: UI\Feedback\ManaBarConsole\human-manabar-fill.blp

However, doesn't seem to work, as it still shows the mana bar.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,563
Thanks a lot! Worked almost perfectly. Just one little thing. The unit it's transforming to has no mana. Is there a way to delete the blue bar under the hero icon up left that represents mana?

EDIT

I have tried to make a 64x8 transparent blp image and replace it in the following path: UI\Feedback\ManaBarConsole\human-manabar-fill.blp

However, doesn't seem to work, as it still shows the mana bar.
Wouldn't you just have to get rid of the Mana on the Hero?
 
Level 8
Joined
May 20, 2012
Messages
78
Wouldn't you just have to get rid of the Mana on the Hero?
Tried it, but still shows up there.

UPDATE: One workaround I found was putting a hero of any team on the map. After that, the mana bar shows black, which is ok. However, if that hero is removed from the map, the game crashes.

This makes me wonder, I have maps in which a unit combines with another one (kind of like Archer-Hippo dynamic), this method of showing hero UI won't work, right? Because it would bug completely everytime the units combine and separate.

UPDATE 2: This method makes it impossible to CREATE a unit via triggers, and make it morph. For some reason game crashes instantly as soon as I try to morph a created unit via triggers.
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,023
UPDATE 2: This method makes it impossible to CREATE a unit via triggers, and make it morph. For some reason game crashes instantly as soon as I try to morph a created unit via triggers.
The method I linked?

Edit: It seems to crash any time a hero is created for the player that owns the morphed unit. You can bypass this bug in a couple of ways:
  • Change owner of the morphed unit any time new heroes need to be made, then change back. Should be instantaneous but might change hero UI order?
  • Create new heroes instead for some neutral player and then change ownership of them to the players that have these morphed units.
 
Last edited:
Level 8
Joined
May 20, 2012
Messages
78
The method I linked?

Edit: It seems to crash any time a hero is created for the player that owns the morphed unit. You can bypass this bug in a couple of ways:
  • Change owner of the morphed unit any time new heroes need to be made, then change back. Should be instantaneous but might change hero UI order?
  • Create new heroes instead for some neutral player and then change ownership of them to the players that have these morphed units.

The problem I have right now is that everytime both units combine, the unitial unit that was morphed "dies", therefore crashing the game. 😫

EDIT: The crash seems to happen because I'm setting a unit variable to the new combined unit? I'm still not sure.

EDIT 2: Another issue is that when the unit "dies" when combining with the other one, the UI icon is still there, and when the unit de-combines, forming the two units again, it crashes when setting a unit variable to the unit that has the hero icon (the morphing unit)

EDIT 3: Maybe this explains it better:

Unit 1: Unit I want to have a hero UI icon for (transforming unit)

Unit 2: Unit that fuses with unit 1 to create unit 3.

Unit 3: Fused unit.

How it goes.

1. Unit 1 morphs with no issues.

2. I click on the ability that combines unit 1 and unit 2 (based on mount archer ability)

3. Unit 3 is created. I want this unit 3 to also have a Hero UI icon. However, Unit 1's UI icon doesn't disappear.

4. I set via triggers a variable for unit 3, let's say "FUSED UNIT = UNIT 3"

5. I add and remove morphing ability to it via triggers so that it gets a hero icon (remember last hero icon for Unit 1 is still there, but I don't want it to, but I still go on).

This last step, for some reason, causes the game to crash.

EDIT 4: DUE TO THE MASSIVE AMOUNT OF CRASHES IT CREATED IN MY PROJECT BECAUSE OF THE AMOUNT OF VARIABLES LINKED TO THE UNIT, I DECIDED TO ABANDON THIS IDEA. Sad, but thanks to everyone anyways!
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,023
DUE TO THE MASSIVE AMOUNT OF CRASHES IT CREATED IN MY PROJECT BECAUSE OF THE AMOUNT OF VARIABLES LINKED TO THE UNIT, I DECIDED TO ABANDON THIS IDEA.
Please reread my reply. The crash has nothing to do with assigning variables (I thoroughly checked that) and is quite controllable/reproducible: any heroes created for players that one one of these pseudo-heroes will crash the game (this includes hiring from shops and altars). I was able to chain-morph Bloodmage > Archer > Glaive Thrower without causing a crash at all, and then swapping the unit's owner to a different player and back updated the UI icon to show the Glaive Thrower.

The issue is trying to use the archer/hippogryph combine spells. I think it's important to ask what exactly you're doing with this combineable non-hero that needs to have a UI icon. Why does it need to combine using that specific method instead of any of the other morphing spells? Hippogryph requires 3 abilities total and yes technically removes the 2 source unit(s) from existence (which would mess up any variables pointing to those units) with some logic about total HP % being shared/equalized between forms.

This method seems like it should work:
  1. Create a hero.
  2. Transform that hero into the base unit using the method I linked here.
  3. When the base unit needs to transform, morph it passively again with a different reverse-morph ability into unit type 3.
  4. Change the owner to someone else then immediately change back to refresh the icon.
  5. When 3 needs to transform back to 1, passively morph it with a third reverse-morph ability.
  6. Change the owner to someone else then immediately change back to refresh the icon.

  7. Repeat 3-6 throughout the game as necessary.
  8. If a hero unit ever needs to be created for this player, transfer ownership of this pseudo-hero to some other player while any heroes are made.
 
Level 39
Joined
Feb 27, 2007
Messages
5,023
I looked through my saved WC3 links and I found this interesting thread that might provide some other insight/ideas you can benefit from, @Locrito:
 
Top