1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Ride into the sunset with the 32nd Modeling Contest.
    Dismiss Notice
  4. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  5. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] Hero Selection Problem

Discussion in 'Triggers & Scripts' started by Henahax, Dec 7, 2008.

  1. Henahax

    Henahax

    Joined:
    Mar 27, 2005
    Messages:
    37
    Resources:
    0
    Resources:
    0
    Hi, I thought, I would have created a simple Hero selection and it worked in Singlepalyer, but then I tested it with a friend an he always got disconnected when I chose a hero.
    Can someone explain me, why he always gets disconnected, and what I have to change to solve the problem?

    (One hero can not be chosen twice.)
    Trigger:
    • Held
      • Events
        • Unit - A unit Begins casting an ability
      • Conditions
        • (Ability being cast) Equal to Choose Hero
      • Actions
        • Unit - Create 1 (Unit-type of (Target unit of ability being cast)) for (Owner of (Casting unit)) at (Center of Held Spawn <gen>) facing Default building facing degrees
        • Camera - Pan camera as necessary for (Owner of (Casting unit)) to (Center of Hero Spawn <gen>) over 0.00 seconds
        • Unit - Remove (Target unit of ability being cast) from the game
        • Unit - Remove (Casting unit) from the game

    (Maybe it is of any importance: I edited "Banish" for "Choose Hero".)


    Edit: @ picture "Held wählen" = "Choose Hero"
     

    Attached Files:

  2. TheBlooddancer

    TheBlooddancer

    Joined:
    Jun 24, 2008
    Messages:
    2,908
    Resources:
    0
    Resources:
    0
    It should work flawlessly.
     
  3. Xzalious

    Xzalious

    Joined:
    Jun 6, 2007
    Messages:
    48
    Resources:
    0
    Resources:
    0
    This actually happened to me, with a particular piece of code. The problem lied not in any map code but in the version of Warcraft that was reading the code as my brother had 1.17 and i had 1.20, don't ask me why this happened but as soon as my bro upgraded to the same version as me the disconnecting problem vanished like a shadow in the light. ;)
     
  4. Xarwin

    Xarwin

    Joined:
    Nov 16, 2006
    Messages:
    2,233
    Resources:
    3
    Icons:
    1
    Maps:
    1
    Tutorials:
    1
    Resources:
    3
    "One hero can not be chosen twice"

    What triggers will prevent this?

    You could try using variables and see if it still disconnects him.
     
  5. Henahax

    Henahax

    Joined:
    Mar 27, 2005
    Messages:
    37
    Resources:
    0
    Resources:
    0
    When a hero is picked, he is instantly removed from the hero selection Island.

    I tested the map with my friend in Battle.net, so no different Versions :)

    I do not really understand, what you mean. How would the trigger with "Using Variables" look like?


    hmm maybe an other trigger is bugged, but that would not explain, why he just got disconnected when I choose a hero...

    The number of heros every player gets is connected to the number of players:
    Here my other triggers:
    • Player Red
      • Events
        • Map initialization
      • Conditions
        • (Player 1 (Red) slot status) Equal to Is playing
      • Actions
        • Set Player = (Player + 1)

    One for every player red - pink

    Next trigger (I think it works :D):
    • Hero Chooser
      • Events
        • Time - Elapsed game time is 0.01 seconds
      • Conditions
      • Actions
        • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Player Equal to 1
                • ((Picked player) slot status) Equal to Is playing
              • Then - Actions
                • Unit - Create 6 Hero Chooser for (Picked player) at (Center of HeroSelection <gen>) facing Default building facing degrees
              • Else - Actions
                • Do nothing
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Player Equal to 2
                • ((Picked player) slot status) Equal to Is playing
              • Then - Actions
                • Unit - Create 3 Hero Chooser for (Picked player) at (Center of HeroSelection <gen>) facing Default building facing degrees
              • Else - Actions
                • Do nothing
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Player Equal to 3
                • ((Picked player) slot status) Equal to Is playing
              • Then - Actions
                • Unit - Create 2 Hero Chooser for (Picked player) at (Center of HeroSelection <gen>) facing Default building facing degrees
              • Else - Actions
                • Do nothing
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Player Equal to 4
                • ((Picked player) slot status) Equal to Is playing
              • Then - Actions
                • Unit - Create 2 Hero Chooser for (Picked player) at (Center of HeroSelection <gen>) facing Default building facing degrees
              • Else - Actions
                • Do nothing
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Player Greater than or equal to 5
                • ((Picked player) slot status) Equal to Is playing
              • Then - Actions
                • Unit - Create 1 Hero Chooser for (Picked player) at (Center of HeroSelection <gen>) facing Default building facing degrees
              • Else - Actions
                • Do nothing
     
  6. Xzalious

    Xzalious

    Joined:
    Jun 6, 2007
    Messages:
    48
    Resources:
    0
    Resources:
    0
    You could simplify:

    • Player Red
      • Events
        • Map initialization
      • Conditions
        • (Player 1 (Red) slot status) Equal to Is playing
      • Actions
        • Set Player = (Player + 1)


    to

    • Players
      • Events
        • Map initialization
      • Conditions
      • Actions
        • For each (Integer A) from 1 to (Number of players), do (Actions)
          • Loop - Actions
            • If (((Player((Integer A))) slot status) Equal to Is playing) then do (Set Players = (Players + 1)) else do (Do nothing)


    That would make 12 possible triggers into 1. Also, based on your second trigger if there is one player(Players = 1) then you make 6 hero choosers for him? 3 for 2 players and so on?
     
  7. scorpion182

    scorpion182

    Joined:
    Jun 9, 2008
    Messages:
    575
    Resources:
    21
    Maps:
    5
    Spells:
    16
    Resources:
    21
    you should not use "Pan Camera as Necessary" it caused desync (disconnected), use Pan Camera instead and your problem will gone, trust me :)
     
  8. Henahax

    Henahax

    Joined:
    Mar 27, 2005
    Messages:
    37
    Resources:
    0
    Resources:
    0
    Thank you, that was the problem
    -> solved :)
     
  9. chaoslord301

    chaoslord301

    Joined:
    Sep 18, 2007
    Messages:
    105
    Resources:
    0
    Resources:
    0
    Take out the Do Nothings, they serve no purpose.
     
  10. terradont

    terradont

    Joined:
    Jan 21, 2007
    Messages:
    1,471
    Resources:
    2
    Icons:
    1
    Template:
    1
    Resources:
    2
    Yes they do! They take up file space:grin:
     
  11. Henahax

    Henahax

    Joined:
    Mar 27, 2005
    Messages:
    37
    Resources:
    0
    Resources:
    0
    This map won't be a bnet map, but thx for the tip, i'll change all my bnet maps immediately :D