• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Hero Selection Problem

Status
Not open for further replies.
Level 3
Joined
Mar 27, 2005
Messages
38
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"
 

Attachments

  • Heroselection.JPG
    Heroselection.JPG
    53.2 KB · Views: 111
Level 3
Joined
Jun 6, 2007
Messages
48
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. ;)
 
Level 3
Joined
Mar 27, 2005
Messages
38
"One hero can not be chosen twice"
What triggers will prevent this?
When a hero is picked, he is instantly removed from the hero selection Island.

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. ;)
I tested the map with my friend in Battle.net, so no different Versions :)

You could try using variables and see if it still disconnects him.
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
 
Level 3
Joined
Jun 6, 2007
Messages
48
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?
 
Status
Not open for further replies.
Top