- Joined
- May 16, 2020
- Messages
- 660
Hello all,
I'm trying to make the following spell MUI. The spell is supposed to keep track of the amont of summoned units and, if too many units get summoned, remove the oldest summoned unit.
The trigger below works for 1 Hero. However, when I test this with 2 Heroes, the trigger always deletes units which belong to the other Hero. In my mind the following set-up should prevent this, since for me I clearly refer to different units:
...but for the game these two seem to be the same. Could it be that arrays of integers are ultimately the same? And if so, how can I fix this?
I'm trying to make the following spell MUI. The spell is supposed to keep track of the amont of summoned units and, if too many units get summoned, remove the oldest summoned unit.
The trigger below works for 1 Hero. However, when I test this with 2 Heroes, the trigger always deletes units which belong to the other Hero. In my mind the following set-up should prevent this, since for me I clearly refer to different units:
Unit [integer_1 [CV_A]] =/= integer_1 [CV_B]]
...but for the game these two seem to be the same. Could it be that arrays of integers are ultimately the same? And if so, how can I fix this?
-
Spin Web Summon
-
Events
-
Unit - A unit Spawns a summoned unit
-
-
Conditions
-
(Unit-type of (Summoned unit)) Equal to Spin Web
-
-
Actions
-
Set VariableSet SpinWeb_Caster = (Summoning unit)
-
Set VariableSet SpinWeb_CV = (Custom value of SpinWeb_Caster)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SpinWeb_TotalWebs[SpinWeb_CV] Less than SpinWeb_MaxWebs[SpinWeb_CV]
-
-
Then - Actions
-
Set VariableSet SpinWeb_TotalWebs[SpinWeb_CV] = (SpinWeb_TotalWebs[SpinWeb_CV] + 1)
-
Set VariableSet SpinWeb_Counter[SpinWeb_CV] = (SpinWeb_Counter[SpinWeb_CV] + 1)
-
Set VariableSet SpinWeb_WebUnit[SpinWeb_Counter[SpinWeb_CV]] = (Summoned unit)
-
-
Else - Actions
-
Set VariableSet SpinWeb_Counter[SpinWeb_CV] = (SpinWeb_Counter[SpinWeb_CV] + 1)
-
Unit - Kill SpinWeb_WebUnit[(SpinWeb_Counter[SpinWeb_CV] - SpinWeb_MaxWebs[SpinWeb_CV])]
-
Set VariableSet SpinWeb_WebUnit[SpinWeb_Counter[SpinWeb_CV]] = (Summoned unit)
-
-
-
-