Hi, my name is 2evil, and if any of you have used the blizzard forum recently, you probably recognize me from all the questions that I have been posting
anyways, i have a part in my map that when a hero dies, the dead hero gets stored in a varible array (size:110) Thus, slots 1-10 are for player 1 and so on. All players can have up to 10 heros at once in the 'cache'.
I recently changed the way that the computer makes the dialog boxes to make it easier on myself when triggering (from 100 different triggers to 1 trigger with multiple parts) In this new problem I use lots of looping, which simplifies it greatly.
However, only the last killed hero now shows up (theres only one button) but once that one hero is res'd, the next killed one will pop up. It is supposed to show all killed heros, up to the max 10, if it needs to.
Here is the trigger and the task - I have looked thgis through many times and cannot find whats wrong with it...
thanks in advance for your help
2evil
Events
Unit - A unit enters ResB <gen>
Unit - A unit enters ResT <gen>
Conditions
Actions
Dialog - Clear Res_hero_diag
Dialog - Change the title of Res_hero_diag to ((|c + (Player_Colors[(Player number of (Triggering player))] + Your|r)) + dead Heroes)
For each (Integer B) from 1 to 10, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer B) Equal to 1
Then - Actions
For each (Integer A) from (Player_res_addons_array[(Integer B)] + 1) to (Player_res_addons_array[(Integer B)] + 10), do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 1
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 1)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[1] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 2
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 2)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[2] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 3
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 3)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[3] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 4
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 4)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[4] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 5
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 5)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[5] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 6
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 6)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[6] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 7
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 7)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[7] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 8
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 8)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[8] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 9
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 9)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[9] = (Last created dialog Button)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 0
Slain_Hero_Total[(Integer B)] Equal to 1
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled Nevermind
Set Res_hero_diag_button[0] = (Last created dialog Button)
Else - Actions
Do nothing
Else - Actions
Do nothing
Dialog - Show Res_hero_diag for (Owner of (Triggering unit))
Thanks again now that you made thru it
anyways, i have a part in my map that when a hero dies, the dead hero gets stored in a varible array (size:110) Thus, slots 1-10 are for player 1 and so on. All players can have up to 10 heros at once in the 'cache'.
I recently changed the way that the computer makes the dialog boxes to make it easier on myself when triggering (from 100 different triggers to 1 trigger with multiple parts) In this new problem I use lots of looping, which simplifies it greatly.
However, only the last killed hero now shows up (theres only one button) but once that one hero is res'd, the next killed one will pop up. It is supposed to show all killed heros, up to the max 10, if it needs to.
Here is the trigger and the task - I have looked thgis through many times and cannot find whats wrong with it...
thanks in advance for your help
2evil
Events
Unit - A unit enters ResB <gen>
Unit - A unit enters ResT <gen>
Conditions
Actions
Dialog - Clear Res_hero_diag
Dialog - Change the title of Res_hero_diag to ((|c + (Player_Colors[(Player number of (Triggering player))] + Your|r)) + dead Heroes)
For each (Integer B) from 1 to 10, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer B) Equal to 1
Then - Actions
For each (Integer A) from (Player_res_addons_array[(Integer B)] + 1) to (Player_res_addons_array[(Integer B)] + 10), do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 1
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 1)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[1] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 2
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 2)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[2] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 3
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 3)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[3] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 4
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 4)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[4] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 5
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 5)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[5] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 6
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 6)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[6] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 7
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 7)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[7] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 8
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 8)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[8] = (Last created dialog Button)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 9
(Integer A) Equal to (Player_res_addons_array[(Integer B)] + 9)
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled (((|c + Player_Colors[(Integer B)]) + (Proper name of Slain_Heros[(Integer A)])) + (|r - Level |c00FFD700 + ((String((Hero level of Slain_Heros[(Integer A)]))) + (|r + (Name of Slain_Heros[(Integer A)])))))
Set Res_hero_diag_button[9] = (Last created dialog Button)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slain_Hero_Total[(Integer B)] Equal to 0
Slain_Hero_Total[(Integer B)] Equal to 1
Then - Actions
Dialog - Create a dialog button for Res_hero_diag labelled Nevermind
Set Res_hero_diag_button[0] = (Last created dialog Button)
Else - Actions
Do nothing
Else - Actions
Do nothing
Dialog - Show Res_hero_diag for (Owner of (Triggering unit))
Thanks again now that you made thru it