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]
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).
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]
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>.