HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

loooping triggers

08-11-2004, 08:49 PM#1
Panzer_Fusion
Uh, yeah, could someone help me with my looping trigger?


The trigger is

Event: a unit casts a spell targeting a unit

Conditions:Spell = EMP burst

Action: for every integer 1 - 60 do the following

loop: create one SFX of Dark ritual@[email protected]
wait one second




For some reason, the trigger doesn't loop. The first special effect appears, but that is it... Help would be nice thankyou.
08-11-2004, 09:37 PM#2
wwsage
Hm,

For Each integerA from 1-60
Creat one sfx w.ew.ew.e
Wait 1 game time seconds

I know doing 1 game-time second is better than normal seconds.

Other than that I'm not sure
08-12-2004, 02:47 AM#3
Rafael Br
Wait actions don't work with loops, try making a timmer and run a trigger to create the special effect.I never use wait game time in triggered spells, it is not exactly, but you may use it if you want.
08-12-2004, 02:59 AM#4
wwsage
I know they work with loops part of the way because I used one in one of my triggers.
08-12-2004, 03:10 AM#5
Rafael Br
Sometimes they work, sometimes not, there is a lot of posts here mentioning that.
08-12-2004, 05:30 AM#6
Anitarf
In theory, the wait action alone doesn't directly bug the loop, so it may work. In practice, there are other triggers that run while this trigger waits, and these triggers can overwrite the Integer A variable.
08-12-2004, 01:41 PM#7
SpadeZ
Waits do work with loops. I think your problem panzer is that all the loops happen so fast (because of no gap between them) that it looks as though there is only one sfx being created. If you put a wait in the loop, as some people have suggested, then i believe that fixes the problem. But as anitarf has mentioned there could be a problem when you have 2 interger A loops being run at the same time, but this may not be 100% true, since interger A not a global variable i'm pretty sure it is only used by the one function that accesses it, while another function that uses a similar loop will use a different interger A, much like algebra where A is a pronumeral used for substitution purposes. Therefore it is possible to assume that the game creates a new different local variable each time the loop is run, or are unique local variable is used for each different loop.

Alot of gibberish.

08-12-2004, 10:18 PM#8
Panzer_Fusion
Actually, there was a problem. In antoher thread it was answered, and the thing had nothing to do with wait bugging the loop. After the first instance, the game didn't know what the targeted unti was, so thats why there was only 1 sfx. And I knew there was only one because teh sfx stopped WAAAAY before the duration was over. Thnx anyways
08-13-2004, 03:35 AM#9
Arksword(sv)
Hey, that was my solution thank you very much :D