[Solved] Having trouble with MUI
How this trigger is meant to work is, when a chicken dies, a wisp spawns from where the chicken died. Then more wisp spawn around the first wisp, the first wisp that spawned is the leader and all the other wisp follow the leader. If 60% of the followers die, then the leader dies. If the leader dies, then all the followers die.
The problem that I'm having is when I kill two chickens, the followers of the leader wisp of the first dead chicken abandon their leader to follow the newly spawned leader wisp. Also when the leader dies, the follows don't die and vice versa. I'm really bad at this MUI Indexing stuff let alone GUI, I really need this to work to complete my map. Please help.
How this trigger is meant to work is, when a chicken dies, a wisp spawns from where the chicken died. Then more wisp spawn around the first wisp, the first wisp that spawned is the leader and all the other wisp follow the leader. If 60% of the followers die, then the leader dies. If the leader dies, then all the followers die.
The problem that I'm having is when I kill two chickens, the followers of the leader wisp of the first dead chicken abandon their leader to follow the newly spawned leader wisp. Also when the leader dies, the follows don't die and vice versa. I'm really bad at this MUI Indexing stuff let alone GUI, I really need this to work to complete my map. Please help.

-
Chunks
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
(Unit-type of (Dying unit)) Equal to Chicken
-
-
Actions
-
Set Chunks_Index = (Chunks_Index + 1)
-
Set Chunks_Unit_DeathTrigger[Chunks_Index] = (Dying unit)
-
Set Chunks_Summon_Point[Chunks_Index] = (Position of (Dying unit))
-
Unit - Create 1 Peasant for (Owner of Chunks_Unit_DeathTrigger[Chunks_Index]) at Chunks_Summon_Point[Chunks_Index] facing Default building facing degrees
-
Set Chunks_Core[Chunks_Index] = (Last created unit)
-
For each (Integer Chunks_Spawn_Loop_Integer) from 1 to 15, do (Actions)
-
Loop - Actions
-
Set Chunks_Random_Spawn = ((Position of Chunks_Core[Chunks_Index]) offset by 100.00 towards (Random angle) degrees)
-
Set Chunk_Follow_Index = (Chunk_Follow_Index + 1)
-
Unit - Create 1 Peasant for (Owner of Chunks_Core[Chunks_Index]) at Chunks_Random_Spawn facing Default building facing degrees
-
Set Chunk_Followers[Chunk_Follow_Index] = (Last created unit)
-
Unit Group - Add (Last created unit) to Chunks_TempGroup
-
Custom script: call RemoveLocation (udg_Chunks_Random_Spawn)
-
-
-
Set Chunks_Particle_Group[Chunks_Index] = Chunks_TempGroup
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Chunks_Index Equal to 1
-
-
Then - Actions
-
Trigger - Turn on Chunks Move <gen>
-
-
Else - Actions
-
-
Custom script: call DestroyGroup (udg_Chunks_TempGroup)
-
-
-
Chunks Move
-
Events
-
Time - Every 0.30 seconds of game time
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Chunks_Core[Chunks_Index] is dead) Equal to True
-
-
Then - Actions
-
For each (Integer Chunks_Loop_Integer) from 1 to Chunk_Follow_Index, do (Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in Chunks_Particle_Group[Chunks_Loop_Integer] and do (Unit - Kill (Picked unit))
-
-
-
Set Chunks_Index = (Chunks_Index - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Chunks_Index Equal to 0
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in Chunks_Particle_Group[Chunks_Index]) Less than or equal to ((Number of units in Chunks_Particle_Group[Chunks_Index]) - 5)
-
-
Then - Actions
-
For each (Integer Chunks_Loop_Integer) from 1 to Chunk_Follow_Index, do (Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in Chunks_Particle_Group[Chunks_Loop_Integer] and do (Unit - Kill (Picked unit))
-
-
-
For each (Integer Chunks_Loop_Integer) from 1 to Chunks_Index, do (Actions)
-
Loop - Actions
-
Unit - Kill Chunks_Core[Chunks_Index]
-
-
-
Set Chunks_Index = (Chunks_Index - 1)
-
Set Chunk_Follow_Index = (Chunk_Follow_Index - Chunk_Follow_Index)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Chunk_Follow_Index Equal to 0
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
Else - Actions
-
-
For each (Integer Chunks_Loop_Integer) from 1 to Chunk_Follow_Index, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Chunk_Followers[Chunks_Loop_Integer] is dead) Equal to True
-
-
Then - Actions
-
Unit Group - Remove Chunk_Followers[Chunks_Loop_Integer] from Chunks_Particle_Group[Chunks_Loop_Integer]
-
-
Else - Actions
-
-
Set Chunks_Random_Move = (((Position of Chunks_Core[Chunks_Index]) offset by 75.00 towards (Facing of Chunks_Core[Chunks_Index]) degrees) offset by (Random real number between 20.00 and 100.00) towards (Random angle) degrees)
-
Unit - Order Chunk_Followers[Chunks_Loop_Integer] to Attack-Move To Chunks_Random_Move
-
Custom script: call RemoveLocation (udg_Chunks_Random_Move)
-
-
-
-
Attachments
Last edited: