• 🏆 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] Trigger still does not damage units <GUI>

Status
Not open for further replies.
Level 5
Joined
Jan 23, 2014
Messages
152
I've already posted this trigger a few weeks ago, and the problem was because it wasn't MUI, now this one is MUI and it still does not deal damage.This is my first time trying to make a spell MUI though.
My problem is at the Laser Damage Trigger.
Can someone please check this:
  • Laser Init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Laser
    • Actions
      • Set L_Index = (L_Index + 1)
      • Set DummyCaster_Index = (DummyCaster_Index + 1)
      • Set DummyExpl_Index = (DummyExpl_Index + 1)
      • Set LCaster[L_Index] = (Casting unit)
      • Set CasterPosition[L_Index] = (Position of LCaster[L_Index])
      • Set DummyLoc[DummyCaster_Index] = (CasterPosition[L_Index] offset by (0.00, 60.00))
      • Set LTarget[L_Index] = (Target point of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • L_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Laser Loop <gen>
        • Else - Actions
  • Laser Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Laser_Loop_Integer) from 1 to L_Index, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Spell Breaker for (Owner of LCaster[L_Index]) at DummyLoc[DummyCaster_Index] facing Default building facing degrees
          • Set Dummy[DummyCaster_Index] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to Dummy[DummyCaster_Index]
          • Unit - Create 1 Explosion Dummy for (Owner of LCaster[L_Index]) at LTarget[L_Index] facing Default building facing degrees
          • Set Dummy[DummyExpl_Index] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to Dummy[DummyExpl_Index]
          • Unit - Order Dummy[DummyCaster_Index] to Neutral - Firebolt Dummy[DummyExpl_Index]
          • Trigger - Turn on Laser Damage <gen>
          • Set LCaster[Laser_Loop_Integer] = LCaster[L_Index]
          • Set LTarget[Laser_Loop_Integer] = LTarget[L_Index]
          • Set L_Index = (L_Index - 1)
          • Set Laser_Loop_Integer = (Laser_Loop_Integer - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Laser_Loop_Integer Equal to 0
            • Then - Actions
              • Custom script: call RemoveLocation (udg_CasterPosition[udg_L_Index])
              • Custom script: call RemoveLocation (udg_DummyLoc[udg_DummyCaster_Index])
              • Custom script: call RemoveLocation (udg_LTarget[udg_L_Index])
              • Custom script: call DestroyGroup (udg_LaserDmgGrp[udg_L_Index])
              • Trigger - Turn off (This trigger)
            • Else - Actions

  • Laser Damage
    • Events
      • Time - Every 0.56 seconds of game time
    • Conditions
    • Actions
      • Unit - Order Dummy[DummyExpl_Index] to Human Mountain King - Thunder Clap
      • Set LaserDmgGrp[L_Index] = (Units within 600.00 of LTarget[L_Index] matching ((((Triggering unit) is A structure) Equal to False) and ((((Triggering unit) is alive) Equal to True) and (((Triggering unit) belongs to an enemy of (Owner of LCaster[L_Index])) Equal to True))))
      • Unit Group - Pick every unit in LaserDmgGrp[L_Index] and do (Unit - Cause LCaster[L_Index] to damage (Picked unit), dealing ((300.00 x (Real((Level of Laser for LCaster[L_Index])))) + 0.00) damage of attack type Spells and damage type Universal)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Laser for LCaster[L_Index]) Equal to 3
        • Then - Actions
          • Unit Group - Pick every unit in LaserDmgGrp[L_Index] and do (Unit - Cause LCaster[L_Index] to damage (Picked unit), dealing (6.00 x (Real((Level of LCaster[L_Index])))) damage of attack type Spells and damage type Universal)
        • Else - Actions
      • Trigger - Turn off (This trigger)

Don't mind the leaks, I'll fix them later.
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,381
The trigger doesn't work because
a) it is not MUI
b) it is complete mess :/

You use 3 different indexes for various things, however then you decrease some indexes, which causes inconsistency in your system.
You deindex things immediately, even before the third trigger manages to run at least once.

Just make some simple math on paper yourself and you will see the problem.
Like... substitute the "L_index" for "x" on paper and make x=0 and go one command by one and decrease/increase value of x and see what value x will have when you index caster with it and what value x has when you want the "caster[x]" to damage some other unit.

You also leak locations and groups

I'm not sure what you tried to do with the loop trigger, though...
 
Level 6
Joined
Mar 30, 2014
Messages
230
The trigger doesn't work because
a) it is not MUI
b) it is complete mess :/

You use 3 different indexes for various things, however then you decrease some indexes, which causes inconsistency in your system.
You deindex things immediately, even before the third trigger manages to run at least once.

Just make some simple math on paper yourself and you will see the problem.
Like... substitute the "L_index" for "x" on paper and make x=0 and go one command by one and decrease/increase value of x and see what value x will have when you index caster with it and what value x has when you want the "caster[x]" to damage some other unit.

You also leak locations and groups

I'm not sure what you tried to do with the loop trigger, though...

he's right i see that is your problem try reading in the tutorials maybe you can find something there.
 
Level 5
Joined
Jan 23, 2014
Messages
152
Thanks for the tips guys and sorry for posting it in the wrong section. I never thought making MUI spells would be this hard XD
 
Level 5
Joined
Jan 23, 2014
Messages
152
Nice tutorial you got there. Thanks @deathismyfriend! I'll try your method.
 
Status
Not open for further replies.
Top