• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Trigger Remove Event

Status
Not open for further replies.
Ok thanks,
how do I re-make a trigger? lol

I know I can have multiple of the same trigger with them all turned "off" and then I can turn them "on" and add events as needed. But what if I need to do this a finite amount of times?

Edit: ok looks like I might be able to save the trigger handle in a hashtable then add events to it or destroy the trigger that way.
 
Last edited:
What is the usage you are after?

Feels like if you want to detect something and then no longer need to detect it you would just use a condition check? Although, I suppose if you never need it again maybe it makes sense.
 
I'm creating waypoint units then setting them to variables then I'm adding the event to another trigger, "a unit comes within range of said variable" the action that other trigger does is just ordering the triggering unit to move to a point.

The thing is periodically I'm removing the waypoint units then creating new ones and setting them to a variable. Then of course adding the trigger event again. This actually seems to work but will it cause lag or problems after a period of time where that trigger has hundreds of added events?
 
2 methods you could use here:

1. Create a stack of waypoint units that you can pull from when you need a new one instead of always creating them (create only when stack is empty). Store information about who owns the wp/where the wp should direct to in some parallel arrays/linked list data structure. When a waypoint is no longer needed, put it back in the stack. You can change ownership and move the unit without messing with the unit in range event.

2. Instead of using the event, put all your waypoint units in a unit group and then periodically loop through them to check for nearby units that should be redirected.
 
Status
Not open for further replies.
Back
Top