• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Problems of switching ranged to melee mode.

I was creating a custom hero that can switch from ranged to melee mode or melee to ranged mode, when I clicked on the melee mode, it has a ranged melee attack but no damage. Is there any solution?

The Trigger:
Raiden Captain Ranged to Melee Attempt.png

The Video:
 
Nothing about your triggers will affect the Melee/Ranged status of a unit. All you're doing is Adding/Removing some unrelated abilities.

You can determine whether a unit is Melee or Ranged in the Object Editor by changing it's Combat settings:
1741605523440.png


For example, Demon Hunter is melee, but after using Metamorphosis he transforms into an entirely new unit that uses a Ranged attack. You could do this with your Hero as well.

Also, assuming you're on 1.31+, you can try to modify the Weapon using this Action but I recall it being buggy or at least needing extra steps:
  • Actions
    • Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attacks Enabled ('uaen')at Index:0 to Value: False
    • Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attacks Enabled ('uaen')at Index:1 to Value: True
 
Last edited:
Nothing about your triggers will affect the Melee/Ranged status of a unit. All you're doing is Adding/Removing some unrelated abilities.

You can determine whether a unit is Melee or Ranged in the Object Editor by changing it's Combat settings:
View attachment 516841

For example, Demon Hunter is melee, but after using Metamorphosis he transforms into an entirely new unit that uses a Ranged attack. You could do this with your Hero as well.

Also, assuming you're on 1.31+, you can try to modify the Weapon using this Action but I recall it being buggy or at least needing extra steps:
  • Actions
    • Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attacks Enabled ('uaen')at Index:0 to Value: False
    • Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attacks Enabled ('uaen')at Index:1 to Value: True
Even abilities have changed?
 
Even abilities have changed?
Yes, you only removed and added the abilities in the trigger. You didn't do anything to transform that unit in your trigger. You need to actually transform the unit into a different unit that has different attack range and weapon type, take metamorphosis as example.

I don't know what you base your Melee/Range Mode ability on. But if they're something like Bear/Crow form then you need to modify the unit's object data like uncle suggested.
 
Here's a way to do it on the latest patch without needing to use a Morph ability.

It's a little tricky and has the downside that the Hero Skill menu will always show the default hero abilities.

Note that this Action is buggy:
  • Unit - Set Unit: (Triggering unit)'s Weapon Real Field: Attack Range ('ua1m')at Index:0 to Value: 600.00
To get it working I had to change the Demon Hunter's "Attack 2 - Range" to 0.00, otherwise, that seemed to interfere with the "Attack 1" values.
 

Attachments

Back
Top