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

Shockwave trigger not working (Line damage spell)

Status
Not open for further replies.
Level 8
Joined
Apr 30, 2009
Messages
338
I'm making a triggered spell that does exactly what the Shockwave spell does: damages enemies in a line. But I ran into a problem.

Here's how my spell works: the missle is created and moves forward, every 0.03 seconds checking a 200 radius for targets. It damages all the targets and is supposed to add them to a unit group, so they won't be damaged again. But this part doesn't work, and the spell instantly kills anything it touches.

I'm really stumped here, because I checked my trigger like a dozen times and it still does everything else properly. Trigger 2 below has the damage check that is messing up.

  • InfernalWave1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Infernal Wave (Sorceress - Active)
    • Actions
      • Set temp_hashtable = H_InfernalWave
      • Set temp_point[0] = (Position of (Triggering unit))
      • Set temp_point[1] = (temp_point[0] offset by 50.00 towards (Facing of (Triggering unit)) degrees)
      • Custom script: call RemoveLocation( udg_temp_point[0] )
      • Unit - Create 1 infernalwave for (Owner of (Triggering unit)) at temp_point[1] facing (Facing of (Triggering unit)) degrees
      • Custom script: call RemoveLocation( udg_temp_point[1] )
      • Hashtable - Save 0.00 as (Key distance) of (Key (Last created unit)) in temp_hashtable
      • Hashtable - Save ((40.00 + (25.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))) + (0.80 x (Load 100 of (Key (Triggering unit)) from H_Spellpower))) as (Key damage) of (Key (Last created unit)) in temp_hashtable
      • Hashtable - Save Handle Of(Triggering unit) as (Key caster) of (Key (Last created unit)) in temp_hashtable
      • Hashtable - Save 22.50 as (Key speed) of (Key (Last created unit)) in temp_hashtable
      • Hashtable - Save (Facing of (Triggering unit)) as (Key facing) of (Key (Last created unit)) in temp_hashtable
      • Custom script: set udg_temp_hashtable = null
      • Unit Group - Add (Last created unit) to InfernalWaveMissles
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (InfernalWave2 <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on InfernalWave2 <gen>
        • Else - Actions
  • InfernalWave2
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in InfernalWaveMissles) Greater than 0
        • Then - Actions
          • Unit Group - Pick every unit in InfernalWaveMissles and do (Actions)
            • Loop - Actions
              • Set temp_point[0] = (Position of (Picked unit))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load (Key distance) of (Key (Picked unit)) from H_InfernalWave) Greater than or equal to 750.00
                • Then - Actions
                  • Special Effect - Create a special effect at temp_point[0] using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation( udg_temp_point[0] )
                  • Unit - Kill (Picked unit)
                  • Unit Group - Remove (Picked unit) from InfernalWaveMissles
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in H_InfernalWave
                • Else - Actions
                  • Set temp_unit[0] = (Picked unit)
                  • Set temp_integer[0] = (Key (Picked unit))
                  • Set temp_unit[1] = (Load (Key caster) of (Key (Picked unit)) in H_InfernalWave)
                  • Set temp_real[0] = (Load (Key damage) of (Key (Picked unit)) from H_InfernalWave)
                  • Set temp_group = (Units within 200.00 of temp_point[0] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of (Owner of (Picked unit))) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) is in
                  • Unit Group - Pick every unit in temp_group and do (Actions)
                    • Loop - Actions
                      • Unit - Cause temp_unit[1] to damage (Picked unit), dealing temp_real[0] damage of attack type Spells and damage type Death
                      • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmDamage.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Unit Group - Add (Picked unit) to (Load (Key hit) of temp_integer[0] in H_InfernalWave)
                      • Unit Group - Remove (Picked unit) from temp_group
                  • Custom script: call DestroyGroup( udg_temp_group )
                  • Set temp_point[1] = (temp_point[0] offset by (Load (Key speed) of (Key (Picked unit)) from H_InfernalWave) towards (Load (Key facing) of (Key (Picked unit)) from H_InfernalWave) degrees)
                  • Custom script: call RemoveLocation( udg_temp_point[0] )
                  • Unit - Move (Picked unit) instantly to temp_point[1], facing (Load (Key facing) of (Key (Picked unit)) from H_InfernalWave) degrees
                  • Custom script: call RemoveLocation( udg_temp_point[1] )
                  • Hashtable - Save ((Load (Key distance) of (Key (Picked unit)) from H_InfernalWave) + (Load (Key speed) of (Key (Picked unit)) from H_InfernalWave)) as (Key distance) of (Key (Picked unit)) in H_InfernalWave
        • Else - Actions
          • Trigger - Turn off (This trigger)
 
Level 8
Joined
Apr 30, 2009
Messages
338
I don't remove it from the group that checks if it's been hit.

Unit Group - Add (Picked unit) to (Load (Key hit) of temp_integer[0] in H_InfernalWave)

is never removed
 
Level 8
Joined
Apr 30, 2009
Messages
338
Why use temp hashtable and then null it?

Create floating text showing the damage above damaged unit, that way you can at least check the amount of damage, and if the unit is damaged mroe than once.

The temp hashtable is so I can make similar spells for other units without having to go through every line just to change the hashtable vasriable.

Floating text won't do anything since I know the unit is damaged multiple times. The spell does 65 at level 1 and it instantly kills anything it touches right now.
 
Level 7
Joined
Nov 19, 2007
Messages
253
Im not somekind "pro" with world edditor but i think i have an idea. try putting units which allready been hit by weave to another unit group and then make if then else and check if other units (that wasnt allready hit by weave) is not in that group.
 
Level 8
Joined
Apr 30, 2009
Messages
338
That's what I'm already trying to do but it messes up.

I am trying to put damaged units in a unit group that is stored in the hashtable of each wave, so its MUI. But that doesn't work and the only way it works is if I use a global unit group, making it not MUI.

So if I can't localize the group for each wave then I just can't do the spell.
 
Status
Not open for further replies.
Top