• 🏆 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] Morphing + Engineering Upgrade = Trouble?

Status
Not open for further replies.
Level 3
Joined
Oct 11, 2017
Messages
24
Greetings, everyone!

I have been working on a Hero with a "switch style" ability (a simple morph that changes the unit with a ranged version of itself), and I was hoping on using a "spell book hidden" Engineering Upgrade that changes each of their hero abilities into ranged versions.
both melee and ranged abilities have the same base spells (Acid Bomb, Rejuvenation, Flying Machine Bombs and Channel).

I have faced some issues, though:
  • for some reason, the fourth spell (maybe because it's a Channel?) does not get upgraded. [haven't tested changing it's index in the EU data, though]
  • when the hero goes back to melee, it "forgets" all their hero abilities, as if they weren't learned yet (they appear in the hero skills menu to be "relearned").

I was wondering how to overcome these issues, and the most "brute forced" solution is the last I wanna resort to: replace all hero skills for Attribute Bonus with value 0 and the hidden icon feature, and create a "update skills" trigger that adds/sets levels of the real (now unit-type) skills.
Before doing so, however, I'd like to know if any of you people has some suggestions/tips on this matter.
 
Last edited:
Level 3
Joined
Oct 11, 2017
Messages
24
Thanks for the link, but unfortunately Kessler's does not cover morphing issues.

I'll try the "level 1 with nothing" trick to see how it behaves though, so changing the level through a trigger on morphing would be a lot simpler than removing the EU through different unit abilities for each form in the Object Editor.
 
Level 39
Joined
Feb 27, 2007
Messages
5,023
does not cover morphing issues.
Yes it does, just not in the way you think. It describes how to use EU to alter a unit's abilities to function differently at will. Give both versions of the unit (ranged and melee) the same spells (including EU). When you morph, set the level of EU to 2 and when you un-morph set it back to 1. You might have to use the function I posted above to retain abilities between morphs, but if they're all in the unit's OE ability list you shouldn't.
 
Last edited:
Level 3
Joined
Oct 11, 2017
Messages
24
Alright, everything works nicely!

I've added a second level, and toggled between levels 1 and 2 through morphing.
The only issue I had is that the EU ability disappears if it's in a spell book, but that's a minor drawback.
Thread set as SOLVED, thanks for all the help!
 
Level 39
Joined
Feb 27, 2007
Messages
5,023
the EU ability disappears if it's in a spell book
Are you making the ability and the spellbook that holds it permanent? If you're doing that already then :confused:2 but otherwise:
  • Set AbilVar = ENGINEERING UPGRADE ABILITY
  • Set UnitVar = (Triggering Unit)
  • Custom script: call UnitMakeAbilityPermanent(udg_UnitVar, true, udg_AbilVar)
  • Set AbilVar = SPELLBOOK HOLDER ABILITY
  • Custom script: call UnitMakeAbilityPermanent(udg_UnitVar, true, udg_AbilVar)
Change the names in the lines to match your variables but keep the udg_ prefix.
 
Level 3
Joined
Oct 11, 2017
Messages
24
1670568149999.png

1670568192437.png

Works perfectly now, THANKS A LOT!
 
Status
Not open for further replies.
Top