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

Regions and detecting whos in them..

Status
Not open for further replies.
Level 9
Joined
Apr 28, 2006
Messages
187
Okay guys i need some help here, how can I get it to detect if theres is no spirits in the region except the triggering one?
(theres 8 players and spirits are set in an array)

  • Choose Hero 1
    • Events
      • Unit - A unit enters HeroChoose1 <gen>
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • Hero_Taken[1] Equal to 0
          • (Unit-type of (Triggering unit)) Equal to Spirit (Hero Picker)
          • (HeroChoose1 <gen> contains SpiritPicker[1]) Equal to False
          • (HeroChoose1 <gen> contains SpiritPicker[2]) Equal to False
          • (HeroChoose1 <gen> contains SpiritPicker[3]) Equal to False
          • (HeroChoose1 <gen> contains SpiritPicker[4]) Equal to False
          • (HeroChoose1 <gen> contains SpiritPicker[5]) Equal to False
          • (HeroChoose1 <gen> contains SpiritPicker[6]) Equal to False
          • (HeroChoose1 <gen> contains SpiritPicker[7]) Equal to False
          • (HeroChoose1 <gen> contains SpiritPicker[8]) Equal to False
    • Actions
      • Set HeroCinematicPlayerNumber = (Player number of (Owner of (Triggering unit)))
      • Set HeroCinematicHeroNumber = 1
      • Trigger - Run Hero Cinematics <gen> (checking conditions)
      • Set HeroInfoText = (Player group((Owner of (Triggering unit))))
      • Cinematic - Clear the screen of text messages for HeroInfoText
      • Game - Display to HeroInfoText for 120.00 seconds the text: Arch Druid (|c00FF0...
      • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFDifficult...
      • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFStrength|...
      • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFHero Powe...
      • Game - Display to HeroInfoText for 120.00 seconds the text:
      • Game - Display to HeroInfoText for 120.00 seconds the text: |C0099CC99To select...
      • Custom script: call DestroyForce(udg_HeroInfoText)
      • Sound - Play DruidGreet <gen> at 100.00% volume, attached to Hero[HeroCinematicHeroNumber]
 
Level 32
Joined
Oct 23, 2006
Messages
5,291
I looks like it may be necessary to add an integer comparison condition that would pick all the spirits in that region, count them and, if the number counted is greater that one, continue the action on that basis.

You might also consider posting this in the World Editor Help Zone and/or GUI Triggers forums (it's possible that our best trigger authors are more likely to see it there).
 
Level 9
Joined
Apr 28, 2006
Messages
187
This will work but ist a horrible solution and simply not viable.
  • Choose Hero 1
    • Events
      • Unit - A unit enters HeroChoose1 <gen>
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • Hero_Taken[1] Equal to 0
          • (Unit-type of (Triggering unit)) Equal to Spirit (Hero Picker)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (HeroChoose1 <gen> contains SpiritPicker[2]) Equal to False
              • (HeroChoose1 <gen> contains SpiritPicker[3]) Equal to False
              • (HeroChoose1 <gen> contains SpiritPicker[4]) Equal to False
              • (HeroChoose1 <gen> contains SpiritPicker[5]) Equal to False
              • (HeroChoose1 <gen> contains SpiritPicker[6]) Equal to False
              • (HeroChoose1 <gen> contains SpiritPicker[7]) Equal to False
              • (HeroChoose1 <gen> contains SpiritPicker[8]) Equal to False
            • Then - Actions
              • Set HeroCinematicPlayerNumber = (Player number of (Owner of (Triggering unit)))
              • Set HeroCinematicHeroNumber = 1
              • Trigger - Run Hero Cinematics <gen> (checking conditions)
              • Set HeroInfoText = (Player group((Owner of (Triggering unit))))
              • Cinematic - Clear the screen of text messages for HeroInfoText
              • Game - Display to HeroInfoText for 120.00 seconds the text: Arch Druid (|c00FF0...
              • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFDifficult...
              • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFStrength|...
              • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFHero Powe...
              • Game - Display to HeroInfoText for 120.00 seconds the text:
              • Game - Display to HeroInfoText for 120.00 seconds the text: |C0099CC99To select...
              • Custom script: call DestroyForce(udg_HeroInfoText)
              • Sound - Play DruidGreet <gen> at 100.00% volume, attached to Hero[HeroCinematicHeroNumber]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (HeroChoose1 <gen> contains SpiritPicker[1]) Equal to False
                      • (HeroChoose1 <gen> contains SpiritPicker[3]) Equal to False
                      • (HeroChoose1 <gen> contains SpiritPicker[4]) Equal to False
                      • (HeroChoose1 <gen> contains SpiritPicker[5]) Equal to False
                      • (HeroChoose1 <gen> contains SpiritPicker[6]) Equal to False
                      • (HeroChoose1 <gen> contains SpiritPicker[7]) Equal to False
                      • (HeroChoose1 <gen> contains SpiritPicker[8]) Equal to False
                    • Then - Actions
                      • Set HeroCinematicPlayerNumber = (Player number of (Owner of (Triggering unit)))
                      • Set HeroCinematicHeroNumber = 1
                      • Trigger - Run Hero Cinematics <gen> (checking conditions)
                      • Set HeroInfoText = (Player group((Owner of (Triggering unit))))
                      • Cinematic - Clear the screen of text messages for HeroInfoText
                      • Game - Display to HeroInfoText for 120.00 seconds the text: Arch Druid (|c00FF0...
                      • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFDifficult...
                      • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFStrength|...
                      • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFHero Powe...
                      • Game - Display to HeroInfoText for 120.00 seconds the text:
                      • Game - Display to HeroInfoText for 120.00 seconds the text: |C0099CC99To select...
                      • Custom script: call DestroyForce(udg_HeroInfoText)
                      • Sound - Play DruidGreet <gen> at 100.00% volume, attached to Hero[HeroCinematicHeroNumber]
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (HeroChoose1 <gen> contains SpiritPicker[1]) Equal to False
                              • (HeroChoose1 <gen> contains SpiritPicker[2]) Equal to False
                              • (HeroChoose1 <gen> contains SpiritPicker[4]) Equal to False
                              • (HeroChoose1 <gen> contains SpiritPicker[5]) Equal to False
                              • (HeroChoose1 <gen> contains SpiritPicker[6]) Equal to False
                              • (HeroChoose1 <gen> contains SpiritPicker[7]) Equal to False
                              • (HeroChoose1 <gen> contains SpiritPicker[8]) Equal to False
                            • Then - Actions
                              • Set HeroCinematicPlayerNumber = (Player number of (Owner of (Triggering unit)))
                              • Set HeroCinematicHeroNumber = 1
                              • Trigger - Run Hero Cinematics <gen> (checking conditions)
                              • Set HeroInfoText = (Player group((Owner of (Triggering unit))))
                              • Cinematic - Clear the screen of text messages for HeroInfoText
                              • Game - Display to HeroInfoText for 120.00 seconds the text: Arch Druid (|c00FF0...
                              • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFDifficult...
                              • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFStrength|...
                              • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFHero Powe...
                              • Game - Display to HeroInfoText for 120.00 seconds the text:
                              • Game - Display to HeroInfoText for 120.00 seconds the text: |C0099CC99To select...
                              • Custom script: call DestroyForce(udg_HeroInfoText)
                              • Sound - Play DruidGreet <gen> at 100.00% volume, attached to Hero[HeroCinematicHeroNumber]
                            • Else - Actions
                              • -------- players 4,5,6,7,8 etc.... --------
                        • Else - Actions
                          • Do nothing
                • Else - Actions
                  • Do nothing
        • Else - Actions
          • Do nothing
 
Level 16
Joined
Oct 30, 2004
Messages
1,277
Im not sure if I fully understood your problem, but wouldnt a simple "turn off this trigger" in the beginning do the trick? Then you would also need another trigger with the event "unit leaves <your region>", action: turn on <trigger>.
 
Level 9
Joined
Apr 28, 2006
Messages
187
Yes mini-me, normally that'd be fine, but a user may skip the cine, and not move (yes some pple are that dumb) thus preventing anyone else from viewing it by sitting there on ass.
Regardless, Wolverabid's comment has allowed me to solve the problem like this:

  • Choose Hero 1
    • Events
      • Unit - A unit enters HeroChoose1 <gen>
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • Hero_Taken[1] Equal to 0
          • (Unit-type of (Triggering unit)) Equal to Spirit (Hero Picker)
          • (Number of units in (Units in HeroChoose1 <gen> matching (((Owner of (Matching unit)) Not equal to (Owner of (Triggering unit))) and ((Unit-type of (Matching unit)) Equal to Spirit (Hero Picker))))) Equal to 0
    • Actions
      • Set HeroCinematicPlayerNumber = (Player number of (Owner of (Triggering unit)))
      • Set HeroCinematicHeroNumber = 1
      • Trigger - Run Hero Cinematics <gen> (checking conditions)
      • Set HeroInfoText = (Player group((Owner of (Triggering unit))))
      • Cinematic - Clear the screen of text messages for HeroInfoText
      • Game - Display to HeroInfoText for 120.00 seconds the text: Arch Druid (|c00FF0...
      • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFDifficult...
      • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFStrength|...
      • Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFHero Powe...
      • Game - Display to HeroInfoText for 120.00 seconds the text:
      • Game - Display to HeroInfoText for 120.00 seconds the text: |C0099CC99To select...
      • Custom script: call DestroyForce(udg_HeroInfoText)
      • Sound - Play DruidGreet <gen> at 100.00% volume, attached to Hero[HeroCinematicHeroNumber]
Thanks all -RESOLVED.
 
Status
Not open for further replies.
Top