• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Failure to delete SFX

Status
Not open for further replies.
Level 2
Joined
Dec 26, 2011
Messages
6
Hey, I've set this trigger up using a integer loop to destroy a large area. Ive yet to have add damage, but I've run into a snag. Since there is no no SFX Group variable type, I'm having to use an array. However, when I try to delete the array using a seperate loop, it fails. Any ideas?

  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • Destruction Equal to (Ability being cast)
  • Actions
    • Wait 0.20 seconds
    • Set DestructionPoints[1] = ((Target point of ability being cast) offset by 0.00 towards 0.00 degrees)
    • Set DestructionPoints[2] = ((Target point of ability being cast) offset by 256.00 towards 270.00 degrees)
    • Set DestructionPoints[3] = ((Target point of ability being cast) offset by 256.00 towards 90.00 degrees)
    • Set DestructionPoints[4] = ((Target point of ability being cast) offset by 256.00 towards 180.00 degrees)
    • Set DestructionPoints[5] = ((Target point of ability being cast) offset by 256.00 towards 0.00 degrees)
    • Set DestructionPoints[7] = ((Target point of ability being cast) offset by 256.00 towards 45.00 degrees)
    • Set DestructionPoints[8] = ((Target point of ability being cast) offset by 256.00 towards 135.00 degrees)
    • Set DestructionPoints[9] = ((Target point of ability being cast) offset by 256.00 towards 315.00 degrees)
    • Set DestructionPoints[6] = ((Target point of ability being cast) offset by 256.00 towards 225.00 degrees)
    • For each (Integer A) from 1 to 10, do (Actions)
      • Loop - Actions
        • Set DestructionBase = (DestructionBase - DestructionMinus)
        • Special Effect - Create a special effect at DestructionPoints[DestructionBase] using Objects\Spawnmodels\NightElf\NEDeathMedium\NEDeath.mdl
        • Set SpecialEffect[DestructionBase] = (Last created special effect)
    • Set DestructionBase = 11
    • For each (Integer A) from 1 to 10, do (Actions)
      • Loop - Actions
        • Special Effect - Destroy SpecialEffect[(DestructionBase - DestructionMinus)]
    • Set DestructionBase = 11
I mean, I could do it 1b1, but that would take forever.
 
Level 2
Joined
Dec 26, 2011
Messages
6
...I feel like a poverty stricken step child with down syndrome. Dunno how I missed that.
Thanks.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
You should do this to avoid location leaks:

  • Set DestructionPoints[1] = (Target point of ability being cast)
  • Set DestructionPoints[2] = DestructionPoints[1] offset by 256.00 towards 270.00 degrees
  • Set DestructionPoints[3] = DestructionPoints[1] offset by 256.00 towards 90.00 degrees
  • ...
Then after you have used them, loop from 1 to 9, do this action:
  • Custom script: call RemoveLocation(udg_DestructionPoints[bj_forLoopAIndex])
 
Level 2
Joined
Dec 26, 2011
Messages
6
You should do this to avoid location leaks:
Gotcha. But, I thought if I changed the variable, it would erase the point. Basically, the points will be deleted by next cast.

Also, instead of using the "Begin cast" event, you should the "Spell effect" event.
And you really don't need that wait.
Thanks, will do.
An the wait makes it seem like a bombardment as opposed to a singular ordeal, and it will give a chance for units to avoid on the the points.

Some models will remain visible even if you destroy them, for some time.
I suggest spells and abilities, using buffs as SFX sometimes isn't good choice.
Yes, that was implied in Meticulous's post. Also, I'm using a Spawned Effect.
 
Changing variable doesn't erase a point because the variable is just a pointer, if you change the value you just reassign the variable into another location while the original location is still there, you lose the means to obtain the location it used to point to...

hence, you won't be able to remove/move/whatsoever the location again, and since the location not needed anymore but wasn't/cannot be removed it becomes a leak...
 
Status
Not open for further replies.
Top