I am not too experienced writing MUI/MPI so I knew I would have trouble with making a spell for multiple players or units.
The ability is really simple but I can't get my head around the whole MUI/MPI concept.
Once you cast an ability on the unit, a loop will start which will make the targeted unit of the ability play the death animation. The casting unit will also play the attack animation. There is a integer counter for up to 15 times that this animation plays through. Once it reaches 15, it will spawn a unit and it will turn off the trigger.
I did make this trigger before with hashtables, but that was just purely messing around and not knowing what I was actually doing. Using indexing is more understandable for me, for right now. (I don't have the hashtable version of this trigger, it got deleted a while ago from losing my map.)
(I did look up a bunch of tutorials on MUI by the way. They helped some but as you can see I am still having trouble.)
I just need help with this one trigger and I am sure I will understand how to make more MUI triggers.
Thanks a lot guys.
The ability is really simple but I can't get my head around the whole MUI/MPI concept.
Once you cast an ability on the unit, a loop will start which will make the targeted unit of the ability play the death animation. The casting unit will also play the attack animation. There is a integer counter for up to 15 times that this animation plays through. Once it reaches 15, it will spawn a unit and it will turn off the trigger.
-
Make a Baby
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Make a Baby
-
-

Actions
-


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



If - Conditions
-




(Unit-type of (Target unit of ability being cast)) Equal to Village Wife
-




(Owner of (Target unit of ability being cast)) Equal to (Owner of (Triggering unit))
-
-



Then - Actions
-




Set MUI = (MUI + 1)
-




Set Make_a_Baby_Caster[MUI] = (Triggering unit)
-




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




Set Make_a_Baby_Count[MUI] = 0
-




Set RandomInteger[MUI] = (Random integer number between 1 and 10)
-




Trigger - Turn on Make a Baby Loop <gen>
-
-



Else - Actions
-
-
-
-
Make a Baby Loop
-

Events
-


Time - Every 0.30 seconds of game time
-
-

Conditions
-

Actions
-


For each (Integer MUI) from 1 to 11, do (Actions)
-



Loop - Actions
-




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





If - Conditions
-






Make_a_Baby_Count[MUI] Less than 15
-
-





Then - Actions
-






Set Make_a_Baby_Count[MUI] = (Make_a_Baby_Count[MUI] + 1)
-






Animation - Play Make_a_Baby_Caster[MUI]'s attack animation
-






Animation - Play Wife_Unit[MUI]'s death animation
-
-





Else - Actions
-






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







If - Conditions
-








RandomInteger[MUI] Less than or equal to 5
-
-







Then - Actions
-








Unit - Create 1 Baby Boy for (Owner of Make_a_Baby_Caster[MUI]) at (Position of Wife_Unit[MUI]) facing Default building facing degrees
-
-







Else - Actions
-








Unit - Create 1 Baby Girl for (Owner of Make_a_Baby_Caster[MUI]) at (Position of Wife_Unit[MUI]) facing Default building facing degrees
-
-
-






Trigger - Turn off (This trigger)
-
-
-
-
-
-
I did make this trigger before with hashtables, but that was just purely messing around and not knowing what I was actually doing. Using indexing is more understandable for me, for right now. (I don't have the hashtable version of this trigger, it got deleted a while ago from losing my map.)
(I did look up a bunch of tutorials on MUI by the way. They helped some but as you can see I am still having trouble.)
I just need help with this one trigger and I am sure I will understand how to make more MUI triggers.
Thanks a lot guys.

