• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Auto-Pick Trigger not Worked propely

Status
Not open for further replies.
Level 10
Joined
Mar 19, 2010
Messages
622
I had this trigger in my map to let it automatically choose hero for players, including Computer players, who had not yet choose a hero. But the problem is it just creates one hero, like it just run once and stopped.
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • For each (Integer B) from 1 to 5, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Players_Heroes[(Integer B)] Equal to No unit
            • Then - Actions
              • Set Players_TempIndex = (Player number of (Player((Integer B))))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Players_Hero_PlaChosen Equal to False
                • Then - Actions
                  • Unit - Create 1 Paladin for (Player((Integer B))) at (Random point in Player Spawn <gen>) facing Default building facing degrees
                  • Set Players_Heroes[Players_TempIndex] = (Last created unit)
                  • Set Players_IsPlaying[Players_TempIndex] = True
                  • Set Players_IsRage[Players_TempIndex] = False
                  • Set Players_IsSpell[Players_TempIndex] = True
                  • Set Players_IsPhy[Players_TempIndex] = False
                  • Set Players_Spellpower[Players_TempIndex] = 0.00
                  • Set Players_Physical[Players_TempIndex] = 0.00
                  • Set Players_HealerCount = (Players_HealerCount + 1)
                  • Set Players_TankCount = (Players_TankCount + 1)
                  • Set Players_Hero_PlaChosen = True
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Players_Hero_ArcChosen Equal to False
                    • Then - Actions
                      • Unit - Create 1 Archer for (Player((Integer B))) at (Random point in Player Spawn <gen>) facing Default building facing degrees
                      • Set Players_Heroes[Players_TempIndex] = (Last created unit)
                      • Set Players_IsPlaying[Players_TempIndex] = True
                      • Set Players_IsRage[Players_TempIndex] = False
                      • Set Players_IsSpell[Players_TempIndex] = False
                      • Set Players_IsPhy[Players_TempIndex] = True
                      • Set Players_Spellpower[Players_TempIndex] = 0.00
                      • Set Players_Physical[Players_TempIndex] = 0.00
                      • Set Players_DDealerCount = (Players_DDealerCount + 1)
                      • Set Players_Hero_ArcChosen = True
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Players_Hero_DkChosen Equal to False
                        • Then - Actions
                          • Unit - Create 1 Deathknight for (Player((Integer B))) at (Random point in Player Spawn <gen>) facing Default building facing degrees
                          • Set Players_Heroes[Players_TempIndex] = (Last created unit)
                          • Set Players_IsPlaying[Players_TempIndex] = True
                          • Set Players_IsRage[Players_TempIndex] = True
                          • Set Players_IsSpell[Players_TempIndex] = False
                          • Set Players_IsPhy[Players_TempIndex] = True
                          • Set Players_Spellpower[Players_TempIndex] = 0.00
                          • Set Players_Physical[Players_TempIndex] = 0.00
                          • Set Players_TankCount = (Players_TankCount + 1)
                          • Set Players_Hero_DkChosen = True
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Players_Hero_RogChosen Equal to False
                            • Then - Actions
                              • Unit - Create 1 Rouge for (Player((Integer B))) at (Random point in Player Spawn <gen>) facing Default building facing degrees
                              • Set Players_Heroes[Players_TempIndex] = (Last created unit)
                              • Set Players_IsPlaying[Players_TempIndex] = True
                              • Set Players_IsRage[Players_TempIndex] = False
                              • Set Players_IsSpell[Players_TempIndex] = False
                              • Set Players_IsPhy[Players_TempIndex] = True
                              • Set Players_Spellpower[Players_TempIndex] = 0.00
                              • Set Players_Physical[Players_TempIndex] = 0.00
                              • Set Players_DDealerCount = (Players_DDealerCount + 1)
                              • Set Players_Hero_RogChosen = True
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • Players_Hero_ShmChosen Equal to False
                                • Then - Actions
                                  • Unit - Create 1 Shaman for (Player((Integer B))) at (Random point in Player Spawn <gen>) facing Default building facing degrees
                                  • Set Players_Heroes[Players_TempIndex] = (Last created unit)
                                  • Set Players_IsPlaying[Players_TempIndex] = True
                                  • Set Players_IsRage[Players_TempIndex] = False
                                  • Set Players_IsSpell[Players_TempIndex] = True
                                  • Set Players_IsPhy[Players_TempIndex] = False
                                  • Set Players_Spellpower[Players_TempIndex] = 0.00
                                  • Set Players_Physical[Players_TempIndex] = 0.00
                                  • Set Players_HealerCount = (Players_HealerCount + 1)
                                  • Set Players_Hero_ShmChosen = True
                                • Else - Actions
I just copy this part of trigger out because I think that this is the main problem source, so cant anyone help me by pointing out my mistakes?

Thanks in advance, will +rep for those who helped.
 
Last edited:
Level 10
Joined
Mar 19, 2010
Messages
622
@Lembidi: As I mentioned below my triggers, I just post this part as I think it is where the problems is.

@Mr Bean987: Thanks, fixed.

Edit: Found the bug that caused this trigger not to work properly, thanks guys. +rep to you two. =)
 
Improve the trigger via skipping actions inside 'if' which can be attached outside it - ofcourse if you can find any formula.
Get rid of Integer B - it isn't bugfree. Replace it will custom integer.

(Random point in Player Spawn <gen>) leaks. Use:
  • Set p = (Random point in Player Spawn <gen>)
  • // actions related to p here
  • Custom script: call RemoveLocation(udg_p)
To get rid of leak =)
 
Last edited:
Status
Not open for further replies.
Top