• 🏆 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!

Switching from Melee to Ranged

Status
Not open for further replies.
Level 11
Joined
Aug 25, 2006
Messages
971
I can't figure out how to change a unit from melee to ranged and back again.

Everyone on the internet says "use orbzzzzz" but that doesn't work at all. That only works in the situation where the second attack and the first attack have different target types. (Like air/ground)

In my situation both attacks can target air and ground however one is ranged and the other is melee. When the unit picks up a particular item I want them to become ranged, otherwise be melee. The orb ability(s) does not accomplish this. Assuming the hero is by default melee, he will stay melee even when the second attack (ranged) is enabled.

Does anyone have any good fixes for this?
 
Level 11
Joined
Aug 25, 2006
Messages
971
Use orbzzzzzzz.

More specifically, make BOTH attacks disabled by default. Have one orb ability that enables the melee attack and another that enables the ranged attack. Add/remove them as necessary.

Alternately you could use the http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/hero-passive-transformation-198482/ method.

Thank you, that is exactly what I was looking for! Most other results talked about using orbs, but that was all they said. Your answer is much more informative.

even cared to use search? This topic has been asked so many times before...

Use meticulous double orb suggestion if you're sure that you won't be needing other orb effects in your map because orb effects do not stack, else use the passive transformation he linked...

I obviously did search, I even mentioned that I searched. Your answer was a waste of space since all it said was "do what the other person said."
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I obviously did search, I even mentioned that I searched. Your answer was a waste of space since all it said was "do what the other person said."
It's called an emphasizing a statement or a fact.
You asked for help and here we are, show some manner at least.

@Topic
I tried using double orb suggestion as Meti said but all it does is disable the User Interface of Attack Icon and no longer shows attack damage but the unit still be able to attack
Anyone knows how to fix this ?
This only related to double orb transformation, put aside the passive unit transformation, it works great (but still it requires 2 units which is not viable for ORPG or any roleplay game since you have to keep data on 2 units)
 
Level 11
Joined
Aug 25, 2006
Messages
971
It's called an emphasizing a statement or a fact.
You asked for help and here we are, show some manner at least.

@Topic
I tried using double orb suggestion as Meti said but all it does is disable the User Interface of Attack Icon and no longer shows attack damage but the unit still be able to attack
Anyone knows how to fix this ?
This only related to double orb transformation, put aside the passive unit transformation, it works great (but still it requires 2 units which is not viable for ORPG or any roleplay game since you have to keep data on 2 units)

I don't feel like starting a flame war so instead of arguing with you I will attempt to answer your question and ask my own.

The double orb trick does seem to have that exact effect unfortunately. The attack damage remains hidden. Even worse the method doesn't seem to work 100% or at least I can't get it. The two orb effects I tried (the new lightning orb and the slow orb) both have exactly the same problem. They ignore the "attack index enabled" field. They always activate the second attack index even when I set it to 1.

Even if that was resolved, the issue defskull pointed out is enough to turn me away from this method. I will attempt to use the passive transformation trick Meticulous mentioned. Hopefully that way the unit's handle stays the same. If it changes then it'll create an issue with a lot of the hashtable use in my map. That'll be fun to solve....

Edit: Ok after testing the passive transformation trick, that is the solution! It works like a charm. All unit handles remain the same, so attached data isn't lost! The only downside is that means you need two abilities per hero. (One for Melee->Ranged, and one for Ranged->Melee) but hey, that's what textmacros+lua+objectmerger are for right? This is good!
Edit2: One last tiny note "UnitMakeAbilityPermanent" Is a must otherwise the hero will lose abilities given to it by triggers.
 
Last edited:
Status
Not open for further replies.
Top