HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Overlapping a dash spell

04-16-2007, 03:54 AM#1
Castlemaster
I'm making the classic dash spell that causes damage to everything in a line. I made the spell based off of blink (moves in the same way). I made it so that every 50 units in distance, it picks all enemies in 100 units and deals damage in addition to creating a special effect at each of them. the problem of course is that these "circles" overlap, such that not putting in the proper trigger will result in damaging a unit two or three times. I tried to counter act this by adding the unit to a group after its been damaged (via trigger), and not to damage it again if it is in this group. I still can't seem to get this to work properly atm, and would appreciate it if someone knew what was wrong.
Trigger:
Collapse Unit Group - Pick every unit in (Units within 100.00 of (DarkAlacrityBegin offset by (Real((DarkAlacrityTempCount x 50))) towards DarkAlacrityPolarOffset degrees) matching (((Matching unit) is in WaveGroup) Equal to True)) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) is in DarkAlacrityDamaged) Equal to False
Collapse Then - Actions
Special Effect - Create a special effect at (DarkAlacrityBegin offset by (Real((DarkAlacrityTempCount x 50))) towards DarkAlacrityPolarOffset degrees) using Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmDamage.mdl
Set TempPoint = (Position of (Picked unit))
Special Effect - Create a special effect at TempPoint using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
Custom script: call RemoveLocation (udg_TempPoint)
Unit - Cause ShadowDancer to damage (Picked unit), dealing DarkAlacrityDamage[(Level of Dark Alacrity (Shadowdancer) for ShadowDancer)] damage of attack type Chaos and damage type Normal
Unit Group - Add (Picked unit) to DarkAlacrityDamaged
Else - Actions
Set DarkAlacrityTempCount = (DarkAlacrityTempCount + 1)

This trigger is run in a loop however many increments of 50 distance units there are in the dash (250 units distance = run this trigger 5 times), which is what the tempcount is for.
04-16-2007, 04:03 AM#2
Tide-Arc Ephemera
I'm not sure if this is relevant, but the unit group will leak.

Have you thought about when the unit is being added? Um... also... what's "WaveGroup", I can't help too much if you're picking from a group that's not defined...
04-16-2007, 04:35 PM#3
Dil999
Your integer, DarkAlcatricyTempCount, needs to be inside the loop. Or else it creates them all at 1 point and then adds 1 to the int.
Oh, and make sure you clear that integer afterwards.
And yes, that unit group will leak.
04-16-2007, 05:21 PM#4
Castlemaster
I'll try that out when I get home. I appreciate the help, and I know it's not the easiest of triggers to read. Ok I think I see what's firing and not firing. I'm just curious, I put the damage trigger and the "add unit to DarkAlacrityDamaged" in the same command, this should be enough to prevent overlapping damage.

Edit: I tried to work on this and still cannot get what I want. I isolated the problem to one trigger.
Trigger:
Unit Group - Pick every unit in (Units within 100.00 of (DarkAlacrityBegin offset by (Real((DarkAlacrityTempCount x 50))) towards DarkAlacrityPolarOffset degrees) matching (((Matching unit) is in WaveGroup) Equal to True)) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) is in DarkAlacrityDamaged) Equal to False
Collapse Then - Actions
Set TempPoint = (Position of (Picked unit))
Special Effect - Create a special effect at TempPoint using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
Custom script: call RemoveLocation (udg_TempPoint)
Unit - Cause ShadowDancer to damage (Picked unit), dealing DarkAlacrityDamage[(Level of Dark Alacrity (Shadowdancer) for ShadowDancer)] damage of attack type Chaos and damage type Normal
Unit Group - Add (Picked unit) to DarkAlacrityDamaged
Else - Actions

For some reason, if only one of the units picked is not in DarkAlacrityDamaged group, then it will damage all nearby picked units instead of the one that was not in the unit group. So the problem seems to be that the computer treats (picked unit) as a clump rather than individuals. If this is true, what's the best way to circumvent it.

P.S. Yes I know there are leaks, I want to make it work before making it work smoothly.
04-16-2007, 09:14 PM#5
Dil999
You have yet to tell us what WaveGroup is.
04-17-2007, 03:05 AM#6
Castlemaster
My fault, WaveGroup is from another function that stores all enemies to this group. I fixed the problem anyway when i found out that the "pick every unit" command would treat each picked unit as a group rather than each one individually. I redid the trigger so that it adds the units to the group, and after they have all been added, I deal damage and do the effect. Thanks for the help anyway
04-17-2007, 01:06 PM#7
blu_da_noob
You really should post all triggers that are relevant to the spell, because your problem could theoretically be in any of them.