• 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.

[Trigger] Duel - Unit Groups

Status
Not open for further replies.
Level 5
Joined
May 21, 2006
Messages
174
This is a part of my duel trigger.
First time this is run, everything works like a charm, no problems what so ever.
However, every single time it's run after the first time, no Heroes are added to HeroPool[1] despite the Debug Message under
"Unit Group - Add Hero[(Integer A)] to HeroPool[1]" does in fact say the Hero should get added.

For some reason HeroPool[2] does not suffer from this problem at all.

  • For each (Integer A) from 1 to 6, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Hero[(Integer A)] is dead) Equal to False
              • Hero[(Integer A)] Not equal to No unit
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer A) Less than or equal to 3
            • Then - Actions
              • Unit Group - Add Hero[(Integer A)] to HeroPool[1]
              • Game - Display to Player Group - Player 1 (Red) the text: (|cffffcc00DEBUG:|r + (Added Hero: + ((Hero[ + ((String((Integer A))) + ] )) + (= + ((Proper name of Hero[(Integer A)]) + ( (Player: + ((Name of (Owner of Hero[(Integer A)])) + ))))))))
            • Else - Actions
              • Unit Group - Add Hero[(Integer A)] to HeroPool[2]
              • Game - Display to Player Group - Player 1 (Red) the text: (|cffffcc00DEBUG:|r + (Added Hero: + ((Hero[ + ((String((Integer A))) + ] )) + (= + ((Proper name of Hero[(Integer A)]) + ( (Player: + ((Name of (Owner of Hero[(Integer A)])) + ))))))))
        • Else - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: (|cffffcc00DEBUG:|r + (No Hero Added for: + ((Hero[ + ((String((Integer A))) + ] )) + <Empty String>)))
  • Game - Display to Player Group - Player 1 (Red) the text: (|cffffcc00DEBUG:|r + ((Team 1: + (String((Number of units in HeroPool[1])))) + ( ... Team 2: + (String((Number of units in HeroPool[2]))))))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Number of units in HeroPool[1]) Equal to 0
          • (Number of units in HeroPool[2]) Equal to 0
    • Then - Actions
      • Unit Group - Remove all units from HeroPool[1]
      • Unit Group - Remove all units from HeroPool[2]
      • Skip remaining actions
    • Else - Actions
  • * Followed by the rest of the trigger *
  • * Followed by the rest of the trigger *
  • * Followed by the rest of the trigger *
 
Level 7
Joined
Jul 20, 2008
Messages
377
What event are you using?

I have my suspicions about this chunk:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • Or - Any (Conditions) are true
  • Conditions
  • (Number of units in HeroPool[1]) Equal to 0
  • (Number of units in HeroPool[2]) Equal to 0
  • Then - Actions
  • Unit Group - Remove all units from HeroPool[1]
  • Unit Group - Remove all units from HeroPool[2]
  • Skip remaining actions
  • Else - Actions
Something just feels wrong about this. Can I see your event?
 
Level 5
Joined
May 21, 2006
Messages
174
The trigger is not "Initially On", and thus it does not have an event.
It's run by this trigger:
  • Random Event
    • Events
      • Time - Every (Random real number between 320.00 and 840.00) seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Events Equal to True
        • Then - Actions
          • Trigger - Run Event_Triggers[(Random integer number between 1 and 7)] (checking conditions)
        • Else - Actions
And when testing I'm using this:
  • Duel Event Test
    • Events
      • Player - Player 1 (Red) types a chat message containing -duel as An exact match
    • Conditions
    • Actions
      • Trigger - Run Duel <gen> (checking conditions)
Full Version:
  • Duel
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Hero[(Integer A)] is dead) Equal to False
                  • Hero[(Integer A)] Not equal to No unit
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Integer A) Less than or equal to 3
                • Then - Actions
                  • Unit Group - Add Hero[(Integer A)] to HeroPool[1]
                  • Game - Display to Player Group - Player 1 (Red) the text: (|cffffcc00DEBUG:|r + (Added Hero: + ((Hero[ + ((String((Integer A))) + ] )) + (= + ((Proper name of Hero[(Integer A)]) + ( (Player: + ((Name of (Owner of Hero[(Integer A)])) + ))))))))
                • Else - Actions
                  • Unit Group - Add Hero[(Integer A)] to HeroPool[2]
                  • Game - Display to Player Group - Player 1 (Red) the text: (|cffffcc00DEBUG:|r + (Added Hero: + ((Hero[ + ((String((Integer A))) + ] )) + (= + ((Proper name of Hero[(Integer A)]) + ( (Player: + ((Name of (Owner of Hero[(Integer A)])) + ))))))))
            • Else - Actions
              • Game - Display to Player Group - Player 1 (Red) the text: (|cffffcc00DEBUG:|r + (No Hero Added for: + ((Hero[ + ((String((Integer A))) + ] )) + <Empty String>)))
      • Game - Display to Player Group - Player 1 (Red) the text: ((String((Number of units in HeroPool[1]))) + (( ... + (String((Number of units in HeroPool[2])))) + <Empty String>))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Number of units in HeroPool[1]) Equal to 0
              • (Number of units in HeroPool[2]) Equal to 0
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
Note that I've removed "Unit Group - Remove all units from HeroPool[1]" and "Unit Group - Remove all units from HeroPool[2]"
for testing purposes here, but I still get the same problem, pretty weird ain't it?
 
Status
Not open for further replies.
Top