• 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.

How do i change melee to ranged after equipping an item?

Status
Not open for further replies.
Level 11
Joined
Oct 31, 2010
Messages
1,057
(Solved)How do i change melee to ranged after equipping an item?

i want a unit to become ranged after he gets a item which is a bow
i tried unit replacement but it crashes my warcraft 3
i also tried using bear form but it doesnt change my unit to ranged for some reason. anyone help ?
--------------------------------------
event = when unit gets a item
condition = unit = archer
action = give ability (bear form)
-----------------------------------
event = when unit loses a item
condition = none
action =
if condition = unit is a archer and item being manuplated is bow
then = remove bear form from archer
else replace archer ranged with archer and remove bear form
------------------------------------------------------------
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
So no-one knows how to make DotA - Dwarven Sniper's Take Aim? It increases attack ranges without changing unit.
It uses Upgrades.
Upgrades cannot be undone.
Have you ever seen Sniper's attack range decrease after he level the spell ?
No, right ? That's why.

Also, can you drop Scepter from Echantress ?
You can't, does IceFrog gave you a reasonable reason why it can't be dropped ?

Because Scepter adds her attack range via Upgrade which cannot be undone.

If you are to drop the Scepter, people would assume her attack range would be decreased right ?

That's why he prevent that item from being dropped, smart IceFrog.
 
Level 11
Joined
Oct 31, 2010
Messages
1,057
oh thx defskull i placed wrong unit type at the different forms
Edit: Your test map doesnt work :C


but now i got another problem, when the unit changes to ranged form,
the another ability i wanted to give him which is searing arrows is gone also, the change form skill is gone too
 
Last edited:
Level 4
Joined
Aug 26, 2012
Messages
123
Hmm... searing arrow is for melee or ranged ones? it's confuse me...
(Well, whatever.
You can disable the ability, or remove it from that unit --another extreme way--
Then, when she changed again, reverse it... --reversed extreme way--)
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
but now i got another problem, when the unit changes to ranged form,
the another ability i wanted to give him which is searing arrows is gone also, the change form skill is gone too
Add this Custom script right before you give the transform ability to the unit;
  • Custom script: call UnitMakeAbilityPermanent(GetTriggerUnit(), true, YourAbilityID)
To see Ability ID, go to Object Editor and press CTRL + D
Go to that ability (Searing Arrows) and check its ID, if it's A000, well just replace the YourAbilityID with 'A000'.

Remember, you must put the ' ' enclosing the ability ID.

It will look something like this;
  • Custom script: call UnitMakeAbilityPermanent(GetTriggerUnit(), true, 'A000')
 
Level 11
Joined
Oct 31, 2010
Messages
1,057
Doesnt work :C
-----------------------------------------------------
Basically what is my problem is that after the hero changes to the ranged form and change back again to the melee form, it does not have the change form to ranged ability

Archer gains bow > give it a change form to ranged ability (solved) > change form has searing arrow and change form back to melee ability (solved) > changing back to melee, the melee does not have the change form to ranged ( Problem)


----------------------------------------------------------
i do have another way which is have 3 units and 2 units, one of the two has a change form to melee and another has a change form to ranged.
but this also creates another problem. When the unit drop the bow , condition is that the archer is not the real archer, then replace the unit that dropped it with the real archer. but this crashes my warcraft 3 for some reason.and i do not know how to make the game save all the item the fake unit has and create a new original archer with the old units items
 
Status
Not open for further replies.
Top