[Trigger] Need Help fix trigger

Level 16
Joined
Jul 31, 2012
Messages
2,217
Here are my triggers for my spell, the problem is that in the last one (Lightning Field move - initially off) the dummies don't move
can someone tell me what's wrong
  • Lightning Field first
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Lightning Field
    • Actions
      • Set Lightning_Field_Caster = (Triggering unit)
      • Set Lightning_Field_Target = (Target point of ability being cast)
      • Set Lightning_Field_AngleSpeed = 0.50
      • Set y = ((Distance between (Position of Lightning_Field_Caster) and Lightning_Field_Target) / 3000.00)
      • Wait y seconds
      • Unit - Create 1 Lightning Field dummy for (Owner of Lightning_Field_Caster) at Lightning_Field_Target facing Default building facing degrees
      • Set Lightning_Field_dummy[1] = (Last created unit)
      • Wait 1.50 seconds
      • Trigger - Run Lightning Field second <gen> (ignoring conditions)
  • Lightning Field second
    • Events
    • Conditions
    • Actions
      • For each (Integer x) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set temp_location = (Lightning_Field_Target offset by 550.00 towards ((360.00 / 5.00) x (Real(x))) degrees)
          • Unit - Create 1 Lightning Field dummy for (Owner of Lightning_Field_Caster) at temp_location facing Default building facing degrees
          • Set Lightning_Field_dummy[(x + 1)] = (Last created unit)
          • Set Lightning_Field_Angle[x] = ((360.00 / 5.00) x (Real(x)))
          • Custom script: call RemoveLocation(udg_temp_location)
      • Unit - Create 1 Lightning Field dummy high for (Owner of Lightning_Field_Caster) at Lightning_Field_Target facing Default building facing degrees
      • Set Lightning_Field_dummy[7] = (Last created unit)
      • Trigger - Run Lightning Field third <gen> (ignoring conditions)
  • Lightning Field third
    • Events
    • Conditions
    • Actions
      • For each (Integer x) from 2 to 5, do (Actions)
        • Loop - Actions
          • Lightning - Create a Forked Lightning lightning effect from source (Position of Lightning_Field_dummy[x]) to target (Position of Lightning_Field_dummy[(x + 1)])
          • Set Lightning_Field_lightning[(x - 1)] = (Last created lightning effect)
      • Lightning - Create a Forked Lightning lightning effect from source (Position of Lightning_Field_dummy[2]) to target (Position of Lightning_Field_dummy[6])
      • Set Lightning_Field_lightning[5] = (Last created lightning effect)
      • Wait 1.00 seconds
      • For each (Integer x) from 1 to 6, do (Actions)
        • Loop - Actions
          • Unit - Order Lightning_Field_dummy[7] to Special Archimonde - Finger Of Death Lightning_Field_dummy[x]
      • Wait 0.50 seconds
      • Trigger - Turn on Lightning Field move <gen>
  • Lightning Field move
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • For each (Integer x) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set Lightning_Field_Angle[x] = (Lightning_Field_Angle[x] + Lightning_Field_AngleSpeed)
          • Set temp_location = (Lightning_Field_Target offset by 550.00 towards Lightning_Field_Angle[x] degrees)
          • Unit - Move Lightning_Field_dummy[(x + 1)] instantly to temp_location
          • Lightning - Move Lightning_Field_lightning[x] to source (Position of Lightning_Field_dummy[(x + 1)]) and target (Position of Lightning_Field_dummy[(x + 2)])
          • Custom script: call RemoveLocation(udg_temp_location)
      • Lightning - Move Lightning_Field_lightning[5] to source (Position of Lightning_Field_dummy[2]) and target (Position of Lightning_Field_dummy[6])
      • Set Lightning_Field_AngleSpeed = (Lightning_Field_AngleSpeed + 0.03)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Lightning_Field_AngleSpeed Greater than or equal to 15.00
        • Then - Actions
          • For each (Integer x) from 1 to 7, do (Actions)
            • Loop - Actions
              • Unit - Remove Lightning_Field_dummy[x] from the game
              • Lightning - Destroy Lightning_Field_lightning[x]
        • Else - Actions
 
Last edited:
Level 33
Joined
Apr 24, 2012
Messages
5,115
The spell is not MUI and it uses waits,that's the main problem.

The reason why it doesn't move is because the trigger can't recogniz the event-related functions,because those functions are overwritten and also the waits causes the problems.

Oh and btw, the spell leaks.

Helpful links:
http://www.hiveworkshop.com/forums/...279/mui-spells-using-artificial-waits-223315/
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/mui-triggers-waits-218354/
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/
http://www.hiveworkshop.com/forums/...9/complete-beginners-guide-hashtables-197381/
http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
Level 17
Joined
Sep 26, 2009
Messages
2,030
@Nichilus
Its not an instant.
Loops works like this:

Example we have 3 loops

for each integer 1 to 3
(Actions Here)

is actually this :

(Action Here)
(Action Here)
(Action Here)
I know, but I wrote instant since I believed it is executed faster than the cast time of the spell.

After a little search found this guide.
It says there to use
  • Custom script: set udg_YOURVARIABLE = AddLightningEx(LIGHTNING TYPE, CHECKVISIBILITY, X1, Y1, Z1, X2, Y2, Z2)
 
Top