• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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