• 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.

How to stop triggers from executing?

Status
Not open for further replies.
Level 9
Joined
Apr 3, 2008
Messages
700
Use custom script
Code:
return
To remove unused and to save memory triggers use
Code:
Call DestroyTrigger(gg_trg_[trigger_name])
Note: destoying trigger also don't stop it's actions if they were started before you destroyed it.
 
Level 12
Joined
Mar 26, 2005
Messages
790
that is obvious I cannot stop actions which were executed before, WE is not time machine :)


but, I dont get it really.

like I have three trigers

Triger one
E:blabla
A:create unit xy
wait 10 sec
create unit xy

Triger two
E:blabla
A:create unit xy
wait 15 sec
create unit xy

Triger Three
E:players skips cinematic
A:Call DestroyTrigger(gg_trg_triger one)
Call DestroyTrigger(gg_trg_triger two)

is this correct?

And Will I be able to use these destroyed trigers again or not? becouse if not, this wont help me
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
call with lowercase.
I'm pretty sure triggers that are turned off won't run, much less triggers that have been destroyed.
If the cinematic is stopped, turn off the cinematic triggers and set units' positions as they are meant to be after the cinematic.
 
Level 9
Joined
Oct 28, 2007
Messages
435
In your above example you can also add a simple if then else statement after the wait checking if the trigger is enabled and then only when it is created it creates the unit. In that example it will cause the units to not create even if the event was triggered. For example:

Event: Bla Bla
Action:
A:create unit xy
wait 10 sec

if Trigger is Enabled (I think you have a condition Trigger is Enabled, but if you don't just store a global boolean varriable which is set to false when you press escape) then

create unit xy

endif
 
Status
Not open for further replies.
Top