ID:176219
 
I need a good team demo or something. It has to have like so you can have equal teams and stuff.. well thx!
Actually, Kunark has just written a second RPGTutorial that has a nice example of forming groups. This, I'm sure, isn't exactly what you're going for, but it sure will point you in the right direction.
In response to Krosse
It has an example of grouping for experience groups, but the exact same method is easily used to make teams.
In response to Kunark
could you maybe just make a team demo because i looked at the coding and i dont see any kind of grouping.
In response to X0Gohan0X
all u gotta do is at the char creation make it so the var team is random and if its 1 they are on one team same for two and three...u could either add them to the teams list or make the var team say the team they are in...this isnt really hard if u think about it
In response to X0Gohan0X
It's in there... But this is basicly what the concept of it is:

Give the person a var, say var/team = ""

Then, when the person logs in, let them choose the team they want to be in, and if they pick, lets say "Blue," set their team var like this: usr.team = "Blue"

After that, when you want to check for who is on that team, you do this:

for(var/mob/PC/M in world)
if(M.team == "Blue")
//Do blue stuff here.

Or, if you wanted to check for what players are on his/her team, do this:

for(var/mob/PC/M in world)
if(M.team == usr.team)
//Do "same team as me" stuff here.
In response to Kunark
yeah but i need someting that will make its auto team balance.
I'm in a decently good mood right now so..:
var
list
red[0]
blue[0]

mob
var
team


mob
Login()
if(!red.len && !blue.len || red.len == blue.len)//if red AND blue are empty OR red and blue are equal in length
//allow the person to pick their team
src.team = input("Which team do you want to be on?")in list("red","blue")
switch(src.team)
if("red")
red.Add(src)
else
blue.Add(src)

else //if one team is unbalanced
if(red.len > blue.len)//if red has more than blue
src.team = "blue"
blue.Add(src)
else if(blue.len > red.len)//if not
src.team = "red"
red.Add(src)


//now for some glitz

mob
verb
TeamWho()
usr << "Red team:"
for(var/M in red)
usr << M
usr << "Blue team:"
for(var/M in blue)
usr << M
In response to Nadrew
thx alot man i tried figuring it out myself and got almost the same thing