So I am periodically creating a trigger, which runs for a short while, and then is done and needs to be killed for good so that it no longer eats up cpu time, memory, etc. I've tried TriggerStop(trigger), but that seems to not be what I'm looking for. I then moved on to try TriggerEnable(trigger, false), however that doesn't actually get rid of the trigger since I know it can still be run via the run trigger action.
What can I do to get around this issue?
Some more detail on the scenario: I'm creating units, having them crash into eachother, and then explode. I don't know ahead of time where they will crash, so at the unit's creation time I call TriggerCreate and then TriggerAddEvenUnitRange to set up the collision detection.
My understanding is that triggers only eat cpu power when they are running or are in the running stack (e.g. they called another trigger and are waiting for it to finish before they can continue their own actions). So you shouldn't worry about triggers when they are not running and have nothing to do with any of the triggers currently running.
Sweet, this looks exactly like what I want. I'll test it out, though I did already manage to solve my problem by completely rebuilding the system, but it's a messy solution.. I'd rather use this.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So I am periodically creating a trigger, which runs for a short while, and then is done and needs to be killed for good so that it no longer eats up cpu time, memory, etc. I've tried TriggerStop(trigger), but that seems to not be what I'm looking for. I then moved on to try TriggerEnable(trigger, false), however that doesn't actually get rid of the trigger since I know it can still be run via the run trigger action.
What can I do to get around this issue?
Some more detail on the scenario: I'm creating units, having them crash into eachother, and then explode. I don't know ahead of time where they will crash, so at the unit's creation time I call TriggerCreate and then TriggerAddEvenUnitRange to set up the collision detection.
@Apollys: Go
TriggerDestroy(trigger t);
@Apollys: Go
you might consider this useful:
http://www.sc2mapster.com/forums/development/triggers/65013-trigger-destroy-script-obfuscation/
Use a proper custom definition
My understanding is that triggers only eat cpu power when they are running or are in the running stack (e.g. they called another trigger and are waiting for it to finish before they can continue their own actions). So you shouldn't worry about triggers when they are not running and have nothing to do with any of the triggers currently running.
Sweet, this looks exactly like what I want. I'll test it out, though I did already manage to solve my problem by completely rebuilding the system, but it's a messy solution.. I'd rather use this.