• 🏆 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!

[Trigger] Team Battle System

Status
Not open for further replies.
Level 19
Joined
Aug 16, 2007
Messages
881
Well... I can't understand that I need help with the World Editor :(

But anyway...

I need help to create a Team Battle System. For example:

(2(4(6(8(10))))) players are playing the map, and if Host picks the Team Battle mode, those (2(4(6(8(10))))) players shall be splitted into two teams. But I don't know how to do this without it will being glitched...

I really need help!
 
Last edited:
Level 6
Joined
Nov 28, 2007
Messages
203
This should work (the teams are random btw):
  • kattmos
    • Events
      • Player - Player 1 (Red) types a chat message containing blablabla as An exact match
    • Conditions
    • Actions
      • Set Player_Var[0] = (Random player from (All players matching (((Matching player) slot status) Equal to Is playing)))
      • Player Group - Add Player_Var[0] to PlayerGroup_Var[0]
      • Set Player_Var[1] = (Random player from (All players matching ((((Matching player) slot status) Equal to Is playing) and ((((Matching player) is in PlayerGroup_Var[0]) Not equal to True) and (((Matching player) is in PlayerGroup_Var[1]) Not equal to True)))))
      • Player Group - Add Player_Var[1] to PlayerGroup_Var[1]
      • Set Player_Var[2] = (Random player from (All players matching ((((Matching player) slot status) Equal to Is playing) and ((((Matching player) is in PlayerGroup_Var[0]) Not equal to True) and (((Matching player) is in PlayerGroup_Var[1]) Not equal to True)))))
      • Player Group - Add Player_Var[2] to PlayerGroup_Var[0]
      • Set Player_Var[3] = (Random player from (All players matching ((((Matching player) slot status) Equal to Is playing) and ((((Matching player) is in PlayerGroup_Var[0]) Not equal to True) and (((Matching player) is in PlayerGroup_Var[1]) Not equal to True)))))
      • Player Group - Add Player_Var[3] to PlayerGroup_Var[1]
      • Set Player_Var[4] = (Random player from (All players matching ((((Matching player) slot status) Equal to Is playing) and ((((Matching player) is in PlayerGroup_Var[0]) Not equal to True) and (((Matching player) is in PlayerGroup_Var[1]) Not equal to True)))))
      • Player Group - Add Player_Var[4] to PlayerGroup_Var[0]
      • Set Player_Var[5] = (Random player from (All players matching ((((Matching player) slot status) Equal to Is playing) and ((((Matching player) is in PlayerGroup_Var[0]) Not equal to True) and (((Matching player) is in PlayerGroup_Var[1]) Not equal to True)))))
      • Player Group - Add Player_Var[5] to PlayerGroup_Var[1]
      • Set Player_Var[6] = (Random player from (All players matching ((((Matching player) slot status) Equal to Is playing) and ((((Matching player) is in PlayerGroup_Var[0]) Not equal to True) and (((Matching player) is in PlayerGroup_Var[1]) Not equal to True)))))
      • Player Group - Add Player_Var[6] to PlayerGroup_Var[0]
      • Set Player_Var[7] = (Random player from (All players matching ((((Matching player) slot status) Equal to Is playing) and ((((Matching player) is in PlayerGroup_Var[0]) Not equal to True) and (((Matching player) is in PlayerGroup_Var[1]) Not equal to True)))))
      • Player Group - Add Player_Var[7] to PlayerGroup_Var[1]
      • Set Player_Var[8] = (Random player from (All players matching ((((Matching player) slot status) Equal to Is playing) and ((((Matching player) is in PlayerGroup_Var[0]) Not equal to True) and (((Matching player) is in PlayerGroup_Var[1]) Not equal to True)))))
      • Player Group - Add Player_Var[8] to PlayerGroup_Var[0]
      • Set Player_Var[9] = (Random player from (All players matching ((((Matching player) slot status) Equal to Is playing) and ((((Matching player) is in PlayerGroup_Var[0]) Not equal to True) and (((Matching player) is in PlayerGroup_Var[1]) Not equal to True)))))
      • Player Group - Add Player_Var[9] to PlayerGroup_Var[1]
      • Set Player_Var[10] = (Random player from (All players matching ((((Matching player) slot status) Equal to Is playing) and ((((Matching player) is in PlayerGroup_Var[0]) Not equal to True) and (((Matching player) is in PlayerGroup_Var[1]) Not equal to True)))))
      • Player Group - Add Player_Var[10] to PlayerGroup_Var[0]
      • Player Group - Make PlayerGroup_Var[0] treat PlayerGroup_Var[1] as an Enemy
      • Player Group - Make PlayerGroup_Var[1] treat PlayerGroup_Var[0] as an Enemy
      • Custom script: call DestroyForce(udg_PlayerGroup_Var[0])
      • Custom script: call DestroyForce(udg_PlayerGroup_Var[1])
Just tell me if there's something u wanna know ^^

(Off-topic) omg ur swedish! superspecialawesome!
 
Last edited:
Level 6
Joined
Nov 28, 2007
Messages
203
I've never tested it, but it should work.. Lets hope it does lol, cus i kinda need it too :p And i'm too lazy to test it myself o_O o_o o_O

(Off-topic) ehh.. nvm that :grin:
 
Level 3
Joined
Apr 7, 2007
Messages
48
Yuck, try replacing the All players matching slot status is playing with a player group and go from there. I don't know if player groups leak as unit groups do, but if they do then your trigger is very leaky. This will also clean things up as when you put the player into a team then you remove the player from the list of leftover players.
 
Level 6
Joined
Nov 28, 2007
Messages
203
I don't know if player groups leak as unit groups do, but if they do then your trigger is very leaky.
ehm.. yes they do, but i removed the leaks
  • Custom script: call DestroyForce(udg_PlayerGroup_Var[0])
  • Custom script: call DestroyForce(udg_PlayerGroup_Var[1])
You can also remove unit group leaks by doing
  • Custom script: set bj_wantDestroyGroup = true
before any "pick every unit in.."

and.. leftover players? :confused:
 
Status
Not open for further replies.
Top