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

Switch activated attacks

Status
Not open for further replies.
Level 8
Joined
May 7, 2008
Messages
108
I'd like to know if there is any possible way to switch between the two activate attacks that you can preset in the Unit editor, preferable in GUI (custom script line). For instance, I'm adding the possibility to a sentry gun to switch between automatic (attack 1 with lower damages, but no cooldown) and burst mode (attack 2 with higher damages, 1,5 second cooldown).

Maybe there is another way to do it without the triggers but I didn't find out about it yet...
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
The engine doesn't give any straight ways to switch between attacks by pressing a button. They just switch automatically depending on potential damage output.
However, you can use the orb abilities to enable/disable attacks.
Such as the one on orb of lightning.

You just make a dummy ability and then use a trigger that adds/removes the orb when you use it.
 
Level 8
Joined
May 7, 2008
Messages
108
When I want to set the attack index to "1" in the orb spell, it doesn't actually activate the first attack... Even if I remove the other orb spell activating the second attack.
Any help ?

Triggers :
2SHoG

2SHov


The problem obviously comes from the Spell Editor since the triggers work and when I set the attack index to "0", it just doesn't activate any attack at all. But when I set it to 1, it activates the second attack.
 
Last edited:
Level 8
Joined
May 7, 2008
Messages
108
I'm not sure why it could be so, as I've not used this way myself(only know the theory). I prefer to just morph units passively when I need to switch attacks.

I'll try this.

umm if ur switching the abilities, y do u remove then add the other ability then remove that ability and add the one u just used ?

its a circle lol. shouldnt u just remove the ability and add the other one ?

If you look closely, it's two different kind of abilities. The "(orb)" ones are used to activate the attacks, which are the item orb spells, and the other ones without the "(orb)" at the end are visible abilities; you click on them to switch between automatic and burst mode, and thus when you click on one, it disappears to make the other one appear.
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
The only way I can see is set its attack 1 to ground units and attack 2 to air. So when the unit battles with a ground, it will use its attack 1 and its attack 2 when it is battling an air unit. Thats the way I learn from the Doom Guard's atack if you will notice.
 
Drogen designed a bandit that switched between ranged and melee. He did it with a morph function in object editor. With identical units you can morph back and forth with no noticeable difference besides the attack. See my map http://www.hiveworkshop.com/forums/maps-564/kalimdor-islands-233684/ He's called Gaurd or something like that and is in the dwarfe race. Anyway, thats an overly simplistic way to get a unit to switch between attacks. I think this might work for your purpose.
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
Drogen designed a bandit that switched between ranged and melee. He did it with a morph function in object editor. With identical units you can morph back and forth with no noticeable difference besides the attack. See my map http://www.hiveworkshop.com/forums/maps-564/kalimdor-islands-233684/ He's called Gaurd or something like that and is in the dwarfe race. Anyway, thats an overly simplistic way to get a unit to switch between attacks. I think this might work for your purpose.

Hmm, that seems what he want. Good job!
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Drogen designed a bandit that switched between ranged and melee. He did it with a morph function in object editor. With identical units you can morph back and forth with no noticeable difference besides the attack. See my map http://www.hiveworkshop.com/forums/maps-564/kalimdor-islands-233684/ He's called Gaurd or something like that and is in the dwarfe race. Anyway, thats an overly simplistic way to get a unit to switch between attacks. I think this might work for your purpose.

This is what I referred to as passively morphing. Basically you make a morph ability based on bear form and change the "Alternate form" field to what you want to morph to.
Then you add and remove the ability to who you want to morph.
That is all it takes.

In your case you need 2 abilities and 2 unit types. First ability switches to first type, second to second. The only difference between the 2 unit types is that one is a ranged unit and the other is not.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Here's the prove you cannot have only 1 ability per transformation.

Instructions:
1. Order the Blood Mage to cast the Channel spell
2. Blood Mage will transform to Paladin
3. And when Paladin casts the Channel spell
4. Nothing happens


I may have misunderstood your statement, but still, it's wrong.
Here's the prove you cannot transform into another unit with a wrong field (this means, the Unit A and Unit B must be specified in the Object Editor).
Morphing from is essential for this trick to work.
You can't just set the base unit to any unit for it to transform to another unit if the Base Unit does not get set with a correct value in the Object Editor.

You must specify its Base Unit and Morph Unit unique with the ability.
That's why I said it needs 2 abilities per transformation (in case with switch-back to Base Unit and vice-versa).
 

Attachments

  • Hero Passive Transformation 1 Ability.w3x
    12.4 KB · Views: 53
Last edited:
Level 16
Joined
Nov 7, 2011
Messages
219
I'd like to know if there is any possible way to switch between the two activate attacks that you can preset in the Unit editor, preferable in GUI (custom script line). For instance, I'm adding the possibility to a sentry gun to switch between automatic (attack 1 with lower damages, but no cooldown) and burst mode (attack 2 with higher damages, 1,5 second cooldown).

Maybe there is another way to do it without the triggers but I didn't find out about it yet...

Why don't you make two units? And let them switch(Morph) into each other via Morph Spell(Bear Form, Crow Form, etc.)
 
Status
Not open for further replies.
Top