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!