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

[Spell] AOE Damage Spell

Status
Not open for further replies.
Level 8
Joined
Jul 10, 2018
Messages
383
  • Awakening
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to awakening (Sogat)
    • Actions
      • Unit Group - Pick every unit in (Units within 777.00 of (Position of (Triggering unit)) matching (((Owner of (Matching unit)) is an enemy of Player 1 (Red)) Equal to True)) and do (Actions)
        • Loop - Actions
          • For each (Integer A) from 1 to 31, do (Actions)
            • Loop - Actions
              • Wait 0.56 seconds
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
              • Special Effect - Destroy (Last created special effect)
          • For each (Integer A) from 1 to 31, do (Actions)
            • Loop - Actions
              • Wait 0.56 seconds
              • Unit - Cause (Casting unit) to damage (Picked unit), dealing (20.00 x (Real((Agility of (Casting unit) (Exclude bonuses))))) damage of attack type Spells and damage type Normal
The Special effect not appearing and the damage not applying.
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
If you bothered to read the grey text, you would notice it says you shouldn't use waits in "pick every unit/player/destructible" action.
It's very important to read before trying to use something you're not fully aware of.
 

Attachments

  • Read.png
    Read.png
    9.7 KB · Views: 24
Level 6
Joined
Dec 31, 2017
Messages
138
  • Awakening
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to awakening (Sogat)
    • Actions
      • For each (Integer A) from 1 to 31, do (Actions)
        • Loop - Actions
          • Wait 0.56 seconds
          • Set TempPoint = (Position of (Triggering unit))
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 777.00 of TempPoint matching (((Owner of (Matching unit)) is an enemy of Player 1 (Red)) Equal to True)) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Casting unit) to damage (Picked unit), dealing (20.00 x (Real((Agility of (Casting unit) (Exclude bonuses))))) damage of attack type Spells and damage type Normal
          • Custom script: call RemoveLocation(udg_TempPoint)
bj_wantDestroyGroup and RemoveLocation are used due to Things That Leak
 
Level 3
Joined
Apr 7, 2020
Messages
32
To add to the advice here you should also make sure you're using more matching conditions in your Unit Group.

I'm not sure what you're going for but Boolean checks like Is Alive = True and Is a Structure = False go a long way. Especially the alive check so you don't have special effects going over invisible corpses.
 
Level 8
Joined
Jul 10, 2018
Messages
383
  • Awakening
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to awakening (Sogat)
    • Actions
      • For each (Integer A) from 1 to 31, do (Actions)
        • Loop - Actions
          • Wait 0.56 seconds
          • Set TempPoint = (Position of (Triggering unit))
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 777.00 of TempPoint matching (((Owner of (Matching unit)) is an enemy of Player 1 (Red)) Equal to True)) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Cause (Casting unit) to damage (Picked unit), dealing (20.00 x (Real((Agility of (Casting unit) (Exclude bonuses))))) damage of attack type Spells and damage type Normal
          • Custom script: call RemoveLocation(udg_TempPoint)
bj_wantDestroyGroup and RemoveLocation are used due to Things That Leak
you're not supposed to put wait inside of loop and you have wait in that integer loop
 
Level 8
Joined
Jul 10, 2018
Messages
383
If you bothered to read the grey text, you would notice it says you shouldn't use waits in "pick every unit/player/destructible" action.
It's very important to read before trying to use something you're not fully aware of.
Well yeah i read them but still i can't think of a solution to make the ability except like this.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,501
You'll want to use a periodic timer and some variables.

AwakeningCaster = Triggering Unit (Unit)
AwakeningPoint = Position of Triggering Unit (Point)
AwakeningCounter = 0 (Integer)

Turn on your periodic timer -> Have it run your "Pick every unit -> Deal damage" actions referencing these variables whenever it expires. Then increase AwakeningCounter by 1 each time. And finally check if AwakeningCounter is equal to 31 and turn off the timer.

If you want it to be MUI (work for multiple units) then you apply this same logic but incorporate Arrays. You can use any of the methods below to do so, although it depends on what you want to do:

Visualize: Dynamic Indexing
GUI Unit Indexer 1.4.0.0
A Complete Beginners Guide to Hashtables

I attached three example maps. One uses Dynamic Indexing, another uses a Unit Indexer, and the last one uses none of these systems (Simple).

Simple only works for a single unit but only if the abilities cooldown is longer than it's duration.

Unit Indexer works for multiple units but only if the abilities cooldown is longer than it's duration.

Dynamic Indexing works for multiple units and will work regardless of the cooldown/duration.

  • Awakening Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Awakening
    • Actions
      • Set VariableSet Awa_Caster = (Triggering unit)
      • Set VariableSet Awa_Counter = 0
      • Set VariableSet Awa_Point = (Target point of ability being cast)
      • -------- --------
      • -------- This is just an extra visual effect to make it look cool --------
      • Special Effect - Create a special effect at Awa_Point using Abilities\Spells\Other\Monsoon\MonsoonRain.mdl
      • Set VariableSet Awa_RainSfx = (Last created special effect)
      • -------- --------
      • Trigger - Turn on Awakening Timer <gen>
This timer trigger needs to be set to Initially OFF. It's a check box near the top of the trigger next to Enabled, uncheck it to turn it off.
  • Awakening Timer
    • Events
      • Time - Every 0.56 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Awa_Counter Less than 10
        • Then - Actions
          • -------- The Awakening effect is still going --------
          • Set VariableSet Awa_Counter = (Awa_Counter + 1)
          • -------- --------
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 777.00 of Awa_Point.) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) belongs to an enemy of (Owner of Awa_Caster).) Equal to True
                  • ((Picked unit) is alive) Equal to True
                  • ((Picked unit) is invulnerable) Equal to False
                  • ((Picked unit) is hidden) Equal to False
                  • ((Picked unit) is A structure) Equal to False
                • Then - Actions
                  • Unit - Cause Awa_Caster to damage (Picked unit), dealing 20.00 damage of attack type Spells and damage type Normal
                  • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
        • Else - Actions
          • -------- The Awakening effect has finished --------
          • Special Effect - Destroy Awa_RainSfx
          • Custom script: call RemoveLocation (udg_Awa_Point)
          • Trigger - Turn off (This trigger)
 

Attachments

  • Awakening Example SIMPLE.w3m
    20.8 KB · Views: 13
  • Awakening Example UNIT INDEXER.w3m
    25.7 KB · Views: 10
  • Awakening Example Dynamic Indexing.w3m
    21.8 KB · Views: 10
Last edited:
Level 1
Joined
Apr 8, 2020
Messages
110
Reference: Quick Tutorial - Common Triggering Tips

  • OnCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • For each (Integer A) from 1 to 31, do (Actions)
            • Loop - Actions
              • Trigger - Run Actions <gen> (ignoring conditions)
  • Actions
    • Events
    • Conditions
    • Actions
      • Wait 2.00 seconds
      • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 2.00 seconds
      • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
 
Level 8
Joined
Jul 10, 2018
Messages
383
Reference: Quick Tutorial - Common Triggering Tips

  • OnCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • For each (Integer A) from 1 to 31, do (Actions)
            • Loop - Actions
              • Trigger - Run Actions <gen> (ignoring conditions)
  • Actions
    • Events
    • Conditions
    • Actions
      • Wait 2.00 seconds
      • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 2.00 seconds
      • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
I fixed it thanks!
 
Status
Not open for further replies.
Top