• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] So what am I doing wrong this time?

Status
Not open for further replies.
+SOLVED+

All of the instances end at 1 for some reason I can't see. Hope to get some help on this because I don't know what little part I am missing. . .


[trigger=]
Events
Map initialization
Conditions
Actions
Set FR_SFX = Abilities\Spells\Other\ImmolationRed\ImmolationRedTarget.mdl

[/trigger]


[trigger=]
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to FireRing
Actions
Set FR_Index = (FR_Index + 1)
Custom script: set udg_FR_unitgroup[udg_FR_Index] = CreateGroup()
Set FR_caster[FR_Index] = (Triggering unit)
Set FR_Owner[FR_Index] = (Owner of FR_caster[FR_Index])
Set FR_point = (Position of FR_caster[FR_Index])
Set FR_point3 = (Target point of ability being cast)
Set FR_Area[FR_Index] = 200.00
Unit - Create 1 Dummy for FR_Owner[FR_Index] at FR_point3 facing Default building facing degrees
Set FR_dummy[FR_Index] = (Last created unit)
Animation - Change FR_dummy[FR_Index] flying height to 75.00 at 0.00
Animation - Change FR_dummy[FR_Index]'s size to ((FR_Area[FR_Index] x 1.50)%, 100.00%, 100.00%) of its original size
Special Effect - Create a special effect attached to the origin of FR_dummy[FR_Index] using FR_SFX
Set FR_ActualSfx[FR_Index] = (Last created special effect)
Set FR_Time[FR_Index] = (10.00 x (Real((Level of (Ability being cast) for FR_caster[FR_Index]))))
Set FR_TimeDecrease[FR_Index] = 0.05
Set FR_Damage[FR_Index] = 5.00
Set FR_ResetInterval[FR_Index] = 5
Set FR_HitInterval[FR_Index] = FR_ResetInterval[FR_Index]
Set FR_GrabGroup = (Units within FR_Area[FR_Index] of FR_point3)
Unit Group - Pick every unit in FR_GrabGroup and do (Actions)
Loop - Actions
Set FR_unit = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(FR_unit belongs to an enemy of (Owner of FR_caster[FR_Index])) Equal to True
(FR_unit is dead) Not equal to True
Then - Actions
Unit Group - Add FR_unit to FR_unitgroup[FR_Index]
Else - Actions
Set FR_unit = No unit
Custom script: call DestroyGroup(udg_FR_GrabGroup)
Custom script: call RemoveLocation(udg_FR_point)
Custom script: call RemoveLocation(udg_FR_point3)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
FR_Index Equal to 1
Then - Actions
Custom script: set udg_FR_Time[0] = 0.03125
Countdown Timer - Start FR_Timer as a Repeating timer that will expire in FR_Time[0] seconds
Trigger - Turn on FireRingRun <gen>
Else - Actions

[/trigger]



[trigger=]
Events
Time - FR_Timer expires
Conditions
Actions
For each (Integer FR_Loop) from 1 to FR_Index, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(FR_caster[FR_Loop] is dead) Not equal to True
FR_Time[FR_Loop] Greater than 0.00
Then - Actions
Set FR_Time[FR_Loop] = (FR_Time[FR_Loop] - FR_TimeDecrease[FR_Loop])
Set FR_HitInterval[FR_Loop] = (FR_HitInterval[FR_Loop] - 1)
Unit Group - Pick every unit in FR_unitgroup[FR_Loop] and do (Actions)
Loop - Actions
Set FR_unit = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
FR_HitInterval[FR_Loop] Equal to 0
Then - Actions
Unit - Cause FR_caster[FR_Loop] to damage FR_unit, dealing FR_Damage[FR_Loop] damage of attack type Spells and damage type Universal
Else - Actions
Set FR_point = (Position of FR_unit)
Set FR_point2 = (Position of FR_dummy[FR_Loop])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between FR_point2 and FR_point) Greater than FR_Area[FR_Loop]
Then - Actions
Set FR_point4 = (FR_point offset by ((Distance between FR_point and FR_point2) - FR_Area[FR_Loop]) towards (Angle from FR_point to FR_point2) degrees)
Custom script: call SetUnitX (udg_FR_unit , GetLocationX(udg_FR_point4))
Custom script: call SetUnitY (udg_FR_unit , GetLocationY(udg_FR_point4))
Custom script: call RemoveLocation(udg_FR_point4)
Else - Actions
Custom script: call RemoveLocation(udg_FR_point)
Custom script: call RemoveLocation(udg_FR_point2)
Set FR_unit = No unit
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
FR_HitInterval[FR_Loop] Equal to 0
Then - Actions
Set FR_HitInterval[FR_Loop] = FR_ResetInterval[FR_Loop]
Else - Actions
Else - Actions
Game - Display to (All players) the text: (ending instance is + (String(FR_Loop)))
Special Effect - Destroy FR_ActualSfx[FR_Loop]
Set FR_ActualSfx[FR_Loop] = FR_ActualSfx[FR_Index]
Set FR_Owner[FR_Loop] = FR_Owner[FR_Index]
Custom script: set udg_FR_Owner[udg_FR_Index] = null
Set FR_caster[FR_Loop] = FR_caster[FR_Index]
Set FR_caster[FR_Index] = No unit
Unit - Kill FR_dummy[FR_Loop]
Set FR_dummy[FR_Loop] = FR_dummy[FR_Index]
Set FR_dummy[FR_Index] = No unit
Custom script: call DestroyGroup(udg_FR_unitgroup[udg_FR_Loop])
Set FR_unitgroup[FR_Loop] = FR_unitgroup[FR_Index]
Custom script: set udg_FR_unitgroup[udg_FR_Index] = null
Set FR_Index = (FR_Index - 1)
Set FR_Loop = (FR_Loop - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
FR_Index Equal to 0
Then - Actions
Countdown Timer - Pause FR_Timer
Trigger - Turn off (This trigger)
Else - Actions
[/trigger]


Edit: So I went bug-checking again through it and it seems the loop is mal-functioning... Not entirely sure.

Edit2: I am an idiot as usual, discovered what was wrong and managed to fix it. Sorry to bother you guys. I forgot to do Set FR_Time[FR_Loop] = FR_Time[FR_Index] which without it caused the time condition to be the same for every instance.
 
Last edited:
Status
Not open for further replies.
Top