Thunderstorm

Level 5
Joined
Jul 11, 2009
Messages
81
Hey Guys!
I am working on my map and i am trying to make a spell similar to Thunderstorm from world of warcraft - http://www.wowhead.com/spell=51490/thunderstorm but i cant make it at all :( Please i need somebody to make this spell for me in GUI version :) I just want the spell to be AOE, to damage enemies on the selected area and to knock them back from the center of selected area in some distance :thumbs_up:

Reward
:fp: I'll give credits +rep!
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,214
There are Knockback systems (GUI) you can use in the Spell section, the damage can be dealt easility with "Unit - damage unit" or "Unit - Damage Area" and the effect can be created with "Special Effect". :)
 
Level 5
Joined
Jul 11, 2009
Messages
81
Spartipilo, bro i am not so noobish as you think :D I actually didn't make the damage to be dealt in Area cuz then it gonna damage friendly units too, right? I used the "pick unit group" in "target area ability beign cast" and "if/then/else". I did the special effects too, but i can't make the knockback properly :(
 
Level 5
Joined
Sep 27, 2011
Messages
141
Use the angle between tartet point and picked unit. Point with polar offset position of picked unit offset by(xxx) towards above angle. Put this in the loop trigger and i guess u could use this with your damage group or make a separate one if u want. That should work then off course just remove leeks.
 
Level 5
Joined
Jul 11, 2009
Messages
81
I made the spell + knockback, but it pulls back just one enemy unit .. not all units ;o and i used the Unit Group - Pick every unit. Here is the spell - just check out that it works on one troll, but on the multiple group of trolls it pulls just one and does only damage to the others. Please, fix it for me cuz i dunno exactly how.
Also I used as base some other triggers but ofc i am gonna give them credits :p
Please guys, help me
 

Attachments

  • Thunderstorm.w3x
    21.7 KB · Views: 88
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,214
You can trigger AoE damage and filter units with "Matching = Enemy, and Matching = Alive" You can also add "Matching = Ground Unit", or Hero, or Flying, or Ethereal, or whatever.

There's a tutorial to do GUI Knockback in tutorial section :p I would love to do it, show you, and everything else... but can't do it right now


EDIT
You're kockbacking only 1 unit because you're setting the unit into a variable, in a different loop. The "Thunderstorm Knockback" pushes back the last unit that was added into the Knockback Unit variable in the "Pick Every Unit" loop. The best way to do this is using Hashtables.


This is an example of Hashtables, MUI, and Knockback. Adapt it to what you want, shouldn't be that hard =).


Btw, i love the lightning effect of your skill :p
 
Level 20
Joined
Jul 14, 2011
Messages
3,214
Dude... I can do it... but the Tutorial already includes a Knockback example... I would do the same, and I'm not :p The tutorial includes also a Map example!
 
Level 5
Joined
Jul 11, 2009
Messages
81
Man, it includes knockback that is single targetable, i don't need single targetable knockback, but multiple AOE knockback that knockbacks the units from targeted area. I can't make it at all, cuz i dunno how to use the triggers from the tutorial map, that u gave to me, so and I need a little help .. :|
 
Level 20
Joined
Jul 14, 2011
Messages
3,214
There, I edited the Knockback in the Hashtable MUI tutorial to make it AoE. Didn't used the editor... but I guess it should work.

  • KnockbackTarget
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Knockback
    • Actions
      • -------- Just for configuration/readability --------
      • Set Point1 = Target point of (Ability Being Cast) // Point Variable \\
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in 400 distance from Point1) and do (Actions)
        • Loop - Actions
          • Set u = Picked Unit // Unit Variable \\
          • Custom script: set udg_i = GetHandleId(udg_u)
          • Set Point2 = Position of u // Point Variable \\
          • Set KnockbackAngle = (Angle from Point1 toPoint2) // Real Variable \\
          • -------- Distance unit is knocked back per second --------
          • -------- .04 is how often the units are moved, so we multiply the distance by .04 --------
          • Set KnockbackDistance = (200.00 x 0.04) // Real Variable \\
          • -------- How long the unit is knocked back for --------
          • Set RemainingTime = 2.00 // Real Variable \\
          • -------- Store the values --------
          • Hashtable - Save KnockbackDistance as 0 of i in knockbackTable
          • Hashtable - Save KnockbackAngle as 1 of i in knockbackTable
          • Hashtable - Save RemainingTime as 2 of i in knockbackTable
          • Unit Group - Add u to KnockbackUnits
          • Custom script: call RemoveLocation(udg_Point2)
        • Custom script: call RemoveLocation(udg_Point1)
        • Trigger - Turn on KnockbackUnits <gen>
  • KnockbackUnits
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in KnockbackUnits and do (Actions)
        • Loop - Actions
          • Set u = Picked Unit
          • Custom script: set udg_i = GetHandleId(udg_u) // Integer Variable \\
          • -------- Load all necessary variables stored in the Hashtable --------
          • Set KnockbackDistance = (Load 0 of i from knockbackTable)
          • Set KnockbackAngle = (Load 1 of i from knockbackTable)
          • Set RemainingTime = (Load 2 of i from knockbackTable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RemainingTime Greater than 0.00 //Real Comparison\\
            • Then - Actions
            • Set Point1 = Position of u // Point Variable \\
            • Set Point2 = Point 1 offset by KnockbakDistance towards KnockbackAngle degrees // Point Variable \\
              • -------- Move the unit and update time remaining --------
              • Unit - Move (Picked unit) instantly to Point2
              • Hashtable - Save (RemainingTime - 0.04) as 2 of i in knockbackTable
            • Custom script: call RemoveLocation(udg_Point1)
            • Custom script: call RemoveLocation(udg_Point2)
            • Else - Actions
              • -------- Knockback is done, clean up --------
              • Hashtable - Clear all child hashtables of child i in knockbackTable
              • Unit Group - Remove u from KnockbackUnit
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Number of units in KnockbackUnits = 0 //Integer Comparison\\
          • Then - Actions
            • Trigger - Turn of (This Trigger)
          • Else - Actions
It could be improved, but I don't have the time now. It may bug if a unit goes through unpathable terrain (like getting blocked inside trees, or water)
 
Last edited:
Level 5
Joined
Jul 11, 2009
Messages
81
Man its very confusing I cant get it :( All these triggers that i have to put in my spell and set them .. argh didnt make it :| ... Could you do it ... Just fix the Thunderstorm to knockback all units and upload it so i can directly import it into my map, please
 
Level 20
Joined
Jul 14, 2011
Messages
3,214
Sadly, no. You'll have to learn :).

I'm editing the post with the trigger to help you creating and setting the variables.

Just do the trigger lines one by one... You'll get it in no time.
 
Level 20
Joined
Jul 14, 2011
Messages
3,214
Custom scripts are case sensitive. You have to type them "exactly" as they are.

Also, the things inside // --- \\ are not part of the custom script.

What error is it giving?
 
Level 5
Joined
Jul 11, 2009
Messages
81
Spartipilo, i added the both triggers on another map and the good thing is that, it doesn't give me the script error anymore. But it still doesnt knockback the units .. :/ despite of the fact that I made the things just like yours.
 

Attachments

  • Thunderstorm2.w3x
    20.2 KB · Views: 85
Level 20
Joined
Jul 14, 2011
Messages
3,214
Actually, you didnt.

  • Set Enemy_Group = (Units within 300.00 of Point1 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 (Casting unit))) Equal to True) and ((((Matching unit) is A H
Declaring the Group into a variable with a set bj_wantDestroyGroup = true doesn't work.

Lol, you won't believer this xD You forgot to create the hashtable! You created the variable to handle the Hashtable data, but never created the hash!

I already got it working. I'm trying to "smoth" the bash.

Didn't found the way to make it "Smooth", but works. This is not the more efficient system... but "works". I'm not sure if I changed somethimg, so I'll post it all.

  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set knockbackTable = (Last created hashtable)
  • Thunderstorm settings
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunderstorm
    • Actions
      • Set Point1 = (Target point of ability being cast)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 300.00 of Point1 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True)))) and do (Actions)
        • Loop - Actions
          • Set u = (Picked unit)
          • Custom script: set udg_i = GetHandleId(udg_u)
          • Set Point2 = (Position of u)
          • Set KnockbackAngle = (Angle from Point1 to Point2)
          • Set KnockbackDistance = (200.00 x 0.04)
          • Set RemainingTime = 1.00
          • Hashtable - Save KnockbackDistance as 0 of i in knockbackTable
          • Hashtable - Save KnockbackAngle as 1 of i in knockbackTable
          • Hashtable - Save RemainingTime as 2 of i in knockbackTable
          • Unit Group - Add u to KnockbackUnits
          • Custom script: call RemoveLocation(udg_Point2)
          • Unit - Cause (Triggering unit) to damage u, dealing 100.00 damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the origin of u using Abilities\Weapons\Bolt\BoltImpact.mdl
          • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at Point1 using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at Point1 using Abilities\Spells\Undead\FreezingBreath\FreezingBreathMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_Point1)
      • Trigger - Turn on Thunderstorm knockback <gen>
  • Thunderstorm knockback
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in KnockbackUnits and do (Actions)
        • Loop - Actions
          • Set u = (Picked unit)
          • Custom script: set udg_i = GetHandleId(udg_u)
          • Set KnockbackDistance = (Load 0 of i from knockbackTable)
          • Set KnockbackAngle = (Load 1 of i from knockbackTable)
          • Set RemainingTime = (Load 2 of i from knockbackTable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RemainingTime Greater than 0.00
            • Then - Actions
              • Set Point1 = (Position of u)
              • Set Point2 = (Point1 offset by KnockbackDistance towards KnockbackAngle degrees)
              • Unit - Move (Picked unit) instantly to Point2
              • Hashtable - Save (RemainingTime - 0.04) as 2 of i in knockbackTable
              • Custom script: call RemoveLocation(udg_Point1)
              • Custom script: call RemoveLocation(udg_Point2)
            • Else - Actions
              • Hashtable - Clear all child hashtables of child i in knockbackTable
              • Unit Group - Remove u from KnockbackUnits
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in KnockbackUnits) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
You still have to set the Collision Size to 0 at the beginning of the stun, and then restore it at the ending... And prevent units from going unwanted places.
 
Last edited:
Level 5
Joined
Jul 11, 2009
Messages
81
Bro, u are awesome xD It worked! Thank you so f*cking much that u wasted your time writing me all these things, I actually learned how to use hastables too ! :D +one big rep for u, bud. I just have one little question more - why do I even need to change their collision, if they actually dont "climb" on hills, cuz i tested the knockback infront of cliff and they didnt go up :D

And i think it gonna bug if i set in Map Initialization knockbackTable to be the last created hashtable cuz it gonna mess with other spells that use hastables too, right?
 
Level 20
Joined
Jul 14, 2011
Messages
3,214
Thanks.

About the hashtable on map init, no, you don't have to worry about that. As long as you create a Variable to handle that hashtable, since it's handled with variables.

Create a Hashtable
Set Hash1 - Last created Hashtable
Create a Hashtable
Set Hash2 - Last created Hashtable

See? You manage the first using Hash1, and Manage the second using Hash2.

If you stand in front of the unit you're bashing, it will knock against you (or any other unit/structure that's just standing there) over and over, without moving. I think that, if set the collision size to 0, the unit will go through trees and stuff, but not over cliffs. Doesn't matter that much anyway, it's just cosmetic.

Also, I think the formula should be divided (if it's equal or greater than 1) by "Remaining Time", since having a 200 x 0.04 would go through 400 distance, not 200... But if the time is lower than 0, it should be multiplied, otherwise it would go even higher.
 
Top