[vJASS] *Solved* Looking for a good lightning system or how to fix what I use now

Hello hive,

Currently I've been using Lightning System v1.03 as my go to lightning system. However I've encountered repeated freezing with it in longer games that doesn't happen unless its being used and always happens while something using it is being cast so I'd like to see if a better system is out there.

edit: I may just be misusing the above system. Take reports of it freezing with a grain of salt.

My ideal system would have the ability to make the following types of spells:
1. Purely visual lightnings, unit to unit, unit to point, and point to point
2. Lightnings that chain 2 units together so 1 cannot move away from the other
3. "Laser Sweep" found here: [vJASS] - Looking for ways to make this spell more computationally efficient

edit: If someone can figure out what I'm doing wrong with the lightning system I have that works too.

edit2: All my lightning code can be found here if anyone wants to check it: [vJASS] - Looking for a good lightning system or how to fix what I use now
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
The only way to be certain about what you're doing wrong is if you posted all of your lightning related code.

Anyway, #2 shouldn't be expected as part of any lightning system, that's something you would code yourself which would then rely on the lightning system for it's visuals (unit to unit).

#3 is again something that you want to code yourself which then uses the lightning system for it's visuals. Line Segment Enumeration would be a good system to use for handling the "units within range of the line" stuff.

I attached a GUI map that I threw together which has a working Lightning system. It's not too advanced but it covers #1 and is easy to modify yourself. I can't promise that it's bug free or memory leak free but I'm fairly confident that I accounted for most edge cases.

Also, last I tried, Lightning was buggy on Reforged so I can't promise success on anything other than SD mode.

Edit: Updated map with improvements.
 

Attachments

  • Lightning System 3.w3m
    28.6 KB · Views: 2
Last edited:
Hello hive,

Currently I've been using Lightning System v1.03 as my go to lightning system. However I've encountered repeated freezing with it in longer games that doesn't happen unless its being used and always happens while something using it is being cast so I'd like to see if a better system is out there.

edit: I may just be misusing the above system. Take reports of it freezing with a grain of salt.

My ideal system would have the ability to make the following types of spells:
1. Purely visual lightnings, unit to unit, unit to point, and point to point
2. Lightnings that chain 2 units together so 1 cannot move away from the other
3. "Laser Sweep" found here: [vJASS] - Looking for ways to make this spell more computationally efficient

edit: If someone can figure out what I'm doing wrong with the lightning system I have that works too.
Its possible that the cause was me overloading the system by registering the same periodic event multiple times by mistake. Also I re-wrote that code to not use locations where I can use x and y coordinates. I'll need to test it more to know for sure.
 
Its possible that the cause was me overloading the system by registering the same periodic event multiple times by mistake. Also I re-wrote that code to not use locations where I can use x and y coordinates. I'll need to test it more to know for sure.
Nope, still freezing
 
The only way to be certain about what you're doing wrong is if you posted all of your lightning related code.

Anyway, #2 shouldn't be expected as part of any lightning system, that's something you would code yourself which would then rely on the lightning system for it's visuals (unit to unit).

#3 is again something that you want to code yourself which then uses the lightning system for it's visuals. Line Segment Enumeration would be a good system to use for handling the "units within range of the line" stuff.

I attached a GUI map that I threw together which has a working Lightning system. It's not too advanced but it covers #1 and is easy to modify yourself. I can't promise that it's bug free or memory leak free but I'm fairly confident that I accounted for most edge cases.

Also, last I tried, Lightning was buggy on Reforged so I can't promise success on anything other than SD mode.
Here you go. Btw, now I think this is some sort of edge case instead of a performance issue.
 

Attachments

  • lightning bugs.w3x
    250.9 KB · Views: 4
Top