HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How can I setup am optional Team Distribution?

02-28-2006, 08:22 PM#1
Fulla
Im trying to make it so Players_1 can pick from
- Free for all
- Teams of 2players
- Teams of 3players
- Teams of 4players
- Teams of 6players

However when he selects the option from a dialogue the players are Randomly shuffeled and put into the appropiate team formats.
I think Im on the right track, just need alittle help.

I was thinking first, detect which player slots are active, then add them to a player group.

If the total number of players active is NOT dividable by the teams then automatically make it FFA if not start dividing the players up into the appropiate teams.

Create a Player group for each team and equally divide the players into the groups.
Set the alliances/enemies.

Is this the best way to do it?
Ill give it a try see if it works.

thank you
02-28-2006, 10:56 PM#2
Fulla
Ok im stuck.

Ive got all the active players in 1 variable group.
I've created a seperate group for each team.

All I need to do is randomly take ppl from the main group and divide them up amongst the team groups.
Code:
Player Group - Add (Random player from PickTeamsGroup) to TeamsSize2No1

If I had 4 players in main group and I did the above trigger 4 times, would it not possiblity pick the same player twice?
How can I randomly remove a player from the first group and still add him to a teamgroup?

thank you
03-01-2006, 02:57 AM#3
Chuckle_Brother
Take the easy way out.

My suggestion would be this:

Create a boolean array. When you pick a player out filter it through the condition that their boolean is false(standard boolean setting after its created). Then once a player is picked set their boolean to true. This should effectively filter out previously picked players without the need for adding and removing them from some main group(aside from "Allplayers")
03-01-2006, 03:47 PM#4
Fulla
Why doesnt this work?

Basically if teams of 2 is selected and there are 4 players exactly it.
Takes 2 random players from Main group.
Adds them to a seperate group.
Then sets Main Group as allies
Seperate group as allys

for a 2v2

Teams of 2
Trigger:
Collapse Events
Dialog - A dialog button is clicked for PickTeams
Collapse Conditions
(Clicked dialog button) Equal to PickTeams2v
Collapse Actions
Game - Display to (All players) the text: ((Name of Player 1 (Red)) + has Selected Teams of 2)
Collapse Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is playing)) and do (Actions)
Collapse Loop - Actions
Player Group - Add (Picked player) to PickTeamsGroup
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of players in PickTeamsGroup) Equal to 4
Collapse Then - Actions
Player Group - Add (Random player from PickTeamsGroup) to TeamsSize2No1
Collapse Player Group - Pick every player in TeamsSize2No1 and do (Actions)
Collapse Loop - Actions
Player Group - Remove (Picked player) from PickTeamsGroup
Player Group - Add (Random player from PickTeamsGroup) to TeamsSize2No1
Collapse Player Group - Pick every player in TeamsSize2No1 and do (Actions)
Collapse Loop - Actions
Player Group - Remove (Picked player) from PickTeamsGroup
Player Group - Make PickTeamsGroup treat PickTeamsGroup as an Ally with shared vision
Player Group - Make TeamsSize2No1 treat TeamsSize2No1 as an Ally with shared vision
Collapse Else - Actions
Do nothing

Please use [trigger] tags yourself next time
03-01-2006, 10:07 PM#5
Captain Griffen
Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is playing))

This is one of the most annoying triggers in existance. It is buggy. Try using player group - pick every place in (All players matching (((matching player) controller Equal to User)).
03-02-2006, 09:16 AM#6
Fulla
I tried it that way it doesnt work either.

End up with 3 allies, 1 enemy