| 03-02-2004, 01:10 AM | #1 |
While making custom spells with triggers and asking for help here, I've learned that just making special effects without storage causes memory leaks during the game. So my simple question is: How do you store multiple special effects and destroy them systematically. For example: Creating one special effect after another seperated by a Wait command. I'm just not sure how to store them and destroy them the way I want. I know it requires special effect variables and Integer variables (only because I'm stuck with another spell problem HERE. All help with that is appreciated as well.). It's just gonna take a while to adjust to advanced trigger creation. ^^ |
| 03-02-2004, 11:36 AM | #2 |
It depends on how long you want the special effects to show. I'd just save them in some variable or an array and destroy them a short while afterwards by inserting a wait and then destroying the SFXs. |
| 03-02-2004, 02:18 PM | #3 |
Some Special Effects can be destroyed just after creating them: Code:
Create Special effect blah blah... Destroy Last Created Special Effect No need for waits for those (usually special effects that have an self destructing animation) |
| 03-02-2004, 03:16 PM | #4 |
Ah Ok, it kinda depends as someone says. However, if there is only a single unit able to cast this spell, and, if it expires before it's cooldown finishes (basicly, as else, you could get in trouble). Then. Just create a Special Effect variable/array, named something like; *spell-name*Effects Then when you create effects, you just set this variable to the last created special effect. If you're creating multiple special effects, possibly with a algorithm/loop (for each), then (if it's a loop), you can just add a action like this after the creation statement: Set MySFXVariable[ (Integer A) ] = (GetLastCreated Special Effect). Then each effect will, go into different elements in the array, and then when you're finished, you can do another loop that loops the same number of times as the other loop, and Destroys MySFXVariable[ (Integer A) ] Hope you understand what I'm talking about. Cubasis |
| 03-03-2004, 03:23 AM | #5 |
If you are familiar with jass you can use dataangel's special effect function. It automatically stores the effect for a period of time that you set then destroys it after it is done. Here is a link to it. http://kattana.users.whitehat.dk/viewfunc.php?id=31 Hope that will help you or at least give you some ideas. |
