HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Lightning target prolems (no JASS)

06-10-2005, 05:07 PM#1
PlasticAngel
I'm working on a spell, it's based on fan of knives. Now the problem is when I wanna attatch the lightning to the target. I want it to go from the caster to the target. But Creater lightning from casting unit to target of spell being cast won't work. The best solution I have found is to make it hit a random unit within 600 of the casting unit, but that is unrelyable. Can someone plees help me?
Angel
06-10-2005, 07:47 PM#2
Anitarf
Help? In what way, what's the problem, exactly?

Fan of Knives is an area of effect spell, it doesn't have a target, thus the "target unit of ability being cast" event response gives you no unit. How is random unit unreliable?
06-10-2005, 08:40 PM#3
PlasticAngel
Well I want the lighning to target every unit that gets damaged, and random won't do that.
06-10-2005, 09:26 PM#4
iNfraNe
then just take ALL units in the range of the hero, not just 1...
06-10-2005, 11:18 PM#5
Elven Ronin
One idea that comes to mind is an untargeted dummy spell in place of the fan of knives. Then create a dummy on top of the caster, and have it use an appropriately modified forked lightning at a random unit - which will then make it hit surrounding units as well.

I'm not sure how well that'll work (if at all), just throwing out an idea.
06-11-2005, 07:11 PM#6
Guest
Uhm, I made a similar thing in oneof my spells. Just create a unit group matching some conditions (f.e. enemy units and so on) and save it in a variable (i.e. called "Lighters"). Then make a func "for each intenger from x to y do..." (where x and y are the spell's "caps"); in the loop do the following: pick a random unit from Lighters, save it in a variable called "Light", apply the lightning to Light and then remove this unit from the group (in this way a unit cannot be targeted more than 1 time). I hope this can help u...