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

Damage units in a group once in a triggered wave spell?

Status
Not open for further replies.
Level 9
Joined
Sep 28, 2004
Messages
365
Hi all,

Normally making a triggered wave spell or charge spell requires to use periodic event. Most people use any number <= 0.05sec.

I tried to create a charge spell, the charge works perfectly. But when i add nearby enemy units in group that is near the caster that use charge, and i damage the group. The enemy units who are in the group will get damage too many times because of the periodic event.

Is there a way to limit so that the enemy in group will only be damage once? For example I want it to do 400damage to nearby enemy units in a line. Not 400 multiply 3-4 times because of the periodic event.

Also i do not want all units in group to be damage instantly, that is why i didn't damage the group only when the charge ends. I want them to get damage when they are near the caster or effect. Something like carrion swarm where it will only damage every unit in the area once and only damages them when the effect passes by not instantly. Or something like shockwave.<< correct me if i am wrong. I m trying to do something like this.

Also i would like to know if i use
  • Set Group = (Units within 500 of caster matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Owner of (caster))) Equal to True))))
Will it replace all units previously in group? If yes, then i guess my question has been answered. Also if yes, will it leak? since previous units are not in group anymore? or they have been remove from the group automatically?

Too long Didn't Read: Damage problem in a charge spell, damaging units in group too many times because of periodic event that happens too fast. How do i fix this?

No idea where is the trigger tag >< sorry.
Sorry for bad English, i am trying my best to explain my problem ><
Help or tips will be much appreciated.
 
Last edited:
Level 9
Joined
Sep 28, 2004
Messages
365
@DragoonZombie
Thats a neat idea, thanks alot!

@Adiktuz
Thanks for the trigger tag tip! yap i am gonna use his answer


Will the Set Unit Group replace all units in group previously? Will it leak if there are units in the Group after i use set unit group? What happen to the replaced units in the group? Do they automatically get removed?

Thanks again guys!
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Create a local unit group when the spell starts and tie it to the caster with hashtable. Add units to it when they get damaged and destroy it when the spell ends. That way it won't leak and is MUI. If you use global group it won't be MUI. Or you can use global unit group array and recycle it between casters.
 
@DragoonZombie
Thats a neat idea, thanks alot!

@Adiktuz
Thanks for the trigger tag tip! yap i am gonna use his answer


Will the Set Unit Group replace all units in group previously? Will it leak if there are units in the Group after i use set unit group? What happen to the replaced units in the group? Do they automatically get removed?

Thanks again guys!

set unitgroup will remove units from the group... just use

  • Unit Group - Add Unit/Group to Unit Group
and I would prefer doing what Maker said.
 
Thanks adiktuz once again!
I guess i am good to go for a MUI charge with correct damage now. Gonna try it out.

There is one thing i don't understand in hashtable. What does this Key distance, angle, time string ID return? I see this in alot of knockback MUI spell tutorial.

From what I understand they return the key of the handle of those objects which is unique for each handle so they return different values for each handle... example unit1 has a different handle key from unit2 so you can save different set of data for each handle....

  • Hashtable - Save damage as 0 of Key(Unit1) in hashtable
  • Hashtable - Save damage as 0 of Key(Unit2) in hashtable
since Key(Unit1) is different from Key(Unit2) saving the value for unit1 will not affect the value for unit 2....
 
Status
Not open for further replies.
Top