- Joined
- Nov 17, 2010
- Messages
- 1,266
I have a spell in my campaign that shoots an arrow into the air, then it splits and drops a bunch of arrows in a targeted area that each deal damage.
The spell works perfectly fine in the first map of my campaign but when I try to transition to the next map it kicks me back to the campaign screen. What is it about this spell that would do that?
I'm not sure if this qualifies to be in the Triggers & Scripts Thread. If it is in the wrong place I hope a mod can move it.
The spell works perfectly fine in the first map of my campaign but when I try to transition to the next map it kicks me back to the campaign screen. What is it about this spell that would do that?
-
Arrow Rain
-
Events
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ARHas[ARLastRecycled] Equal to True
-
-
Then - Actions
-
Set ARMax = (ARMax + 1)
-
Set ARIndex = ARMax
-
-
Else - Actions
-
Set ARIndex = ARLastRecycled
-
Set ARLastRecycled = ARRecycledList[ARLastRecycled]
-
-
-
Set ARCaster[ARIndex] = (Triggering unit)
-
Set ARTargetPoint[ARIndex] = (Target point of ability being cast)
-
Set ARDelay[ARIndex] = 1.00
-
Set ARHas[ARIndex] = True
-
Set ARArrows[ARIndex] = (35 + (5 x (Level of Arrow Rain for ARCaster[ARIndex])))
-
Set ARCount = (ARCount + 1)
-
Set ARDamage[ARIndex] = (20.00 + (5.00 x (Real((Level of Arrow Rain for ARCaster[ARIndex])))))
-
Set TempLoc = (Position of ARCaster[ARIndex])
-
Unit - Create 1 Small Arrow Dummy Up for (Triggering player) at TempLoc facing Default building facing degrees
-
Animation - Change (Last created unit) flying height to 1500.00 at 2500.00
-
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
-
Custom script: call RemoveLocation (udg_TempLoc)
-
Custom script: set udg_ARArrowsGroup[udg_ARIndex] = CreateGroup()
-
Custom script: set udg_ARArrowsGroup2[udg_ARIndex] = CreateGroup()
-
For each (Integer A) from 1 to ARArrows[ARIndex], do (Actions)
-
Loop - Actions
-
Unit - Create 1 Small Arrow Dummy for (Triggering player) at ARTargetPoint[ARIndex] facing Default building facing degrees
-
Unit Group - Add (Last created unit) to ARArrowsGroup[ARIndex]
-
Animation - Change (Last created unit) flying height to 1500.00 at 0.00
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Arrow Rain Loop <gen> is on) Equal to False
-
-
Then - Actions
-
Trigger - Turn on Arrow Rain Loop <gen>
-
-
Else - Actions
-
-
-
-
Arrow Rain Loop
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer ARInteger) from 0 to ARMax, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ARHas[ARInteger] Equal to True
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ARDelay[ARInteger] Greater than 0.00
-
-
Then - Actions
-
Set ARDelay[ARInteger] = (ARDelay[ARInteger] - 0.03)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Number of units in ARArrowsGroup[ARInteger]) Greater than 0
-
(Number of units in ARArrowsGroup2[ARInteger]) Greater than 0
-
-
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in ARArrowsGroup[ARInteger]) Greater than 0
-
-
Then - Actions
-
Set TempUnit = (Random unit from ARArrowsGroup[ARInteger])
-
Set ARArrows[ARInteger] = (ARArrows[ARInteger] - 1)
-
Unit Group - Add TempUnit to ARArrowsGroup2[ARInteger]
-
Unit Group - Remove TempUnit from ARArrowsGroup[ARInteger]
-
Set TempLoc = (ARTargetPoint[ARInteger] offset by (Random real number between 0.00 and 150.00) towards (Random angle) degrees)
-
Unit - Move TempUnit instantly to TempLoc
-
Custom script: call RemoveLocation (udg_TempLoc)
-
-
Else - Actions
-
-
Unit Group - Pick every unit in ARArrowsGroup2[ARInteger] and do (Actions)
-
Loop - Actions
-
Set TempReal = ((Current flying height of (Picked unit)) - 50.00)
-
Animation - Change (Picked unit) flying height to TempReal at 0.00
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TempReal Less than or equal to 0.00
-
-
Then - Actions
-
Unit - Add a 1.00 second Generic expiration timer to (Picked unit)
-
Set TempLoc = (Position of (Picked unit))
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 50.00 of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of ARCaster[ and do (Actions)
-
Loop - Actions
-
Unit - Cause ARCaster[ARInteger] to damage (Picked unit), dealing ARDamage[ARInteger] damage of attack type Pierce and damage type Normal
-
-
-
Custom script: call RemoveLocation (udg_TempLoc)
-
Unit Group - Remove (Picked unit) from ARArrowsGroup2[ARInteger]
-
-
Else - Actions
-
-
-
-
-
Else - Actions
-
Set ARCount = (ARCount - 1)
-
Set ARHas[ARInteger] = False
-
Custom script: call RemoveLocation (udg_ARTargetPoint[udg_ARInteger])
-
Custom script: call DestroyGroup (udg_ARArrowsGroup[udg_ARInteger])
-
Custom script: call DestroyGroup (udg_ARArrowsGroup2[udg_ARInteger])
-
Set ARRecycledList[ARInteger] = ARLastRecycled
-
Set ARLastRecycled = ARInteger
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ARCount Equal to 0
-
-
Then - Actions
-
For each (Integer A) from 0 to ARMax, do (Set ARRecycledList[(Integer A)] = 0)
-
Set ARLastRecycled = 0
-
Set ARMax = 0
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
-
-
-
-
Else - Actions
-
-
-
-
-
I'm not sure if this qualifies to be in the Triggers & Scripts Thread. If it is in the wrong place I hope a mod can move it.