ok just so use know this is my first turtorial so please give feed back
What is MUI?
MUI is Multi-Unit-Instanceability.It means that if 2 or more units cause a trigger to fire (casting a spell would be best example), the spell's effect will work properly for both units that cast the ability. if the trigger wasent MUI the spell would only work for 1 of the units Also, MUI is basicly impossible to achieve with waits.
why use indexing for MUI spells?
it is easy and a great variable system used by many spell makers to make Multi Unit instancable spells.
there are 2 triggers but very small depending on how complex your spell is
What do you need to use it
nothing it isn't a custom script or anything like that it is simply a variable based system.
Can you make any spell in GUI MUI with this - the answer is yes.only custom script need is for removing leaks
what u will need first off is, you need to make a base ability in the Object Editor which will make the spell fire.
Basic Variables Used In Your Spell
index-a integer Variable[this is the integer variable you use for the indexing part of the spell
MUI-a integer Variable[used for the MUI part of the spell]
Loop-a integer variable used in the looping trigger for the spell
Turn on-(array)a Boolean Variable used for MUI part of the trigger as well
so what the index Variable does is increased and decreased when any units start or finish the spell
and the MUI variable is used for storing the unit/point and so on of the spell
the spell ill be doing for the turtoral of a MUI spell is a sliding spell slides the unit to target of the ability
the start of our trigger(and all MUI triggers in this style)
setting the variables for this particular spell
caster-unit-the unit casting the spell(ARRAY)
casterpos-point-position of the casting unit
targetpoint-ppoint-pont of the ability being used
moved-real-the distance you traveled(ARRAY)
Distance-real-the distance your about to move(ARRAY)
angle-real-the angle(ARRAY)
slide 1-point-the point for sliding of the unit
slide 2-point-the point for sliding of the unit second part
ok now thats all over ill show you the end resault for the first trigger for this spell
so what we got is when a hero casts an ability we add 1 counter(MUI) to the [ ] array of the hero ...
So hero one casts ability ... Set MUI = MUI + 1 >> Set Caster[MUI] = Casting unit....
>hero two casts ability ... Set MUI = MUI + 1 >> Set Caster[MUI] = Casting unit ...
So now as numbers in arrays we have .. Caster[1] and Caster[2] .. they have diffrent arrays so they will not overwrite each other meaning they are MUI..
So we use them in loops
in stead of using
we use this its easyer and integer A can have a bug at times and this is safer
now notice in the trigger the arrays are no longer MUI there are loop
also the second trigger has initially off as for the first trigger turns it on and it is turned off when no units are using the trigger
yes i know this is a basic spell but it is easy to show every one so that they get the concept. ill up date later on with a map to test and ill also be adding another spell or to to give use a better idea of this GUI MUI
CREDITS
thanks to "RMX" on hive for teaching me on how to use this.
here is my map it has the spell im showing in the this post and also a knockback spell
What is MUI?
MUI is Multi-Unit-Instanceability.It means that if 2 or more units cause a trigger to fire (casting a spell would be best example), the spell's effect will work properly for both units that cast the ability. if the trigger wasent MUI the spell would only work for 1 of the units Also, MUI is basicly impossible to achieve with waits.
why use indexing for MUI spells?
it is easy and a great variable system used by many spell makers to make Multi Unit instancable spells.
there are 2 triggers but very small depending on how complex your spell is
What do you need to use it
nothing it isn't a custom script or anything like that it is simply a variable based system.
Can you make any spell in GUI MUI with this - the answer is yes.only custom script need is for removing leaks
what u will need first off is, you need to make a base ability in the Object Editor which will make the spell fire.
Basic Variables Used In Your Spell
index-a integer Variable[this is the integer variable you use for the indexing part of the spell
MUI-a integer Variable[used for the MUI part of the spell]
Loop-a integer variable used in the looping trigger for the spell
Turn on-(array)a Boolean Variable used for MUI part of the trigger as well
so what the index Variable does is increased and decreased when any units start or finish the spell
and the MUI variable is used for storing the unit/point and so on of the spell
the spell ill be doing for the turtoral of a MUI spell is a sliding spell slides the unit to target of the ability
the start of our trigger(and all MUI triggers in this style)
Trigger:
- turt
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to >your ability<
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Index Equal to 0
- Then - Actions
- Trigger - Turn on turt loop <gen>
- Else - Actions
- If - Conditions
- Set Index = (Index + 1)
- Set MUI = (MUI + 1)
- Set Turn_On[MUI] = True
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Actions
- Events
setting the variables for this particular spell
caster-unit-the unit casting the spell(ARRAY)
casterpos-point-position of the casting unit
targetpoint-ppoint-pont of the ability being used
moved-real-the distance you traveled(ARRAY)
Distance-real-the distance your about to move(ARRAY)
angle-real-the angle(ARRAY)
slide 1-point-the point for sliding of the unit
slide 2-point-the point for sliding of the unit second part
ok now thats all over ill show you the end resault for the first trigger for this spell
Trigger:
- GUI MUI SLIDE
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to >your ability<
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Index Equal to 0
- Then - Actions
- Trigger - Turn on GUI MUI SLIDE loop <gen>
- Else - Actions
- If - Conditions
- Set MUI = (MUI + 1)
- Set Index = (Index + 1)
- Set Turn_On[MUI] = True
- Set caster[MUI] = (Casting unit)
- Set casterpos = (Position of caster[MUI])
- Set target_point = (Target point of ability being cast)
- Set distance[MUI] = (Distance between casterpos and target_point)
- Set angle[MUI] = (Angle from casterpos to target_point)
- Set moved[MUI] = 0.00
- Unit - Pause caster[MUI]
- Unit - Turn collision for caster[MUI] Off
- Custom script: call RemoveLocation(udg_casterpos)
- Custom script: call RemoveLocation(udg_target_point)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Actions
- Events
so what we got is when a hero casts an ability we add 1 counter(MUI) to the [ ] array of the hero ...
So hero one casts ability ... Set MUI = MUI + 1 >> Set Caster[MUI] = Casting unit....
>hero two casts ability ... Set MUI = MUI + 1 >> Set Caster[MUI] = Casting unit ...
So now as numbers in arrays we have .. Caster[1] and Caster[2] .. they have diffrent arrays so they will not overwrite each other meaning they are MUI..
So we use them in loops
in stead of using
Trigger:
- For each (Integer A) from 1 to MUI, do (Actions)
we use this its easyer and integer A can have a bug at times and this is safer
Trigger:
- For each (Integer loop) from 1 to MUI, do (Actions)
now notice in the trigger the arrays are no longer MUI there are loop
also the second trigger has initially off as for the first trigger turns it on and it is turned off when no units are using the trigger
Trigger:
- GUI MUI SLIDE loop
- Events
- Time - Every 0.05 seconds of game time
- Conditions
- Actions
- For each (Integer loop) from 1 to MUI, do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Turn_On[loop] Equal to True
- Then - Actions
- Set slide1 = (Position of caster[loop])
- Set slide2 = (slide1 offset by 30.00 towards angle[loop] degrees)
- Set moved[loop] = (moved[loop] + 30.00)
- Special Effect - Create a special effect at slide2 using Abilities\Weapons\SteamTank\SteamTankImpact.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Move caster[loop] instantly to slide2
- Custom script: call RemoveLocation(udg_slide1)
- Custom script: call RemoveLocation(udg_slide2)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((caster[loop] is dead) Equal to True) or (moved[loop] Greater than or equal to distance[loop])
- Then - Actions
- -------- as for the spell is finished --------
- Set Index = (Index - 1)
- Unit - Unpause caster[loop]
- Unit - Turn collision for caster[loop] On
- -------- nulling the variables --------
- Set angle[loop] = 0.00
- Set caster[loop] = No unit
- Set distance[loop] = 0.00
- Set moved[loop] = 0.00
- Set moved[loop] = 0.00
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Index Equal to 0
- Then - Actions
- Trigger - Turn off (This trigger)
- Set MUI = 0
- -------- trigger no longer being used by any unit when the index is 0 --------
- -------- so the trigger is turned off then MUI set to 0 as for no units using that any more either --------
- Else - Actions
- If - Conditions
- Else - Actions
- If - Conditions
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- For each (Integer loop) from 1 to MUI, do (Actions)
- Events
yes i know this is a basic spell but it is easy to show every one so that they get the concept. ill up date later on with a map to test and ill also be adding another spell or to to give use a better idea of this GUI MUI
CREDITS
thanks to "RMX" on hive for teaching me on how to use this.
here is my map it has the spell im showing in the this post and also a knockback spell