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

Ranged Weapon Problems

Status
Not open for further replies.
Level 4
Joined
Jul 9, 2008
Messages
88
Right now my map has the following troubles:
When my melee hero picks up the "Bow" item, i would like for him to automatically use a ranged attack. So far I have tried using the Orb of Lightning item but have made no progress, it only works on attacking air; I can't find a place to customize this.
Thanks for the help in advance.
 
Level 9
Joined
Apr 25, 2009
Messages
468
Have you tried to change the "Targets Allowed" in Object Editor?

~ Edit ~

Or you make a new unit that has the same model and all as the old one but with more attack rang, and you make this trigger:

  • Hero Gets Range Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Box
    • Actions
      • Unit - Replace (Hero manipulating item) with a Footman using The old unit's relative life and mana
      • Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
But, we must also replace him if he loses hes item, so, make this trigger too:

  • Hero Loses Range Item
    • Events
      • Unit - A unit Loses an item
      • Unit - A unit Pawns an item (to shop)
    • Conditions
      • ((Item-type of (Item being manipulated)) Equal to Bow) or ((Item-type of (Sold Item)) Equal to Bow)
    • Actions
      • Unit - Replace (Hero manipulating item) with a Footman using The old unit's relative life and mana
      • Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
This can be made alot more advanced, ask me if you want me to make the full triggers.
 
Level 4
Joined
Jul 9, 2008
Messages
88
Thanks, it MIGHT work, but may cause other problems.
He is a hero with 10 proper names, is there a way I can trigger in his random proper name after the metamorphasis?

EDIT: Thanks Hanibon, but yea I have. I changed the targets allowed to ground only
 
Level 13
Joined
Nov 4, 2006
Messages
1,239
the only way i can think of right now is saving the heroes ability levels, experience, stats and items in variables and replace the hero with an identical one which is ranged. kinda limited and (kind of) difficult if you have more than one hero type or more then one hero per player
 
Level 18
Joined
Mar 13, 2009
Messages
1,411
Anybody knows which thinks enable you to use the second attack instead of the first one? (Like the Tree Club thing or an ability used in DotA by the troll hero)
Then the second attack could be used for ranged attacks.
 
Level 9
Joined
Apr 25, 2009
Messages
468
Thanks, it MIGHT work, but may cause other problems.
He is a hero with 10 proper names, is there a way I can trigger in his random proper name after the metamorphasis?

EDIT: Thanks Hanibon, but yea I have. I changed the targets allowed to ground only

No that can't be done, sorry =/
 
Level 8
Joined
Nov 9, 2008
Messages
502
Use CHAOS ability if you wan't to change a unit into an almost identical unit. CHAOS allows for stats, names, exp, spell cooldowns and all to be saved in the transition.
 
Level 4
Joined
Jul 9, 2008
Messages
88
I have never heard of this "CHAOS" ability, but I'll try it out. Maybe in the end I'll have to have just 1 proper name per hero.
Thanks

EDIT: I have ended up using that CHAOS skill, but how do I give it to the hero and order him to use it? All you can do in GUI is order the hero to use generic spells like faerie fire and other stuff.
EDIT AGAIN: I have given up on the CHAOS ability, when I try to replace the unit like you said it causes a fatal wc3 error.
 
Last edited:
Level 8
Joined
Nov 9, 2008
Messages
502
Yes that's one unit that uses it. Also the tanks have Chaos to begin with but the requirement is that you research barrage. Once you do, the Chaos ability activates and changes the tank into Tank (barrage).

To use Chaos you simply change the field called something like 'new unit type' to whatever your ranged unit is then, using a trigger that fires when your unit picks up a bow or sometthing, give the unit Chaos et viola! you have a ranged unit from a melee unit. There's no need to make him use it or w/e. Remember to remove the tech requirement though.

To reverse the change I believe you just remove the specific Chaos ability.
 
Status
Not open for further replies.
Top