Multi Flamestrike Removal

Dregonx

TH.net Regular
Reaction score
21
If say you create like 10 Flamestrikes at the same time using triggers, how would you remove them?

Because Flamestrike has animations it's not like a normal special effect, so if you used Destroy last created special effect it'll literally destroy it before it even goes off.

I need all of them to go off at the same time, and still removing them afterwords to prevent lag.

Thanks in advanced.

-Dregonx
 

Faust

You can change this now in User CP.
Reaction score
123
Store them into variable(s), wait till their animation is over, remove them.
 

Dregonx

TH.net Regular
Reaction score
21
Store them into variable(s), wait till their animation is over, remove them.

Edit: Well, I meant was like, ok say you have 10 flamestrikes, then you have lightning effects going off at the same time, how would I have a wait timer to remove them? I'm just really confused.

Edit 2: Oh yeah, and they are in a loop action as well.
 

Dregonx

TH.net Regular
Reaction score
21
Make a function in the 'map's custom script' section something like this
JASS:
function RemoveEffect takes real time returns nothing
local effect e = GetLastCreatedEffectBJ()
call PolledWait(time)
call DestroyEffectBJ(e)
endfunction

and use
CustomScript: "call RemoveEffect(1.0)" in your trigger

I'll do it, but can you explain in detail what that does, I'm interested in learning more about JASS. So I can edit it if need be as well.

Edit: I know a pretty good amount of JASS so far.
 

R@i_no_Wyrm

New Member
Reaction score
43
Alternatively, you can
1.) make a dummy Flame strike ability so don't bother with it
or
2.) ya, make the effect removals.
Something like... set
FS_remove[A] = last created special effect
COunt[A] = 10

then decrease the count every second and destroy da effects after it reched 0.
(GUI ver, im a n00b in JASS)
 

Dregonx

TH.net Regular
Reaction score
21
It stores the last created special effect in a local, waits X seconds (where X is the value you pass to the function) and then destroys the effect

(although it leaks twice, one from PolledWait, and another because 'e' wasn't nulled)

Are the leaks anything to worry about or is it fine not removing the leaks?

Edit: Gave rep to everyone. =) And thanks.
 

Dregonx

TH.net Regular
Reaction score
21
Just tried it out on my map, it gave the spell a delay, every loop it just created everything once in one direction then the next direction, then the next, it's not supposed to go in the directions one at a time but instead all at once.

However, the lag did disappear. =)
 

Flare

Stops copies me!
Reaction score
662
They are minor (in comparison to location/group/special effect leaks), but it'd be better if you could get rid of them

For the PolledWait leak, you will need to remake the PolledWait code, and null the timer that is created (look around the Tutorials & Resources section, I think someone posted the non-leaking code)

For the handle leak, just add
JASS:
set e = null

at the very end of the function
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top