Wrda
Spell Reviewer
- Joined
- Nov 18, 2012
- Messages
- 2,025
What is supposed to happen when Whelp Carrying Red Dragon dies? The other interceptors die and de-index or?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Yes, I switch the whelp units, their point and set -1 to their integer. But first I wasn't able to fire the actions properly because, as you wrote, the double array was considered as one.What is supposed to happen when Whelp Carrying Red Dragon dies? The other interceptors die and de-index or?
Carrier Train Index

Events


Unit - A unit enters (Playable map area)

Conditions

Actions


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



If - Conditions




(Unit-type of (Entering unit)) Equal to Whelp Carrying Red Dragon



Then - Actions




Set CarrierIndexInteger = (CarrierIndexInteger + 1)




Set CarrierTrained[CarrierIndexInteger] = (Entering unit)




Unit Group - Add CarrierTrained[CarrierIndexInteger] to CarrierGroup




-------- Check If Ready to Go --------




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





If - Conditions






CarrierIndexInteger Greater than 0





Then - Actions





Else - Actions



Else - Actions
Interceptor Train MUI

Events


Unit - A unit Starts the effect of an ability

Conditions

Actions


For each (Integer CarrierCastInteger) from 1 to CarrierIndexInteger, do (Actions)



Loop - Actions




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





If - Conditions






(Ability being cast) Equal to Train Intercepting Red Dragon Whelp (Berserk)






CarrierInterceptorIndexInteger[CarrierCastInteger] Less than 8






(Casting unit) Equal to CarrierTrained[CarrierCastInteger]





Then - Actions






Game - Display to (All players) the text: Carrier Casts






Set CarrierInterceptorIndexInteger[CarrierCastInteger] = (CarrierInterceptorIndexInteger[CarrierIndexInteger] + 1)






Set InterceptorCreatePoint[CarrierCastInteger] = (Position of CarrierTrained[CarrierCastInteger])






Unit - Create 1 Intercepting Red Dragon Whelp for Player 1 (Red) at InterceptorCreatePoint[CarrierCastInteger] facing (Facing of CarrierTrained[CarrierCastInteger]) degrees






Set CarrierInterceptorUnit[CarrierCastInteger] = (Last created unit)






Game - Display to (All players) the text: (Name of CarrierInterceptorUnit[CarrierCastInteger])






Set InterceptorArrayGroup[CarrierCastInteger] = (Units within 512.00 of (Position of CarrierTrained[CarrierCastInteger]) matching ((Triggering unit) Equal to CarrierInterceptorUnit[CarrierInterceptorInteger]))






Unit Group - Add CarrierInterceptorUnit[CarrierCastInteger] to InterceptorArrayGroup[CarrierCastInteger]






Game - Display to (All players) the text: (InterceptorIndexInteger + (String(CarrierInterceptorIndexInteger[CarrierCastInteger])))






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







If - Conditions








CarrierInterceptorIndexInteger[CarrierCastInteger] Equal to 8







Then - Actions








Unit - For CarrierTrained[CarrierCastInteger], Ability Train Intercepting Red Dragon Whelp (Berserk), Hide ability: True







Else - Actions





Else - Actions
Interceptor Clear MUI

Events


Unit - A unit Dies

Conditions

Actions


For each (Integer InterceptorDieInteger) from 1 to CarrierInterceptorInteger, do (Actions)



Loop - Actions




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





If - Conditions






(Dying unit) Equal to CarrierInterceptorUnit[InterceptorDieInteger]






((Dying unit) is in InterceptorArrayGroup[InterceptorDieInteger]) Equal to True





Then - Actions






Game - Display to (All players) the text: Interceptor Died






Unit Group - Remove CarrierInterceptorUnit[InterceptorDieInteger] from InterceptorArrayGroup[InterceptorDieInteger]






Set CarrierInterceptorUnit[CarrierInterceptorInteger] = CarrierInterceptorUnit[InterceptorDieInteger]






Set CarrierInterceptorInteger = (CarrierInterceptorInteger - 1)






Set InterceptorDieInteger = (InterceptorDieInteger - 1)






Set InterceptorMoveOrderInteger = (InterceptorMoveOrderInteger - 1)






Set InterceptorCarrierPositionItgr = (InterceptorCarrierPositionItgr - 1)






Game - Display to (All players) the text: (InterceptorIndexInteger + (String(CarrierInterceptorInteger)))





Else - Actions




-------- Unhide Interceptor Train Ability --------




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





If - Conditions






CarrierInterceptorInteger Less than 8





Then - Actions






Unit - For CarrierTrained[InterceptorDieInteger], Ability Train Intercepting Red Dragon Whelp (Berserk), Hide ability: False





Else - Actions
Interceptor Train MUI

Events


Unit - A unit Starts the effect of an ability

Conditions

Actions


For each (Integer CarrierCastInteger) from 1 to CarrierIndexInteger, do (Actions)



Loop - Actions




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





If - Conditions






(Ability being cast) Equal to Train Intercepting Red Dragon Whelp (Berserk)






CarrierInterceptorInteger Less than 8






(Casting unit) Equal to CarrierTrained[CarrierCastInteger]





Then - Actions






Game - Display to (All players) the text: Carrier Casts






Set CarrierInterceptorIndexInteger[CarrierCastInteger] = (CarrierInterceptorIndexInteger[CarrierIndexInteger] + 1)






Set InterceptorCreatePoint[CarrierCastInteger] = (Position of CarrierTrained[CarrierCastInteger])






Unit - Create 1 Intercepting Red Dragon Whelp for Player 1 (Red) at InterceptorCreatePoint[CarrierCastInteger] facing (Facing of CarrierTrained[CarrierCastInteger]) degrees






Set CarrierInterceptorUnit[CarrierCastInteger] = (Last created unit)






Game - Display to (All players) the text: (Name of CarrierInterceptorUnit[CarrierCastInteger])






Set InterceptorArrayGroup[CarrierCastInteger] = (Units within 512.00 of (Position of CarrierTrained[CarrierCastInteger]) matching ((Triggering unit) Equal to CarrierInterceptorUnit[CarrierInterceptorInteger]))






Unit Group - Add CarrierInterceptorUnit[CarrierCastInteger] to InterceptorArrayGroup[CarrierCastInteger]






Game - Display to (All players) the text: (InterceptorIndexInteger + (String(CarrierInterceptorIndexInteger[CarrierCastInteger])))






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







If - Conditions








CarrierInterceptorIndexInteger[CarrierCastInteger] Equal to 8







Then - Actions








Unit - For CarrierTrained[CarrierCastInteger], Ability Train Intercepting Red Dragon Whelp (Berserk), Hide ability: True







Else - Actions





Else - Actions
Interceptor Clear MUI

Events


Unit - A unit Dies

Conditions

Actions


For each (Integer InterceptorDieInteger) from 1 to CarrierCastInteger, do (Actions)



Loop - Actions




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





If - Conditions






(Dying unit) Equal to CarrierInterceptorUnit[InterceptorDieInteger]






((Dying unit) is in InterceptorArrayGroup[InterceptorDieInteger]) Equal to True





Then - Actions






Game - Display to (All players) the text: Interceptor Died






Unit Group - Remove CarrierInterceptorUnit[InterceptorDieInteger] from InterceptorArrayGroup[InterceptorDieInteger]






Set CarrierInterceptorUnit[InterceptorDieInteger] = CarrierInterceptorUnit[CarrierCastInteger]






Set CarrierInterceptorIndexInteger[InterceptorDieInteger] = (CarrierInterceptorIndexInteger[CarrierCastInteger] - 1)






Set InterceptorDieInteger = (InterceptorDieInteger - 1)






Set InterceptorMoveOrderInteger = (InterceptorMoveOrderInteger - 1)






Set InterceptorCarrierPositionItgr = (InterceptorCarrierPositionItgr - 1)






Game - Display to (All players) the text: (InterceptorIndexInteger + (String(CarrierInterceptorIndexInteger[InterceptorDieInteger])))





Else - Actions




-------- Unhide Interceptor Train Ability --------




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





If - Conditions






CarrierInterceptorIndexInteger[InterceptorDieInteger] Less than 8





Then - Actions






Unit - For CarrierTrained[InterceptorDieInteger], Ability Train Intercepting Red Dragon Whelp (Berserk), Hide ability: False





Else - Actions
Carrier Train Index

Events


Unit - A unit enters (Playable map area)

Conditions

Actions


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



If - Conditions




(Unit-type of (Entering unit)) Equal to Whelp Carrying Red Dragon



Then - Actions




Set CarrierMaxIndex = (CarrierMaxIndex + 1)




Set CarrierTrained[CarrierMaxIndex] = (Entering unit)




Unit Group - Add CarrierTrained[CarrierMaxIndex] to CarrierGroup




-------- Check If Ready to Go --------




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





If - Conditions






CarrierMaxIndex Greater than 0





Then - Actions





Else - Actions



Else - Actions
Interceptor Train MUI

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Train Intercepting Red Dragon Whelp (Berserk)

Actions


For each (Integer CarrierLoop) from 1 to CarrierMaxIndex, do (Actions)



Loop - Actions




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





If - Conditions






CarrierInterceptorIndexInteger[CarrierLoop] Less than 8






(Casting unit) Equal to CarrierTrained[CarrierLoop]





Then - Actions






Game - Display to (All players) the text: Carrier Casts






Set CarrierInterceptorIndexInteger[CarrierLoop] = (CarrierInterceptorIndexInteger[CarrierLoop] + 1)






Set Point = (Position of CarrierTrained[CarrierLoop])






Unit - Create 1 Intercepting Red Dragon Whelp for Player 1 (Red) at Point facing (Facing of CarrierTrained[CarrierLoop]) degrees






Custom script: call RemoveLocation(udg_Point)






Unit Group - Add (Last created unit) to InterceptorArrayGroup[CarrierLoop]






Game - Display to (All players) the text: (InterceptorIndexInteger + (String(CarrierInterceptorIndexInteger[CarrierLoop])))






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







If - Conditions








CarrierInterceptorIndexInteger[CarrierLoop] Equal to 8







Then - Actions








Unit - For CarrierTrained[CarrierLoop], Ability Train Intercepting Red Dragon Whelp (Berserk), Hide ability: True







Else - Actions






Set CarrierLoop = (CarrierMaxIndex + 1)





Else - Actions
Interceptor Clear MUI

Events


Unit - A unit Dies

Conditions

Actions


For each (Integer InterceptorDieLoop) from 1 to CarrierMaxIndex, do (Actions)



Loop - Actions




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





If - Conditions






((Triggering unit) is in InterceptorArrayGroup[InterceptorDieLoop]) Equal to True





Then - Actions






Game - Display to (All players) the text: Interceptor Died






Unit Group - Remove (Triggering unit) from InterceptorArrayGroup[InterceptorDieLoop]






Set CarrierInterceptorIndexInteger[InterceptorDieLoop] = (CarrierInterceptorIndexInteger[InterceptorDieLoop] - CarrierInterceptorIndexInteger[InterceptorDieLoop])






Set InterceptorMoveOrderInteger[InterceptorDieLoop] = (InterceptorMoveOrderInteger[InterceptorDieLoop] - 1)






Set InterceptorCarrierPositionItgr[InterceptorDieLoop] = InterceptorCarrierPositionItgr[InterceptorDieLoop]






Game - Display to (All players) the text: (InterceptorIndexInteger + (String(CarrierInterceptorIndexInteger[CarrierLoop])))





Else - Actions




-------- Unhide Interceptor Train Ability --------




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





If - Conditions






CarrierInterceptorIndexInteger[InterceptorDieLoop] Less than 8





Then - Actions






Unit - For CarrierTrained[InterceptorDieLoop], Ability Train Intercepting Red Dragon Whelp (Berserk), Hide ability: False





Else - Actions




-------- -----DEINDEX--- --------




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





If - Conditions






(Triggering unit) Equal to CarrierTrained[InterceptorDieLoop]





Then - Actions






Unit Group - Pick every unit in InterceptorArrayGroup[InterceptorDieLoop] and do (Actions)







Loop - Actions








Unit - Kill (Picked unit)






Unit Group - Remove all units from InterceptorArrayGroup[InterceptorDieLoop]






Set CarrierTrained[InterceptorDieLoop] = CarrierTrained[CarrierMaxIndex]






Set InterceptorArrayGroup[InterceptorDieLoop] = InterceptorArrayGroup[CarrierMaxIndex]






Set InterceptorDieLoop = (InterceptorDieLoop - 1)






Set CarrierMaxIndex = (CarrierMaxIndex - 1)





Else - Actions
I'm not sure I understand that, but maybe I've already done that. All variables like CarrierTrained and the InterceptorArrayGroup (more) are pointing to the corresponding to an index, if you're trying to reference to a every from the intereceptorgroup with a variable then don't, since you can just pick every unit in the group and do what you want with them.OK, I guess the integer with an array means the same mistake as before but how will I be able to make a specific integer for this specific chain (carrier and its interceptors)
Why this? It wasn't necessary in the non-MUI version or any loops I've made for it?
Set CarrierLoop = (CarrierMaxIndex + 1)![]()
Why not loop integer after =?
![]()
![]()
![]()
![]()
![]()
Set CarrierInterceptorIndexInteger[InterceptorDieLoop] = (CarrierInterceptorIndexInteger[InterceptorDieLoop] - CarrierInterceptorIndexInteger[InterceptorDieLoop])![]()
![]()
![]()
![]()
![]()
![]()
Set InterceptorMoveOrderInteger[InterceptorDieLoop] = (InterceptorMoveOrderInteger[InterceptorDieLoop] - 1)![]()
![]()
![]()
![]()
![]()
![]()
Set InterceptorCarrierPositionItgr[InterceptorDieLoop] = InterceptorCarrierPositionItgr[InterceptorDieLoop]![]()
Set CarrierInterceptorIndexInteger[InterceptorDieLoop] = (CarrierInterceptorIndexInteger[InterceptorDieLoop] - 1)
Set CarrierInterceptorIndexInteger[InterceptorDieLoop] = (CarrierInterceptorIndexInteger[InterceptorDieLoop] - CarrierInterceptorIndexInteger[InterceptorDieLoop])
it isn't necessary but makes the loop exit when we found which carrier casted the spell, so if we know the [index] we do other actions and make it exit loop so it doesn't need to check more indexes and conditionsWhy this? It wasn't necessary in the non-MUI version or any loops I've made for it?
now it's fixed.
Unit - For (Triggering unit), Ability SomeAbility, Hide ability: True/False
I wishFixed.
Well, you didn't have that so Interceptor Clear MUI didn't even run because the 2nd index of the group didn't even exist XDNow my question is... did you initialize the groups? InterceptorArrayGroup[some high value]? Otherwise, in a map initialization trigger do it:Because you can't add units to a group that doesn't even exist.
Custom Script: call set udg_InterceptorArrayGroup[loop] = CreateGroup()
But I have no such problem with the shield triggers, possibly because I only use one unit group where all shield bearing units are included?Note that array unit groups and similars like player groups are NOT initialized, meaning only the first index is, if you want to use more indexes then increase the size of the variable on the variable dialog:
Obviously, why I seek help.I still think you're kind of lost in all of this dynamic indexing logic xD
Hey, thanks again!Any way, It seems finally work 100% after playing around.
Set InterceptorDieLoop = (InterceptorDieLoop - 1)
Hmm, I have this trigger and it kills all my spiders instead of the one actually close to the target:3: Yes, because pick every unit action has "Kill - Picked Unit" and that will "pause" the actions queue and fire again because the event is "A unit dies", and then it fires all those unnecessary actions.
Spider Mine Attack

Events


Time - Every 0.10 seconds of game time

Conditions

Actions


-------- Spider Mine Movement --------


For each (Integer SpiderMineAttackInteger) from 1 to SpiderMineCountInteger, do (Actions)



Loop - Actions




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





If - Conditions






(Distance between (Position of SpiderMineUnit[SpiderMineAttackInteger]) and (Position of SpiderMineTargetUnit)) Less than or equal to 400.00






(SpiderMineTargetUnit is alive) Equal to True





Then - Actions






Game - Display to (All players) the text: Spider Mine Attack






Unit - Order SpiderMineUnit[SpiderMineAttackInteger] to Undead Crypt Fiend - Unburrow






Set SpiderMineTargetGroup = (Units within 400.00 of (Position of SpiderMineUnit[SpiderMineAttackInteger]) matching ((((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True) and (((Matching unit) is A ground unit) Equal to True)))






Set SpiderMineTargetPoint = (Position of (Random unit from SpiderMineTargetGroup))






Unit Group - Pick every unit in SpiderMineTargetGroup and do (Actions)







Loop - Actions








Unit - Order SpiderMineUnit[SpiderMineAttackInteger] to Move To SpiderMineTargetPoint






-------- Spider Mine Explosion --------






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







If - Conditions








(Distance between (Position of SpiderMineUnit[SpiderMineAttackInteger]) and SpiderMineTargetPoint) Less than or equal to 125.00







Then - Actions








Set SpiderMineExplosionGroup = (Units within 300.00 of (Position of SpiderMineUnit[SpiderMineAttackInteger]) matching ((((Matching unit) is A ground unit) Equal to True) and ((Unit-type of (Matching unit)) Not equal to Nerubian Mine)))








Trigger - Turn off (This trigger)








Unit Group - Pick every unit in SpiderMineExplosionGroup and do (Actions)









Loop - Actions










Unit - Cause VultureTrainedUnit to damage (Picked unit), dealing 200.00 damage of attack type Spells and damage type Normal










Unit - Kill SpiderMineUnit[SpiderMineAttackInteger]










Special Effect - Create a special effect at SpiderMineTargetPoint using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl










Set SpiderMineFX = (Last created special effect)








Trigger - Turn on (This trigger)








Custom script: call DestroyGroup (udg_SpiderMineExplosionGroup)








Special Effect - Destroy SpiderMineFX







Else - Actions






Custom script: call DestroyGroup (udg_SpiderMineTargetGroup)






Custom script: call RemoveLocation (udg_SpiderMineTargetPoint)





Else - Actions






Unit - Order SpiderMineUnit[SpiderMineCountInteger] to Undead Crypt Fiend - Burrow
Spider Mine Count

Events


Unit - A unit Spawns a summoned unit

Conditions

Actions


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



If - Conditions




(Unit-type of (Summoned unit)) Equal to Nerubian Mine




(Summoning unit) Equal to VultureTrainedUnit




SpiderMineCountInteger Less than 3



Then - Actions




Set SpiderMineCountInteger = (SpiderMineCountInteger + 1)




Set SpiderMineUnit[SpiderMineCountInteger] = (Summoned unit)




Unit Group - Add SpiderMineUnit[SpiderMineCountInteger] to SpiderMineGroup




Unit - Order SpiderMineUnit[SpiderMineCountInteger] to Undead Crypt Fiend - Burrow




Game - Display to (All players) the text: Vulture Casts




Game - Display to (All players) the text: (SpiderMineCountInteger + (String(SpiderMineCountInteger)))




Game - Display to (All players) the text: (SpiderMinesGroup + (String((Number of units in SpiderMineGroup))))




-------- Spider Mine Limit --------




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





If - Conditions






SpiderMineCountInteger Equal to 2





Then - Actions






Unit - For Unit VultureTrainedUnit, Set cooldown of ability Place Nerubian Mine - G , Level: 0 to 10000.00





Else - Actions




Trigger - Add to Spider Mine Target Within Range <gen> the event (Unit - A unit comes within 400.00 of SpiderMineUnit[SpiderMineCountInteger])



Else - Actions
SL_Loop_Integer as the name suggest, is a loop integer. So, if you notice the loop trigger, it is used there.Alright, so i followed this guide and its incredible in so many ways and i have now learnt way more than i had anticipated..
Im hoping someone still looks at this and might be able to help me, since there is 1 thing i just cannot fathom.
Im guessing its an integer variable, but what is its initial value? when is it set? where and how does it stay "above 0" when i can only see that we remove 1 from the value, but never set it up again? = (SL_Loop_Integer) ??
Is it just an integer with an initial value of 1 or smth?
Yes thanks i got that much, so the variable itself, what is its initial value?SL_Loop_Integer as the name suggest, is a loop integer. So, if you notice the loop trigger, it is used there.
For SL_Loop_Integer from 1 to X means that the value for the variable will Loop from 1 to X
Initial Value of SL_Loop_Integer is 0 of Integer type.Yes thanks i got that much, so the variable itself, what is its initial value?
I understand its purpose but not if i need to do anything but create it?
Thank you very much!Initial Value of SL_Loop_Integer is 0 of Integer type.
