| 05-24-2006, 07:52 AM | #1 |
I made a huge TD with loads of triggers, and I was wondering if anyone knows which common memory leaks exist in TDs? I've already fixed "Unit enters region" memory leak. |
| 05-24-2006, 10:06 AM | #2 |
Well, like every other map, a TD will suffer mostly from unit group and location leaks - due to the use of blizzard.j functions. Make sure you're setting bj_wantDestroyGroup to true (where necessary) before PickEveryUnit... commands. |
| 05-24-2006, 12:26 PM | #3 |
just out of curiousity, wtf is the "Unit enters region" memory leak. |
| 05-24-2006, 03:33 PM | #4 |
I think is leaks a region(rect), not sure, iv heard something about it before but not all knowing of it lol |
| 05-24-2006, 04:21 PM | #5 |
Well, setting the event up leaks a jass region (that is created from the rect you specify). But this won't increase the memory over time, just at initialization, and you wouldn't have sooo many region events that it's really an issue. |
| 05-24-2006, 10:36 PM | #6 |
Although this is not a leak this is a glitch I've found in my TD so far and thus you need to either work around it or remove it. Don't put any Active spells that Increase speed or heal with your units unless you set up triggers to keep the units going on the path they are supposed to go on. It has been my experience as a newb(New maker) that they cast these abillities and then head right back to the starting point or just stand in one location. You can work around this with triggers however I feel its not worth it unless you want the effect. ![]() |
| 05-28-2006, 11:36 PM | #7 | |
Quote:
Any way to do this in GUI? |
| 05-29-2006, 04:28 AM | #8 |
Yes and no. Trigger: Custom Script - set bj_wantDestroyGroup = true |
| 05-29-2006, 07:50 AM | #9 |
Is that a variable or what? |
| 05-29-2006, 12:03 PM | #10 |
yes it is a variable... hmm topic is TD, most likely you are leaking location using Center of Region every time, to avoid this you must make variable of type location and do this everytime you use Center or region: set temp_loc = Center of SPAWNING POINT Unit - Order Footman to Move to temp_loc Custom script("call RemoveLocation(udg_temp_loc) of course if your variable is called temp_loc |
| 05-29-2006, 03:59 PM | #11 | |
Quote:
Yeahs, that's a very important thing, because it will leak for every mob spawned (40 levels * 200 mobs?). It's the same if you use this: Trigger: Unit - Create ? Unittype for Player ? (??) at (Random point in (Playable map area)) facing Default building facing degreesThen the random point will leak too. Sadly Jacek, you wrote it wrong, so it will give an error if you copy it into WE. You wrote " infront of the call. One more thing Siphonized, I don't know how you are checking if all the units are dead atm, but the best way for you would be this I beleive: Trigger: Trigger: Well, I hope I helped :) - Soultaker |
| 05-29-2006, 07:12 PM | #12 |
(Insert something here...) doesn't help me very much as I am very foreign to custom scripts. :) |
| 05-29-2006, 07:54 PM | #14 |
Wait, so you stop the variable so that the variable works on ALL regions? EDIT: @2nd trigger of Soultaker: How do you get number_of_units = number_of_units -1!?!??! (I can't get the -1 part...) |
| 05-29-2006, 08:46 PM | #15 |
You learn JASS and type it in :) Or use the arithmetic - minus stuff in the GUI. Make sure you've got that global already there as an integer or real or whatever it's supposed to be. |
