- Joined
- Aug 11, 2009
- Messages
- 605
Hi!
I am making a spell for a boss fight where a missile spawns at the outer edges of the battle area and moves in a circular motion around the center, slowly moving closer and closer to the center at which point it is destroyed.
The problem is when a second missile spawn before the first missile has been destroyed, the first missile stops moving in a circular motion around the center and is only moved slowly towards the boss at the same angle.
EDIT: I found that in Trigger 2 i had the wrong array, it was "Spell2Instances" instead of "Spell2Loop", this change fixed the first issue but created another. Now all missiles from the start just randomly jumps around between angles instead of following a circular motion...
Anyone can figure out what is wrong?
Thanks in advance!
I am making a spell for a boss fight where a missile spawns at the outer edges of the battle area and moves in a circular motion around the center, slowly moving closer and closer to the center at which point it is destroyed.
The problem is when a second missile spawn before the first missile has been destroyed, the first missile stops moving in a circular motion around the center and is only moved slowly towards the boss at the same angle.
EDIT: I found that in Trigger 2 i had the wrong array, it was "Spell2Instances" instead of "Spell2Loop", this change fixed the first issue but created another. Now all missiles from the start just randomly jumps around between angles instead of following a circular motion...
Anyone can figure out what is wrong?
-
Camp53 Spell 2
-
Events
-
Time - Every (Random real number between 10.00 and 25.00) seconds of game time
-
-
Conditions
-
Actions
-
Set VariableSet Camp53_Spell2Instances = (Camp53_Spell2Instances + 1)
-
Set VariableSet Camp53_Spell2Angle[Camp53_Spell2Instances] = (Random real number between 0.00 and 360.00)
-
Set VariableSet Camp53_Spell2Point[Camp53_Spell2Instances] = (Camp53_BossPoint offset by 1800.00 towards Camp53_Spell2Angle[Camp53_Spell2Instances] degrees.)
-
Unit - Create 1 Death Coil (5-3) for Neutral Hostile at Camp53_Spell2Point[Camp53_Spell2Instances] facing Default building facing degrees
-
Set VariableSet Camp53_Spell2Unit[Camp53_Spell2Instances] = (Last created unit)
-
Custom script: call RemoveLocation(udg_Camp53_Spell2Point[udg_Camp53_Spell2Instances])
-
Trigger - Turn on Camp53 Spell 2 Loop <gen>
-
-
-
Camp53 Spell 2 Loop
-
Events
-
Time - Every 0.05 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer Camp53_Spell2Loop) from 0 to Camp53_Spell2Instances, do (Actions)
-
Loop - Actions
-
Set VariableSet Camp53_Spell2Count[Camp53_Spell2Loop] = (Camp53_Spell2Count[Camp53_Spell2Loop] + 1.00)
-
Set VariableSet Camp53_Spell2Angle[Camp53_Spell2Instances] = (Camp53_Spell2Angle[Camp53_Spell2Loop] + (Camp53_Spell2Count[Camp53_Spell2Loop] x 6.00))
-
Set VariableSet Camp53_Spell2Point[Camp53_Spell2Loop] = (Camp53_BossPoint offset by (1800.00 - (Camp53_Spell2Count[Camp53_Spell2Loop] x 5.00)) towards Camp53_Spell2Angle[Camp53_Spell2Loop] degrees.)
-
Unit - Move Camp53_Spell2Unit[Camp53_Spell2Loop] instantly to Camp53_Spell2Point[Camp53_Spell2Loop]
-
Custom script: call RemoveLocation(udg_Camp53_Spell2Point[udg_Camp53_Spell2Loop])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Camp53_Spell2Count[Camp53_Spell2Loop] Equal to 360.00
-
-
Then - Actions
-
Unit - Kill Camp53_Spell2Unit[Camp53_Spell2Loop]
-
Unit - Remove Camp53_Spell2Unit[Camp53_Spell2Loop] from the game
-
Set VariableSet Camp53_Spell2Unit[Camp53_Spell2Loop] = No unit
-
Set VariableSet Camp53_Spell2UG = (Units owned by Neutral Hostile of type Death Coil (5-3))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in Camp53_Spell2UG) Equal to 0
-
-
Then - Actions
-
Set VariableSet Camp53_Spell2Instances = 0
-
Set VariableSet Camp53_Spell2Count[Camp53_Spell2Loop] = 0.00
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
Custom script: call DestroyGroup(udg_Camp53_Spell2UG)
-
-
Else - Actions
-
-
-
-
-
Thanks in advance!
Last edited: