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