SlayMaximus
Member!
I've spent several hours on this based on the comments in the thread and if I understand what you are doing, think the following triggers should work. I've also attached my working map so you can cut and paste - but you will need to remove the debugging messages, etc. Note I used "test" as the chat string to be matched and you may want to use "exact match" rather than "substring."
Type Test
Events
Player - Player 1 (Red) types a chat message containing test as A substring
Conditions
Actions
Game - Display to (All players) the text: Test Trigger Execut...
Set Number_of_Peasants = 0
Set Number_of_Not_Peasants = 0
Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
Loop - Actions
If ((Unit-type of (Picked unit)) Equal to Peasant) then do (Set Number_of_Peasants = (Number_of_Peasants + 1)) else do (Set Number_of_Not_Peasants = (Number_of_Not_Peasants + 1))
Game - Display to (All players) the text: ((String(Number_of_Peasants)) + Peasants Selected)
Game - Display to (All players) the text: ((String(Number_of_Not_Peasants)) + Non-Peasants Selected)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Number_of_Peasants Equal to 3
Number_of_Not_Peasants Equal to 0
Then - Actions
Unit - Create 1 Footman for Player 1 (Red) at (Position of (Random unit from (Units currently selected by Player 1 (Red)))) facing Default building facing degrees
Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
Loop - Actions
Unit - Explode (Picked unit)
Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
Else - Actions
Do nothing
Let me know if that's not what you are looking for or if I can do anything else. I enjoyed the challenge!
Type Test
Events
Player - Player 1 (Red) types a chat message containing test as A substring
Conditions
Actions
Game - Display to (All players) the text: Test Trigger Execut...
Set Number_of_Peasants = 0
Set Number_of_Not_Peasants = 0
Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
Loop - Actions
If ((Unit-type of (Picked unit)) Equal to Peasant) then do (Set Number_of_Peasants = (Number_of_Peasants + 1)) else do (Set Number_of_Not_Peasants = (Number_of_Not_Peasants + 1))
Game - Display to (All players) the text: ((String(Number_of_Peasants)) + Peasants Selected)
Game - Display to (All players) the text: ((String(Number_of_Not_Peasants)) + Non-Peasants Selected)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Number_of_Peasants Equal to 3
Number_of_Not_Peasants Equal to 0
Then - Actions
Unit - Create 1 Footman for Player 1 (Red) at (Position of (Random unit from (Units currently selected by Player 1 (Red)))) facing Default building facing degrees
Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
Loop - Actions
Unit - Explode (Picked unit)
Special Effect - Create a special effect attached to the overhead of (Last created unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
Else - Actions
Do nothing
Let me know if that's not what you are looking for or if I can do anything else. I enjoyed the challenge!