can be made easily by using existing systems that other users wrote.
but that is only an advantage if you have at least basic jass knowledge

for him, i'd prefer GUI triggers.
amazing. you make this seem so simple
so the only difference is that you set SB_Index to "Custom value of SB_Missile" instead of "Custom value of SB_Caster"?
god, more questions pop up for every answer. Youre so nice to answer all of them so quickly!
I feel like I should know at least the basics of how this index system works... I dont understand how the "Unit Indexer" trigger links to the other triggers. The trigger itself just runs on map initialization and it never gets referenced in the Storm Bolt triggers. So how does it index units getting spawned/bought etc?
Where does the Custom Value come from, and how can it change or whatever? I dont see it manipulated anywhere in the triggers or anything.
The custom value is a basic thing in warcraft 3, you can basically attach an integer number to every unit with it. a unit indexer gives a unit a value that is unique.
for example: you have 3 units on your map on map initialization. the indexer will loop through them and give them the number 1 to 3 (or 0 to 2)
so:
Footman gets Custom value 1
Knight gets 2
Mountain King gets 3
now whenever a new unit enters the map, the counter will increase and the unit will get a unique number.
you create a bloodmage, he will get the custom value 4... and so on
EVERY UNIT will have a unique number, and you can make use of this by creating MUI spells
MUI means Multi Unit Indexing and is basically the ability to cast spells more than once in the same time by more units without bugging.
I will do an example here: A target ability that just deals damage after a 5 seconds delay.
Without MUI
-
Trig Cast
-

Events
-


Einheit - A unit starts the effect of an ability
-

Conditions
-


(Ability being cast) equal to YourAbility
-

Actions
-


Set Caster = (Triggering unit)
-


Set Target = (Target unit of ability being cast)
-


Set Time = 5.00
-


Trigger - Turn on Trig Loop <gen>
-
Trig Loop
-

Events
-


Time - Every 0.10 seconds of game time
-

Conditions
-

Actions
-


Set Time = (Time - 0.10)
-


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



'IF'-Conditions
-



'THEN'-Actions
-




Unit - Cause Caster to damage Target, dealing 500.00 damage of attack type Spell and damage type Normal
-




Trigger - Turn off (This trigger)
-



'ELSE'-Actions
this works just fine as long as it's the only unit casting it. Why?
Imagine. A paladin casts the ability, so the Caster variable is set to the Paladin. Now, if the 5 second Time variable is not over, and a Bloodmage casts the ability, the Time will be set back to 5 and the Caster is now the Bloodmage, so the Paladin ability gets basically interrupted by the Bloodmage cast (the Bloodmage cast will now deal damage after the 5 seconds except if another unit casts this ability again and sets everything back

)
Now, we do some fixes to get around this problem, we use Custom value and Arrays to make it MUI. I assume you know what an array is.
-
Trig Cast
-

Events
-


Unit - A unit starts the effect of an ability
-

Conditions
-


(Ability being cast) equal to YourAbility
-

Actions
-


Set Caster = (Triggering unit)
-


Set Index = (Custom value of Caster)
-


Set Target[Index] = (Target unit of ability being cast)
-


Set Time[Index] = 5.00
-


Unit Group - Add Caster to Group
-


Trigger - Turn on Trig Loop <gen>
-
Trig Loop
-

Events
-


Time - Every 0.10 seconds of game time
-

Conditions
-

Actions
-


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



Loop - Actions
-




Set Caster = (Picked unit)
-




Set Index = (Custom value of Caster)
-




Set Time[Index] = (Time[Index] - 0.10)
-




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





'IF'-Conditions
-






Time[Index] smaller than 0.00
-





'THEN'-Actions
-






Unit - Cause Caster to damage Target[Index], dealing 500.00 damage of attack type Spell and damage type Normal
-






Unit Group - Remove Caster from Group
-





'ELSE'-Actions
-


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



'IF'-Conditions
-




(Group is empty) equal to True
-



'THEN'-Actions
-




Trigger - Turn off (This trigger)
-



'ELSE'-Actions
what is different here?
well lets take the example from before.
Paladin casts the ability and he has the custom value 5
so Index is 5 and the target and the time will be saved in the fifth array field.
Target[5] = Target Unit of Ability
Time[5] = 5.00
now, in the loop, the paladin is picked (because it got added before) and the Index will be setted to the custom value of the Paladin again, so Index = 5
Now he will load his Target and time properly.
Time[5] = Time[5] - 0.1
damage Target[5]
Let us do the same thing as before, the Bloodmage now casts his ability while the paladin's ability is not over yet.
what happens:
Index is set to the BLOODMAGES custom value, for example 8.
so we will save the target and the time in those variable fields.
Target[8] = Target Unit of Ability
Time[8] = 5.00
but we will NOT overwrite the Paladins variables, because they are saved in [5].
Bloodmage is added to the group and will loop properly with his Index (8) through the group
I hope that helps
