HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

condition vs If/then

01-10-2007, 07:54 PM#1
Joker
If it was just a simple trigger, then wouldnt if/then be better b/c you can use locals for the condition too?
01-10-2007, 08:03 PM#2
Anitarf
If it's a GUI if-then, then you can't use locals still.
01-10-2007, 08:39 PM#3
Joker
Im talking about jass
01-10-2007, 09:23 PM#4
darkwulfv
No, because conditions determine whether the trigger fires or not, if/then determines whether the "then" actions fire.

Unless you were talking about using it some other way.
And I beleive you CAN use locals in conditions anyways, depending.
01-10-2007, 09:28 PM#5
Rising_Dusk
Conditions are just functions that return booleans.
You can do anything in them you could do in any normal function.
Yes, that includes use locals, etc.

Conditions for dynamic triggers are generally a pain because you have to clean them up.
That includes attaching them to the trigger, etc.

But for premade triggers that will be used many times, conditions are better.
That is because if a condition is false, the trigger will not run. Whereas for the if/then the trigger always runs.
01-10-2007, 09:33 PM#6
darkwulfv
Conditions are especially better for triggers which are run very often but only under a certain condition, because then it will help to reduce lag.
01-11-2007, 12:46 AM#7
Pyrogasm
I posted a thread on a related topic that you might like to check out.