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

Trigger - Turn on [Trigger], when already on?

Status
Not open for further replies.
Level 30
Joined
Jun 4, 2023
Messages
419
Hi guys, This seems very basic but my quick searches haven't turned up anything helpful regarding the question.

I have the usual set-up of Trigger 1 firing when a spell effect starts, which then grabs the required variables and adds the target to a unit group, and finally turns on another Trigger 2 to loop the unit group until all the dirty business is done.
But in Trigger 1 it turns on Trigger 2 every time it fires.

Is this bad practice? Would it really be better to check whether the trigger is already running (or the unit group IS NOT empty) before the action Trigger - Turn on?

I'm just worried it might be some sort of leak or could break something in another obscure way.


Thanks for your time :)
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
I highly doubt it would do anything bad.

I imagine the code checks the state of the trigger before changing it. Or it's just a nonfactor. It's probably pretty similar to doing something like this:
  • Set Variable MyBoolean = True
  • Set Variable MyBoolean = True
It's a waste to do this twice, but it's not going to break anything.
 
Level 30
Joined
Jun 4, 2023
Messages
419
Okay, thanks for that Uncle.
My thinking is in this case it probably uses just as much or more resources to check the state as it does to turn it on.

And I'm still a nub at this so my triggers leak like sieves, which I'm inclined to focus on more :wink:.
 
Status
Not open for further replies.
Top