• 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] Problem with a loop-function

Status
Not open for further replies.
Level 16
Joined
Jan 17, 2006
Messages
366
Hi there.
I try to use a Loop for a spell, in wich the hero atacks in a spiral-like form. I prefere to use just a single trigger for it, but when i tries to use a loop inside a trigger it spends more time for the actions, than i woul use two triggers.
If someone did understand the problem i have (besides my bad english) pls help me.

Trigger1:

Events
-Unit - A Unit starts the effect of an Ability

Conditions
-(Ability being cast) equal to "Spell"

Actions
-Wait 0.10 seconds
-set caster = (casting unit)
-Unit - Create 1 missile for (Owner of caster) at ((Position of (caster)) offset by 100.00 towards 90.00 degrees) facing 270 degrees
-Set missile = (last created unit)
-Set range = 100.00
-Unit - Pause caster
-Set the custom value of missile to 100
-Trigger - Turn on Missilecourse
-Trigger - Run Missilecourse
-Wait 1.60 game-time seconds
-Trigger - Turn off Missilecourse
-Unit - Unpause caster
-Unit - Remove missile from the game


End Trigger1



Trigger2 (missilecourse):

Events
-Time - Every 0.05 seconds of game time

Conditions

Actions
-Unit - Move missile instantly to ((Position of caster) offset by range towards (Real((Cusom value of missile))) degrees), facing (Position of caster)
-Set range = (range + 1.00)
-Unit - set the custom value of missile to ((Custom value of missile) + 5)


End Trigger2 (missilecourse)



k this is how far i am to input both to one Trigger


Trigger3 (not working final)

Events
-Unit - A Unit starts the effect of an Ability

Conditions
-(Ability being cast) equal to "Spell"

Actions
-Wait 0.10 seconds
-set caster = (casting unit)
-Unit - Create 1 missile for (Owner of caster) at ((Position of (caster)) offset by 100.00 towards 90.00 degrees) facing 270 degrees
-Set missile = (last created unit)
-Set range = 100.00
-Unit - Pause caster
-Set the custom value of missile to 100

-For each (Integer A) from 1 to 40. do (Actions)
-Loop
+Unit - Move missile instantly to ((Position of caster) offset by range towards (Real((Cusom value of missile))) degrees), facing (Position of caster)
+Set range = (range + 1.00)
+Unit - set the custom value of missile to ((Custom value of missile) + 5)
+Wait 0.04 game-time seconds

-Unit - Unpause caster
-Unit - Remove missile from the game




end Trigger3



thanks for the attention.
 
Level 11
Joined
Jul 12, 2005
Messages
764
The actions 'Wait x seconds' and 'Wait x game time seconds' both have a minimum wait limit. These limits are somewhere between 0.2 and 0.3, this is map-specific, and depends on a few things. If you want a slide thingy, you are obliged to use the two-trigger structure to make it look nice. But here's a thread concerning this "wait-bug", or i don't know what to call this...
http://www.forums.hiveworkshop.com/showthread.php?t=29401
 
Status
Not open for further replies.
Top