• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Disconnecting error?

Status
Not open for further replies.
Level 4
Joined
May 23, 2010
Messages
83
I made a hero pick system. For my map there are 3 heroes that you pick at the game start. Then I added units into a temp group to pause them and make the player pick the 3 heroes (not just 1 or 2). Everything works on single player, but the issue is when playing online (Battle.net) when I pick the 3 heroes I get disconnected from the game but the host continues the game. Can anybody solve that for me? I still need to say that there's a lil lag when picking the units (just a bit, like a spike). There are the triggers:

  • Heroes Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set game_herotypeagi[1] = Blademaster
      • Set game_countheroes[1] = 1
      • Set game_herotypeint[1] = Far Seer
      • Set game_herotypeint[2] = Mortar Team
      • Set game_herotypeint[3] = Priest
      • Set game_herotypeint[4] = Lich (Lich)
      • Set game_countheroes[2] = 4
      • Set game_herotypestr[1] = Pit Lord
      • Set game_herotypestr[2] = Paladin
      • Set game_herotypestr[3] = Tauren
      • Set game_herotypestr[4] = Mountain Giant
      • Set game_countheroes[3] = 4
      • Set game_countallheroes = (game_countheroes[1] + (game_countheroes[2] + game_countheroes[3]))
  • Hero Pick
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Set game_heroowner = (Owner of (Sold unit))
      • Set game_herotype = (Unit-type of (Sold unit))
      • Set game_playernumber = (Player number of game_heroowner)
      • For each (Integer game_generalintegers[1]) from 1 to 4, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (game_heroowner is in game_playerteams[game_generalintegers[1]]) Equal to True
            • Then - Actions
              • Set game_herostartloc = (Center of game_teamregion[game_generalintegers[1]])
            • Else - Actions
      • For each (Integer game_generalintegers[1]) from 1 to game_countheroes[1], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • game_herotype Equal to game_herotypeagi[game_generalintegers[1]]
            • Then - Actions
              • Unit Group - Add (Sold unit) to game_heropickgroup[game_playernumber]
              • Unit - Move (Sold unit) instantly to game_herostartloc, facing Default building facing degrees
              • Unit - Pause (Sold unit)
              • Unit - Make (Sold unit) Invulnerable
              • For each (Integer game_generalintegers[2]) from 1 to game_countheroes[1], do (Actions)
                • Loop - Actions
                  • Player - Make game_herotypeagi[game_generalintegers[2]] Unavailable for training/construction by game_heroowner
            • Else - Actions
      • For each (Integer game_generalintegers[1]) from 1 to game_countheroes[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • game_herotype Equal to game_herotypeint[game_generalintegers[1]]
            • Then - Actions
              • Unit Group - Add (Sold unit) to game_heropickgroup[game_playernumber]
              • Unit - Move (Sold unit) instantly to game_herostartloc, facing Default building facing degrees
              • Unit - Pause (Sold unit)
              • Unit - Make (Sold unit) Invulnerable
              • For each (Integer game_generalintegers[2]) from 1 to game_countheroes[2], do (Actions)
                • Loop - Actions
                  • Player - Make game_herotypeint[game_generalintegers[2]] Unavailable for training/construction by game_heroowner
            • Else - Actions
      • For each (Integer game_generalintegers[1]) from 1 to game_countheroes[3], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • game_herotype Equal to game_herotypestr[game_generalintegers[1]]
            • Then - Actions
              • Unit Group - Add (Sold unit) to game_heropickgroup[game_playernumber]
              • Unit - Move (Sold unit) instantly to game_herostartloc, facing Default building facing degrees
              • Unit - Pause (Sold unit)
              • Unit - Make (Sold unit) Invulnerable
              • For each (Integer game_generalintegers[2]) from 1 to game_countheroes[3], do (Actions)
                • Loop - Actions
                  • Player - Make game_herotypestr[game_generalintegers[2]] Unavailable for training/construction by game_heroowner
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in game_heropickgroup[game_playernumber]) Equal to 3
        • Then - Actions
          • Selection - Select game_heropickgroup[game_playernumber] for game_heroowner
          • Camera - Pan camera for game_heroowner to game_herostartloc over 0.00 seconds
          • Unit Group - Pick every unit in game_heropickgroup[game_playernumber] and do (Actions)
            • Loop - Actions
              • Unit Group - Add (Picked unit) to game_heroesgroup[game_playernumber]
              • Unit - Make (Picked unit) Vulnerable
              • Unit - Unpause (Picked unit)
          • Custom script: call DestroyGroup (udg_game_heropickgroup[udg_game_playernumber])
        • Else - Actions
      • Custom script: call RemoveLocation (udg_game_herostartloc)

  • Heroes Missing Message
    • Events
      • Player - (Player(1)) Selects a unit
      • Player - (Player(2)) Selects a unit
      • Player - (Player(3)) Selects a unit
      • Player - (Player(4)) Selects a unit
      • Player - (Player(5)) Selects a unit
      • Player - (Player(6)) Selects a unit
      • Player - (Player(7)) Selects a unit
      • Player - (Player(8)) Selects a unit
      • Player - (Player(9)) Selects a unit
      • Player - (Player(10)) Selects a unit
      • Player - (Player(11)) Selects a unit
      • Player - (Player(12)) Selects a unit
    • Conditions
      • ((Triggering unit) is in game_heropickgroup[(Player number of (Triggering player))]) Equal to True
    • Actions
      • Game - Display to (Player group((Triggering player))) the text: You must pick 3 dif...
      • Selection - Remove (Triggering unit) from selection for (Triggering player)
IMPORTANT EDIT: the error is not a fatal error, I just got disconnected from the game.

can anyone help me? i really need this system. should i use the Or - Conditions to make each hero unbuyable? please if you need some more stuff to help me i can add here. all regions are set at map initialization and player groups either.
 
Last edited by a moderator:
Level 4
Joined
May 23, 2010
Messages
83
that wasn't the problem, I expected that it were but not ): i got new triggers to try to fix that. PS: the problem is in the trigger, i deactivated the triggers and runned the map it worked normally. new triggers:

  • Heroes Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set game_heroeshashtable = (Last created hashtable)
      • Set game_herotypeagi[1] = Blademaster
      • Set game_countheroes[1] = 1
      • Set game_herotypeint[1] = Far Seer
      • Set game_herotypeint[2] = Mortar Team
      • Set game_herotypeint[3] = Priest
      • Set game_herotypeint[4] = Lich
      • Set game_countheroes[2] = 4
      • Set game_herotypestr[1] = Pit Lord
      • Set game_herotypestr[2] = Paladin
      • Set game_herotypestr[3] = Tauren
      • Set game_herotypestr[4] = Mountain Giant
      • Set game_countheroes[3] = 4
      • Set game_countallheroes = (game_countheroes[1] + (game_countheroes[2] + game_countheroes[3]))
      • For each (Integer game_generalintegers[1]) from 1 to 3, do (Actions)
        • Loop - Actions
          • For each (Integer game_generalintegers[2]) from 1 to game_countheroes[game_generalintegers[1]], do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • game_generalintegers[1] Equal to 1
                • Then - Actions
                  • Hashtable - Save (String(game_herotypeagi[game_generalintegers[2]])) as game_generalintegers[2] of game_generalintegers[1] in game_heroeshashtable
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • game_generalintegers[1] Equal to 2
                    • Then - Actions
                      • Hashtable - Save (String(game_herotypeint[game_generalintegers[2]])) as game_generalintegers[2] of game_generalintegers[1] in game_heroeshashtable
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • game_generalintegers[1] Equal to 3
                        • Then - Actions
                          • Hashtable - Save (String(game_herotypestr[game_generalintegers[2]])) as game_generalintegers[2] of game_generalintegers[1] in game_heroeshashtable
                        • Else - Actions
  • Hero Pick
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Set game_heroowner = (Owner of (Sold unit))
      • Set game_herotype = (Unit-type of (Sold unit))
      • Set game_playernumber = (Player number of game_heroowner)
      • Unit Group - Add (Sold unit) to game_heroesgroup[game_playernumber]
      • Unit - Move (Sold unit) instantly to game_herostartloc[game_playernumber], facing Default building facing degrees
      • Unit - Pause (Sold unit)
      • Unit - Make (Sold unit) Invulnerable
      • Trigger - Run Hero Add to Group <gen> (checking conditions)
      • For each (Integer game_generalintegers[1]) from 1 to 3, do (Actions)
        • Loop - Actions
          • For each (Integer game_generalintegers[2]) from 1 to game_countheroes[game_generalintegers[1]], do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • game_herotype Equal to (Unit-type((Load game_generalintegers[2] of game_generalintegers[1] from game_heroeshashtable)))
                • Then - Actions
                  • For each (Integer game_generalintegers[3]) from 1 to game_countheroes[game_generalintegers[1]], do (Actions)
                    • Loop - Actions
                      • Player - Make (Unit-type((Load game_generalintegers[3] of game_generalintegers[1] from game_heroeshashtable))) Unavailable for training/construction by (Owner of (Sold unit))
                • Else - Actions
  • Heroes Missing Message
    • Events
      • Player - (Player(1)) Selects a unit
      • Player - (Player(2)) Selects a unit
      • Player - (Player(3)) Selects a unit
      • Player - (Player(4)) Selects a unit
      • Player - (Player(5)) Selects a unit
      • Player - (Player(6)) Selects a unit
      • Player - (Player(7)) Selects a unit
      • Player - (Player(8)) Selects a unit
      • Player - (Player(9)) Selects a unit
      • Player - (Player(10)) Selects a unit
      • Player - (Player(11)) Selects a unit
      • Player - (Player(12)) Selects a unit
    • Conditions
      • ((Triggering unit) is in game_heroesgroup[(Player number of (Triggering player))]) Equal to True
      • game_heroespicked[(Player number of (Triggering player))] Equal to False
    • Actions
      • Game - Display to (All players) the text: (String((Number of players in game_playersall)))
      • Game - Display to (Player group((Triggering player))) the text: You must pick 3 dif...
      • Selection - Remove (Triggering unit) from selection for (Triggering player)
  • Hero Add to Group
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in game_playersall and do (Actions)
        • Loop - Actions
          • Set game_heroowner = (Picked player)
          • Set game_playernumber = (Player number of game_heroowner)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in game_heroesgroup[game_playernumber]) Equal to 3
            • Then - Actions
              • Selection - Select game_heroesgroup[game_playernumber] for game_heroowner
              • Set game_heroespicked[game_playernumber] = True
              • Unit Group - Pick every unit in game_heroesgroup[game_playernumber] and do (Actions)
                • Loop - Actions
                  • Unit - Make (Picked unit) Vulnerable
                  • Unit - Unpause (Picked unit)
              • Custom script: call RemoveLocation (udg_game_herostartloc[udg_game_playernumber])
            • Else - Actions
i've been making a few tests and i discovered that the action "Unit Group - Pick every unit in unit group and do actions" with the variable "game_herogroup[]" is the issue, as in a test i deactivated it and the game worked normally. is there a way to avoid this error? even if i use the variable in another trigger it still won't work, i tried creating another variable and didn't work... so my next step is the hashtables :)


ok there's another issue.... the problem is not the one i told uphere i removed stuff and it still breaks me down... for Dr Super Good, sorry for the double post ;p
 
Last edited:
Status
Not open for further replies.
Top