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

[Solved] fire bomb like spell

Status
Not open for further replies.
Level 5
Joined
Jan 2, 2013
Messages
84
so i got a blood mage to cast a spell(thunder clap). and then 2 seconds later all affected units will receive another damage. it didnt go well, i cant get a working trigger to detect all the units. i need a little help
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
for that you need local variables, if you use GUI try using shadowed variables:
  • Custom script: local group udg_TempGroup
  • Set TempLoc = (Target point of ability being cast)
  • Set TempGroup = Units in "Your Range" of TempLoc matching "Your condition"
  • Custom script: call RemoveLocation(udg_TempLoc)
  • Wait 2.00 seconds
  • Unit Group - Pick every unit in TempGroup and do actions
    • Loop - Actions
      • Unit - Make (Triggering unit) causes (Picked unit) a damage of "Your damage" with attack-type Spell and damage-type normal
To be more efficient:
  • Custom script: local group udg_TempGroup
  • Set TempLoc = (Target point of ability being cast)
  • Set TempGroup = Units in "Your Range" of TempLoc matching "Your condition"
  • Custom script: call RemoveLocation(udg_TempLoc)
  • Wait 2.00 seconds
  • Set TempUnit= (Triggering unit)
  • Unit Group - Pick every unit in TempGroup and do actions
    • Loop - Actions
      • Unit - Make TempUnit causes (Picked unit) a damage of "Your damage" with attack-type Spell and damage-type normal
For not use "Triggering unit" in every action of the loop
 
Last edited:
Level 5
Joined
Jan 2, 2013
Messages
84
that worked, but i dont know if its good for multiple units casting the same spell at once
 
Last edited:
Level 24
Joined
Jun 26, 2020
Messages
1,852
that worked, but i dont know if its good for multiple units casting the same spell at once
That will work because I used a local variable, local variable are uniques for every time the function is runned, basically are not overwritting if the trigger runs again before the 2 seconds:
PD: I miss add something more:
  • Custom script: local group udg_TempGroup
  • Set TempLoc = (Target point of ability being cast)
  • Set TempGroup = Units in "Your Range" of TempLoc matching "Your condition"
  • Custom script: call RemoveLocation(udg_TempLoc)
  • Wait 2.00 seconds
  • Set TempUnit= (Triggering unit)
  • Unit Group - Pick every unit in TempGroup and do actions
    • Loop - Actions
      • Unit - Make TempUnit causes (Picked unit) a damage of "Your damage" with attack-type Spell and damage-type normal
  • Custom script: call DestroyGroup(udg_TempGroup)
  • Custom script: udg_TempGroup=null
 
Level 5
Joined
Jan 2, 2013
Messages
84
oh, how i do the local variables? mines are "Set VariableSet TempGroup =" not setvariable tempgroup like yours
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
oh, how i do the local variables? mines are "Set VariableSet TempGroup =" not setvariable tempgroup like yours
Here you get the local variable:
  • Custom script: local group udg_TempGroup
And don't worry about this:
  • Set TempGroup = Units in "Your Range" of TempLoc matching "Your condition"
Is the same as this:
  • Set VariableSet TempGroup = Units in "Your Range" of TempLoc matching "Your condition"
but what I did is how you set variables in older versions.
 
Status
Not open for further replies.
Top