[General] Imprisoning chains Lightning Effects loop question

Status
Not open for further replies.
Level 8
Joined
Oct 6, 2022
Messages
185
Hello, anyone knows to to make a thunder effects that connects like this where they could still move even they have that lighting effects?

Imprisoning Chains.png
 
Level 26
Joined
Aug 18, 2009
Messages
4,099
Lightnings don't restrict movement. Just iterate over the targets and create a lightning for each from caster to target or vice versa. Maybe you mean that the position of the lightning is not updated to follow the target. Yes, you have to save the caster, target and lightning and periodically move the lightning/update when the unit moves.
 
Level 8
Joined
Oct 6, 2022
Messages
185
Oh yeah lightnings effects don't bend but they can update target unit's movements, in the mean time i would still like to know how to do it where it creates Lightning effects to target picked units.
I could do it via dummy where it makes the unit attack it on and on or either cast lightning affect dummy but the disadvantage of it is it might cause lag in a brief of period or so. That is why i would like to know how to it only by just triggers without using dummies.
 
Level 26
Joined
Aug 18, 2009
Messages
4,099
Lightnings are between points natively. So you need to get the points of the caster and each target and plug that in the lightning creation/move actions/functions.

In GUI, for this, there is the "Position of unit" function, in native there is "GetUnitX/GetUnitY" among others.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Note that triggered Lightning effects are completely busted in Reforged.

I was having issues in both SD and HD mode, which is a shame because for a little while there it was only HD that had problems, but I guess they broke SD in 1.35 or something.

See my latest attempt to use it:
 
Last edited:
Level 8
Joined
Oct 6, 2022
Messages
185
1 more question (though it's not related to the topic) should i always use the "Custom Script" to remove variable points at the end of the triggers?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
1 more question (though it's not related to the topic) should i always use the "Custom Script" to remove variable points at the end of the triggers?
You're asking about memory leaks. Everything you need to know is in that thread.

You would use Custom script: call RemoveLocation() whenever you're done using a Point:
  • Actions
    • Set Variable Point = (Center of map)
    • Unit - Create 1 Footman at Point...
    • Custom script: call RemoveLocation(udg_Point)
    • Unit - Add Critical Strike to (Last created unit)
But it doesn't need to be at the end of the trigger.

It's a simple rule of thumb:
Set Point Variable
Use Point Variable
Remove Point Variable

You can Use it multiple times, just make sure you ALWAYS Remove it before Setting it again.

But don't worry about memory leaks too much unless your map has performance problems.
 
Status
Not open for further replies.
Top