| 06-20-2006, 06:14 PM | #1 |
Few questions, wondering if anyone knows the answer to: - Does destroying a trigger destroy the attached events? I am of the opinion that it doesn't after a couple of test, but wondering if anyone could clarify. - Do specific unit events get destroyed when the unit they relate to is removed? - Is there any way at all of destroying events? |
| 06-20-2006, 07:14 PM | #2 | |
Quote:
1) In my opinion destroying the trigger destroys the related events too. I did few tests adding actions to a trigger AFTER the trigger was destroyed, but they didn't fire at all. 2) Nice question, I think that they stay in memory, simply they won't never fire. 3) Sorry I don't know any method and I think that it's not possible, but you could destroy the trigger and then re-adding events and action to a new one, don't know if it helps you. |
| 06-20-2006, 07:51 PM | #3 | |
Quote:
That doesn't count as destroying that, that counts as disabling them. Big difference when you are talking about probably thousands of such events. If I can't find anyway of destroying them, then I'll have to make a system to recycle dead units (using transform abilities to change the unit type). |
| 06-20-2006, 08:19 PM | #4 |
Destroying a trigger removes all events from it. However, that does not include triggeractions or triggerconditions, those types need to be removed manually. Specific unit events do not get destroyed when the unit they relate to is removed. They remain since the pointer to the variable still exists, just now it returns null since the unit is gone. So a null specific unit event remains. And no. Trigger events aren't a problem though, since if you use temporary triggers the events will die with the trigger, and if a trigger is permanant then the events should remain. I've tested adding "unit is damaged" events in the hundreds to triggers and no additional lag or anything was encountered. Hopefully that was helpful. ^_^ |
| 06-20-2006, 09:04 PM | #5 | ||
Quote:
That's not the question. Removed != destroyed. Quote:
Nevertheless, it appears to be a cause of a significant amount of memory leakage on my small scale map, so when I scale it up, the problem will be far greater, and the work load in making it more efficient exponentially larger. Since it will probably be somewhere in the thousands of events by the end of the map, I want to minimise this leakage. |
| 06-20-2006, 11:52 PM | #6 |
Got to do it one unit per trigger if you want optimal memory use. The procedure: - Destroy trigger action in separate thread - In original thread, destroy trigger condition using DestroyBoolExpr, not destroycondition. - In original thread, destroy trigger |
| 06-21-2006, 07:24 AM | #7 |
Ok, thanks, I'll give it a go. |
