# [Trigger]Need Help fix trigger

#### T. D. W.

Level 16
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:

#### Almia

Level 33
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.

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

Explain plz

Level 16

#### Almia

Level 33
@DotCA
Don't make me laugh,i have explained there.

@Maker
Ha,that's the main problem

#### T. D. W.

Level 16
ok one last thing:
i gave a dummy unit a finger of death custom ability and when i order him to fire it he doesn't (it's in the trigger third) anymore help?

#### Almia

Level 33
You are ordering the dummy unit to cast the ability 6 times.
Make sure the dummy has sufficient mana or the ability has no cooldown.
Also,make sure that the dummy has 0 casting animation.

#### T. D. W.

Level 16
You are ordering the dummy unit to cast the ability 6 times.
Make sure the dummy has sufficient mana or the ability has no cooldown.
Also,make sure that the dummy has 0 casting animation.

0 manacost 0 cooldown but where do i see the casting animation of the dummy

#### T. D. W.

Level 16
i seted all animations to 0.000 but he still don't cast it even for the last target [6] target

#### T. D. W.

Level 16
first: i made targets allowed: allies as the targets are allies
then i changed it and made targets allowed everything [all checked] and none changed a thing

#### Nichilus

Level 17
You are ordering 1 unit to cast spell 7 times in a row in an instant.
Also, doesn't Lightning Field Dummy have locust ability? That would make it untargetable for direct spells, wouldn't it?

#### T. D. W.

Level 16
You are ordering 1 unit to cast spell 7 times in a row in an instant.
Also, doesn't Lightning Field Dummy have locust ability? That would make it untargetable for direct spells, wouldn't it?

oh yeah it does

then is there a way to make a lightning effect from a unit's origin [not fro his position] to a target point?

#### Nichilus

Level 17
You can create lightning from 1 point to another and then raise the end points (Z axis) through custom script

#### T. D. W.

Level 16
You can create lightning from 1 point to another and then raise the end points (Z axis) through custom script

can you show me how i need the point with 500 height btw

#### Nichilus

Level 17
Actually I can't, sorry I'm not good at custom scripts, so I usually save them in my test map for later easy find... but I've must have accidentally delete the trigger it was in since I can't find it :/

#### T. D. W.

Level 16
Actually I can't, sorry I'm not good at custom scripts, so I usually save them in my test map for later easy find... but I've must have accidentally delete the trigger it was in since I can't find it :/

no worry

Can anybody else tell us
change Z offset of a point for lightning effect

#### Almia

Level 33
@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)

#### T. D. W.

Level 16
@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)

ok now do you know how to the offset thingy

#### Nichilus

Level 17
@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)

#### T. D. W.

Level 16
ok we got the script how to apply it with my spell because excluding locals and very very basic things with custom scripts i don't know how to do it

#### Nichilus

Level 17
It's all explained in the guide and there is an example trigger at the end

Level 6

#### T. D. W.

Level 16

this is the guide that nichilus posted

Anyway thx everybody, found what i wanted gave +rep for you

[Trigger] MUI spell help
Replies
46
Views
1K
Replies
4
Views
399
Replies
6
Views
510
[Trigger] How is this spell?
Replies
6
Views
553
Replies
5
Views
633