[Question]2vs2 PK match

08/05/2010 17:39 ftp4life#1
i was actually wondering how would you make a pk tournament with a team of 2 vs another team of 2... i just need to learn how to add the check to see if they have the team of 2 does anyone know how to put it?
08/05/2010 18:51 _DreadNought_#2
Cant be hard. Logic is the answer for that I think.
08/05/2010 19:01 Fish*#3
For 5165 (You might need to edit this so it works):
Code:
//make a for each here with C as char
if (C.MyTeam == GC.MyChar.MyTeam)//Checking for if the other is in your team
{
//What happens if they are in team
}
else
{
//What happens if they are not in team
}

//Team count check

if (C.MyTeam.Value == 2)//Don't know the exactly count for teams
{
//Can join in tournament
}
else//If count is on 1,3,4,5
{
//Can't join in tournament
}
please test it :)
08/05/2010 19:12 .Beatz#4
Ok simple answer to this..... take Team PK Tourey as an example. Shouldnt be too hard to work out just use some common sense and google. If you got any questions or get stuck just ask the epvpers :) we are always here to help :D
08/05/2010 20:23 ftp4life#5
yea i figuered that but lol i dont want team pk as in red blue white and black i just wanted what grill mad is saying.. needed to make a check to see if you have another player in ur team before u enter the npc same as the other team so its 2 people ina team vs another team of 2
08/05/2010 20:46 pro4never#6
Quote:
Originally Posted by ftp4life View Post
yea i figuered that but lol i dont want team pk as in red blue white and black i just wanted what grill mad is saying.. needed to make a check to see if you have another player in ur team before u enter the npc same as the other team so its 2 people ina team vs another team of 2
So I don't use lotf much but here's my 2 cents...


Checking team can be done through checking the team structure (duhh)

What I'd do is check that it only has 2 people in it (leader and team member). Then allow the player to enter the name of another team leader to challenge. Then send them a npc text asking if they accept. If they do, send them to the new map and set up the character variables for the pk event. I'd make it so players cannot leave/change teams during the event to avoid problems like that and if any of them dc/change map somehow then the event ends and all players are kicked out.


To check team is something like

GC.MyChar.Team.Members.Count

members is an array list, team is the structure holding all team variables. Count will obviously count them up.


Best of luck.

Ooh: And Leader is a bool that specifies if the char is the leader

if(GC.MyChar.Team.Leader == GC.MyChar.UID)

or something like that.
08/06/2010 00:22 ftp4life#7
yes that wuld make more sense oh yea id add that into the NPC right
08/06/2010 00:57 Fish*#8
Quote:
Originally Posted by ftp4life View Post
yes that wuld make more sense oh yea id add that into the NPC right
try and see if it works.
if dosn't then it is the wrong place :)
08/06/2010 01:02 rblazed12601#9
Code:
public int Team1Joined = 0;
public int Team2Joined = 0;
Then when you have the NPC tele them to the map, you can use:
Code:
GC.MyChar.Team1Joined += 1;
and
Code:
GC.MyChar.Team2Joined += 1;
Then if someone is asking to join, you can use a if statement:
Code:
if (GC.MyChar.Team1Joined >= 2;
08/06/2010 01:07 Fish*#10
Quote:
Originally Posted by rblazed12601 View Post
Code:
public int Team1Joined = 0;
public int Team2Joined = 0;
Then when you have the NPC tele them to the map, you can use:
Code:
GC.MyChar.Team1Joined += 1;
and
Code:
GC.MyChar.Team2Joined += 1;
Then if someone is asking to join, you can use a if statement:
Code:
if (GC.MyChar.Team1Joined >= 2;
is a waste, when it is done by one line.
Code:
if (GC.MyChar.MyTeam.Count == 2)
08/06/2010 01:16 Fish*#11
Quote:
Originally Posted by ThoughtZ View Post
You can't use "==" cause when it goes over 2, it will still be accepting them into the match, you need to use ">= 2".
ur wrong. using >= means if it is 2 or over. and it needs to be 2 to enter.
Code:
if (GC.MyChar.MyTeam.Count == 2)
{
//true
}
else
{
//false
}
08/06/2010 01:32 ftp4life#12
Quote:
Originally Posted by ThoughtZ View Post
No your wrong. He's wanting the players not to be able to enter, if the team already has 2. So then, one players joins, it adds 1, another joins it adds 1, u need to have it, so that its 2 and OVER, so noone can join if its 2 and over. if you dont put the check for >=2 , it will keep adding, and once it gets over 2, they will be able to join again.
yes that is exactly what im trying to do :) ty for making it more clear but i still need help on actually making it i got close but still failed lmao... :) if i get it ill post it
08/06/2010 01:34 Fish*#13
Quote:
Originally Posted by ThoughtZ View Post
No your wrong. He's wanting the players not to be able to enter, if the team already has 2. So then, one players joins, it adds 1, another joins it adds 1, u need to have it, so that its 2 and OVER, so noone can join if its 2 and over. if you dont put the check for >=2 , it will keep adding, and once it gets over 2, they will be able to join again.
u want me to write everything in details?
Code:
if (GC.MyChar.MyTeam.Count == 2)
{
//true = they can enter
}
else
{
//false = needs more members in team or got too many
}
kthxbye
08/06/2010 01:35 ftp4life#14
Quote:
Originally Posted by rblazed12601 View Post
Code:
public int Team1Joined = 0;
public int Team2Joined = 0;
Then when you have the NPC tele them to the map, you can use:
Code:
GC.MyChar.Team1Joined += 1;
and
Code:
GC.MyChar.Team2Joined += 1;
Then if someone is asking to join, you can use a if statement:
Code:
if (GC.MyChar.Team1Joined >= 2;
and as for the public int Team1Joined = 0; && public int Team2Joined = 0; i would place that in Character.cs rite
Quote:
Originally Posted by ThoughtZ View Post
No your wrong. He's wanting the players not to be able to enter, if the team already has 2. So then, one players joins, it adds 1, another joins it adds 1, u need to have it, so that its 2 and OVER, so noone can join if its 2 and over. if you dont put the check for >=2 , it will keep adding, and once it gets over 2, they will be able to join again.
yes that is exactly what im trying to do ty for making it more clear but i still need help on actually making it i got close but still failed lmao... if i get it ill post it

Quote:
Originally Posted by grillmad View Post
u want me to write everything in details?
Code:
if (GC.MyChar.MyTeam.Count == 2)
{
//true = they can enter
}
else
{
//false = needs more members in team or got too many
}
kthxbye
When You Had Put This
Quote:
if (GC.MyChar.MyTeam.Count == 2)
it was giving me an error so i replaced it with
Quote:
if (GC.MyChar.MyTeam.Members.Count >= 2)
Do You Think That Would Work?
08/06/2010 02:00 ftp4life#15
Quote:
Originally Posted by ThoughtZ View Post
It won't really matter if you used :
if (GC.MyChar.MyTeam.Count == 2)

or:
if (GC.MyChar.MyTeam.Members.Count >= 2)

or you can try:

if (GC.MyChar.MyTeam.Count = 2)
LoL well isnt that a method......... anyways uhm... ok so since
Quote:
if (GC.MyChar.MyTeam.Members.Count >= 2)
Checks if u have the members now making it so u can only have 2 team at once would be MUCH harder :) id have to set up teams like how wat that previous guy was saying to add Teamjoined1 and team Joined2..