I was planning on making a spell where the hero throws cannon balls to a targeted area and damages them per second. I tried using cluster rockets, but the cannon balls were too small, and I have to increase the caster's size for that to happen.
The problem is that the cannon balls arent moving the way they should move. I tried the dynamic indexing way, 'coz I thought it was somewhat what tI needed for the spell. So here's the code:
The problem is that the cannon balls arent moving the way they should move. I tried the dynamic indexing way, 'coz I thought it was somewhat what tI needed for the spell. So here's the code:
-
Genkotsu Ryuseigun
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Genkotsu Ryuseigun
-
-

Actions
-


Set GR_Caster = (Casting unit)
-


Set GR_Loc[0] = (Position of GR_Caster)
-


Set GR_Loc[1] = (Target point of ability being cast)
-


Set GR_Facing = (Angle from GR_Loc[0] to GR_Loc[1])
-


Animation - Change GR_Caster's animation speed to 200.00% of its original speed
-


Trigger - Turn on GR Loop <gen>
-
-
-
GR Loop
-

Events
-


Time - Every 0.20 seconds of game time
-
-

Conditions
-

Actions
-


Set GR_Index = (GR_Index + 1)
-


Animation - Play GR_Caster's attack animation
-


Unit - Create 1 Garp Cannon for (Owner of GR_Caster) at GR_Loc[0] facing GR_Facing degrees
-


Set GR_CDummy[GR_Index] = (Last created unit)
-


Unit - Add a 4.00 second Generic expiration timer to GR_CDummy[GR_Index]
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




GR_Index Equal to 1
-
-



Then - Actions
-




Trigger - Turn on GR Move Loop <gen>
-
-



Else - Actions
-
-
-
-
GR Move Loop
-

Events
-


Time - Every 0.03 seconds of game time
-
-

Conditions
-

Actions
-


For each (Integer GR_Loop_Int) from 1 to GR_Index, do (Actions)
-



Loop - Actions
-




Set GR_Move[GR_Loop_Int] = (GR_Move[GR_Loop_Int] + 40.00)
-




Set GR_MoveLoc[GR_Loop_Int] = (GR_Loc[0] offset by GR_Move[GR_Loop_Int] towards GR_Facing degrees)
-




Unit - Move GR_CDummy[GR_Loop_Int] instantly to GR_MoveLoc[GR_Loop_Int], facing GR_Facing degrees
-




Set GR_Distance[GR_Loop_Int] = (Distance between GR_MoveLoc[GR_Loop_Int] and GR_Loc[1])
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(GR_Distance[GR_Loop_Int] Less than or equal to 40.00) or (GR_Counter Equal to 20)
-
-





Then - Actions
-






Unit - Kill GR_CDummy[GR_Loop_Int]
-






Set GR_Distance[GR_Loop_Int] = 0.00
-






Set GR_Move[GR_Loop_Int] = 0.00
-






Set GR_CDummy[GR_Loop_Int] = GR_CDummy[GR_Index]
-






Set GR_Move[GR_Loop_Int] = GR_Move[GR_Index]
-






Set GR_MoveLoc[GR_Loop_Int] = GR_MoveLoc[GR_Index]
-






Set GR_Distance[GR_Loop_Int] = GR_Distance[GR_Index]
-






Set GR_Index = (GR_Index - 1)
-






Set GR_Loop_Int = (GR_Loop_Int - 1)
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








GR_Index Less than or equal to 0
-
-







Then - Actions
-








Animation - Change GR_Caster's animation speed to 100.00% of its original speed
-








Trigger - Turn off GR Loop <gen>
-








Trigger - Turn off Seconds Counter <gen>
-








Trigger - Turn off (This trigger)
-
-







Else - Actions
-
-
-





Else - Actions
-
-
-
-
-


