HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Creating local triggers in functions...

06-08-2006, 02:09 AM#1
Sharingan
Everytime if I try to create a Local Trigger in a function(normal function), registering certain events and executing certain actions, the local trigger I made seems to be trippled....
Like, it does register the event, and it does do the added action, just 3 times in a row, like if it was looping!
Why?
06-08-2006, 02:17 AM#2
TaintedReality
Post your code, unless you just want us to make random guesses ><.
06-08-2006, 09:27 AM#3
StockBreak
Quote:
Originally Posted by Sharingan
Everytime if I try to create a Local Trigger in a function(normal function), registering certain events and executing certain actions, the local trigger I made seems to be trippled....
Like, it does register the event, and it does do the added action, just 3 times in a row, like if it was looping!
Why?
Well, you are completely right! The same thing happens so often to me! Did you noticed for example that, if you use a function such as "DisplayTextToForce( blah blah )", the message is shown 3 times? I checked my code many times, but I couldn't find anything wrong (actually not every time it triples itself). However I found a solution: If u don't need anymore that trigger (for example if you destroy it after the first time you use it), just put a
Collapse JASS:
call DisableTrigger( GetTriggeringTrigger(  ) )
at the beginning of your trigger code and the matter it's solved; maybe it's a sort of bug...
06-08-2006, 11:19 AM#4
iNfraNe
no, its definately something wrong with your code. Dont make these kinds of solutions to bugs in your code. Fix them the proper way instead.
06-08-2006, 11:41 AM#5
Sharingan
@StockBreak
Wow, thank you dude...!!
BTW, You can always enable the trigger afterwards again :>>, if you want to reuse it!
06-08-2006, 11:50 AM#6
Vexorian
No no no that's just wrong, please tell me you are destroying the darn trigger ? If you create a trigger you have to destroy it once you no longer need it.
06-08-2006, 11:58 AM#7
StockBreak
Yes, the trigger must be destroyed at the end (if you don't need it again, of course), but in order to prevent the "triple message" on the screen I found that disabling it at the beginning of the code works well.
06-08-2006, 01:01 PM#8
blu_da_noob
That most likely happens because the trigger is triggering itself in some way.
06-08-2006, 01:12 PM#9
Vexorian
Quote:
Originally Posted by StockBreak
Yes, the trigger must be destroyed at the end (if you don't need it again, of course), but in order to prevent the "triple message" on the screen I found that disabling it at the beginning of the code works well.
It doesn't have any sense and shouldn't happen at all. so please show code
Creating local triggers in functions... - Wc3C.net