I am looking for another pair of expert(er) eyes to help me identify mistakes and just plain wrong GUI coding in this trigger-aided spell. The spell Carrion Swarm releases a wave (much like the original), but now also teleports the caster to the targeted location. The caster is supposed to be immune/untargetable during this travel time, hence the "Hide unit" function.
I am sure my trigger, as it stands, is 90% there. But I am facing a weird bug where the first cast does everything as intended, except the casting unit remains stuck in place, unable to perform any actions (it is as if the game auto-cancels any action/button you press, near instantly).
I am also aware this spell leaks a ton, so I wouldn't mind help in finding those culprits as well.
Below is the initial trigger, with setups for various needed variables (MUI-compatible with the use of arrays):
I am sure my trigger, as it stands, is 90% there. But I am facing a weird bug where the first cast does everything as intended, except the casting unit remains stuck in place, unable to perform any actions (it is as if the game auto-cancels any action/button you press, near instantly).
I am also aware this spell leaks a ton, so I wouldn't mind help in finding those culprits as well.
Below is the initial trigger, with setups for various needed variables (MUI-compatible with the use of arrays):
-
CarrionSwarm Cast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Carrion Swarm (custom)
-
-
Actions
-
Set VariableSet CarrionSwarm_PlayerIndex = ((Player number of (Owner of (Casting unit))) - 2)
-
-------- CarrionSwarm_Index is calculated this way because the first two player numbers are reserved for non-player factions. Player 1 is actually Player 3 by game's definition. --------
-
Set VariableSet CarrionSwarm_Caster[CarrionSwarm_PlayerIndex] = (Casting unit)
-
Set VariableSet CarrionSwarm_CastPoint[CarrionSwarm_PlayerIndex] = (Position of CarrionSwarm_Caster[CarrionSwarm_PlayerIndex])
-
Set VariableSet CarrionSwarm_TargetPoint[CarrionSwarm_PlayerIndex] = (Target point of ability being cast)
-
Set VariableSet CarrionSwarm_Distance[CarrionSwarm_PlayerIndex] = (Integer((Distance between CarrionSwarm_CastPoint[CarrionSwarm_PlayerIndex] and CarrionSwarm_TargetPoint[CarrionSwarm_PlayerIndex])))
-
Set VariableSet CarrionSwarm_Angle[CarrionSwarm_PlayerIndex] = (Integer((Angle from CarrionSwarm_CastPoint[CarrionSwarm_PlayerIndex] to CarrionSwarm_TargetPoint[CarrionSwarm_PlayerIndex])))
-
Set VariableSet CarrionSwarm_InvAngle[CarrionSwarm_PlayerIndex] = (Integer((Angle from CarrionSwarm_TargetPoint[CarrionSwarm_PlayerIndex] to CarrionSwarm_CastPoint[CarrionSwarm_PlayerIndex])))
-
Unit - Create 1 CarrionSwarmDummy for (Owner of CarrionSwarm_Caster[CarrionSwarm_PlayerIndex]) at CarrionSwarm_CastPoint[CarrionSwarm_PlayerIndex] facing (Real(CarrionSwarm_Angle[CarrionSwarm_PlayerIndex])) degrees
-
Set VariableSet CarrionSwarm_Dummy[CarrionSwarm_PlayerIndex] = (Last created unit)
-
Unit - Hide CarrionSwarm_Caster[CarrionSwarm_PlayerIndex]
-
Trigger - Turn on CarrionSwarm Travel <gen>
-
-
-
CarrionSwarm Travel
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer A) from 1 to 8, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
CarrionSwarm_Distance[(Integer A)] Greater than 0
-
-
Then - Actions
-
Set VariableSet CarrionSwarm_Distance[(Integer A)] = (CarrionSwarm_Distance[(Integer A)] - 30)
-
Unit - Move CarrionSwarm_Dummy[(Integer A)] instantly to (CarrionSwarm_TargetPoint[CarrionSwarm_PlayerIndex] offset by (Real(CarrionSwarm_Distance[(Integer A)])) towards (Real(CarrionSwarm_InvAngle[(Integer A)])) degrees.)
-
-
Else - Actions
-
Unit - Move CarrionSwarm_Caster[(Integer A)] instantly to CarrionSwarm_TargetPoint[(Integer A)]
-
Unit - Unhide CarrionSwarm_Caster[(Integer A)]
-
Selection - Select CarrionSwarm_Caster[(Integer A)] for (Player(((Integer A) + 2)))
-
Unit - Remove CarrionSwarm_Dummy[(Integer A)] from the game
-
-
-
-
-
-