ranged to melee & vice versa

Exfyre

hmm...
Reaction score
60
I've read up on different people's failures in trying to create a way to allow a unit to have a switchable melee/ranged attack. What I'd like to know is how DotA does it with the Troll. All his status buffs are kept after changing, so I assume it doesn't create units with different types of attacks. I also know that machine bombs are out of the question, because after experimenting with them for 30+ minutes, I've found that upgrade levels can't be removed. Any enlightenment on how this magical DotA game does this would be very nice.
Thx in advance.
 

TideOfChaos

New Member
Reaction score
25
Simple. Make sure the Hero has 2 attacks. Both the same, but one ranged and on melee. Only enable the first (melee) attack.

Then base the ability off anything you like that has no target, and remove the effects of it.

Then make a custom upgrade, call it whatever you want, and give it the effect:
Effect 1 - Enable Attacks
Effect 1 - Attacks to Enable - Attack 2 only

Give the upgrade to the unit.
Then when the unit casts the ability, check the level of the upgrade.
If it is = to 0, the set it to 1
If else, set it to 0
Trigger:
  • Player - Set the current research level of Attack to 1 for (Owner of (Triggering unit))
 

Exfyre

hmm...
Reaction score
60
@TideOfChaos
I also know that machine bombs are out of the question, because after experimenting with them for 30+ minutes, I've found that upgrade levels can't be removed.
Research levels can't be set to zero once they are higher than zero

@Summoned
Very neat idea I'll try it out


EDIT: It worked! thanks and +rep
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top