Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Regions and detecting whos in them..

Discussion in 'Bug Reporting\Technical Issues' started by Steelb_l_ade, Apr 27, 2007.

  1. Steelb_l_ade

    Steelb_l_ade

    Joined:
    Apr 28, 2006
    Messages:
    188
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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]
     
  2. Wolverabid

    Wolverabid

    Joined:
    Oct 23, 2006
    Messages:
    8,302
    Resources:
    5
    Tutorials:
    5
    Resources:
    5
    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).
     
  3. Steelb_l_ade

    Steelb_l_ade

    Joined:
    Apr 28, 2006
    Messages:
    188
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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
     
  4. Mini-Me

    Mini-Me

    Joined:
    Oct 30, 2004
    Messages:
    1,800
    Resources:
    10
    Maps:
    10
    Resources:
    10
    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>.
     
  5. Steelb_l_ade

    Steelb_l_ade

    Joined:
    Apr 28, 2006
    Messages:
    188
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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.