Forum

ASSIST, AMERICA'S ARMY COMMUNITY - RELIVE THE GLORY DAYS OF AMERICA'S ARMY 2.5

Author Topic: Team Swap  (Read 10776 times)

0 Members and 1 Guest are viewing this topic.

Offline LEEFFM

Re: Team Swap
« Reply #15 on: Thursday, January 29, 2015, 08:34:33 AM »
my mods are based off of what I learn looking at a folder named Compilings that belonged to crusade and based off what I see in the UTPT program and a Americas Army 2.6 SDK I found on

I didn't see anything in crusades compiling folder that would have let me do this I just rewrote the SwitchTeam() function located in the PlayerController file and named it SwitchSides () Players can still click remain if they go to the team selection tab but there is no message that pops up telling you that you will be switching teams so most people wont know and will be switched.
« Last Edit: Thursday, January 29, 2015, 11:27:51 AM by KiLLaMaN »

Offline [SWISS]Merlin

Re: Team Swap
« Reply #16 on: Thursday, January 29, 2015, 09:03:00 AM »
good job, thanks.
it's a beginning ;)

Offline Vanoke

  • Epic Poster
  • ******
  • Posts: 1,760
  • Real war is to a GAME!!
    • View Profile
  • AA: =PUF=Vanoke
Re: Team Swap
« Reply #17 on: Thursday, January 29, 2015, 11:58:56 AM »
This should work Download my SwitchTeamsMod at: http://brothersnarms.gamerlaunch.com/gallery/library.php?gid=452135

This is untracked of course.

How To Use:
Code: [Select]
Open aa25srv.ini

under [Engine.GameEngine]

add line: ServerActors=SwitchTeamsMod.AdminTeamSwitch

Save aa25srv.ini

While ingame press ~ then type 'mutate switchteams'

Source Code:
Code: [Select]
class AdminTeamSwitch extends mutator;

event PreBeginPlay ()
{
Level.Game.BaseMutator.AddMutator(self);
Log("This mod is property of the [BA]^ Brothers N Arms Clan !",'LEEFFM');
Log("This mod is made by [BA]^LEEFFM",'LEEFFM');
Log("LEEFFM'S Switch Teams Mod Is Loaded",'LEEFFM');
}

function Mutate (string MutateString, PlayerController Sender)
{
    local array<string> Parts ;
    local HumanController HC ;
    local string Command ;
    local string Option ;

    HC = HumanController(Sender);
    Split( MutateString, " ", Parts);
    Command = caps(Parts[0]) ;
    Option = caps(Parts[1]) ;

    if (HC.PlayerReplicationInfo.bAdmin)
    {
        switch (Command)
        {
            case "switchteams":
            SwitchSides () ;
            break;
            default:
            HC.ClientMessage ("Type 'mutate switchteams' to switch Team Sides!") ;
            break;
        }
    } else
    {
        HC.NotifyAdminMessage("'mutate switchteams' is an Administrator only command!") ;
    }
}

function TeamChange( HumanController HC, int N )
{
local TeamInfo OldTeam;

OldTeam = HC.PlayerReplicationInfo.Team;
       Level.Game.ChangeTeam(HC, N, true);
}

function SwitchSides ()
{
    local HumanController HC;
    local int PlayerID;
    local int i;

    PlayerID = HC.PlayerReplicationInfo.PlayerID ;

    for (i = 0; i < Level.Game.GameReplicationInfo.PRIArray.Length; i++)
    {
        HC = HumanController(Level.Game.GameReplicationInfo.PRIArray[i].GetController());

        if (HC.PlayerReplicationInfo.Team.TeamIndex == 1)
        {
  TeamChange(HC,0);
    }  else
    {
            TeamChange(HC,1);
        }

    }
}
VANOKE  :style: I can`t  juse it if its make the server not tracked for Big Clan Day
But i would say its not  a Mod is a Tool so leds shout   all   ELIZ & SPANKY  Can we inplant this tool from  :makemyday:
1- Tournament software ore
2-  form Crusade  the swap team "mod" Tool.
===================================================================

Offline Ganja
Respected Members
Epic Poster
***
 
Posts: 3,185
View Profile
 Personal Message (Offline)
 
AA: -wA'tNc.gaNja




 

Re: Team Swap

? Reply #11 on: Today at 07:17:43 ?


Quote

 



Quote from: Vanoke on Today at 06:56:24 :style:

And about fragho.... the good guys understand and have a great time they stay.




Ye but look at this: The "good" guys stay and the one-side heroes leave, maybe to another serrver, maybe to take a break. That means there's nobody on the difficult side anymore,  so the "good guys" will forever have to stay on the same side.

The way I see it, this teamswap will never work, just because players keep telling themselves "If I prefer to go defence it's my right blablabla" and because a lot of players don't like challenge and don't like to get out of their comfort zone. All they like are easy kills.

My 2 cents ;)

========================================================= :)
Vanoke :style:
Ganja in normal situation oke sum players will argue about it.
But i juse it in BCD not in normal unless the server is full for more than 40 minuts you can say i swap all.
In big clan day its a extra you can upgrade your skills  in a full server also hooping that team spirit will grow in near future like on the right time and plays trow smoke etc.etc.
And those fragho... i say sumtimes to them / Try to help your team mates / ore you can do better ( name) ore Its obj time go go go . 
And if you learn ther spots then its also a gameplay unless they change ther game name everytime.

But to go back to the core toppic  leds wait if Eliz ore Spanky can gif a anser to this.!!!
 :poorguy:    :bow:
« Last Edit: Thursday, January 29, 2015, 12:09:09 PM by Vanoke »

Offline LEEFFM

Re: Team Swap
« Reply #18 on: Thursday, January 29, 2015, 12:11:03 PM »
ok looks like you have to use the command twice for it to work D: , I didn't see anything in the code of crusades UltimateMod that swaps teams but I did find the tournament SwapTeams function im attempting to duplicate the parts of it I need to make a new swapteams command.

EDIT:
I believe this should work but im having probloms I cannot compile it because I cannot call AGP_GameTeamObjectives I keep getting this error ->
Code: [Select]
Error in AdminTeamSwitch.uc (4): Unrecognized type 'AGP_GameTeamObjectives'
Teams[2] is declared in AGP_GameTeam I cant call that either same error, and the same error for AGP_TeamInfo.

if anyone can help me get around this problem I Should be able to make this a working mod.

AdminTeamSwitch.uc:
Code: [Select]
class AdminTeamSwitch extends mutator;

var GameInfo GameInfo;
var AGP_GameTeamObjectives AGP_GameTeamObjectives;

event PreBeginPlay ()
{
Level.Game.BaseMutator.AddMutator(self);
Log("This mod is property of the [BA]^ Brothers N Arms Clan !",'LEEFFM');
Log("This mod is made by [BA]^LEEFFM",'LEEFFM');
Log("LEEFFM'S Switch Teams Mod Is Loaded",'LEEFFM');
}

function Mutate (string MutateString, PlayerController Sender)
{
    local array<string> Parts ;
local HumanController HC ;
    local string Command ;
    local string Option ;

    HC = HumanController(Sender);
    Split( MutateString, " ", Parts);
    Command = caps(Parts[0]) ;
    Option = caps(Parts[1]) ;

    if (HC.PlayerReplicationInfo.bAdmin)
    {
        switch (Command)
        {
            case "switchteams":
            SwitchSides () ;
            break;
            default:
            HC.ClientMessage ("Type 'mutate switchteams' to switch Team Sides!") ;
            break;
        }
    } else
    {
        HC.NotifyAdminMessage("'mutate switchteams' is an Administrator only command!") ;
    }
}

function SwitchSides ()
{
    local HumanController HC;
    local int PlayerID;
    local int i;

    PlayerID = HC.PlayerReplicationInfo.PlayerID ;

    for (i = 0; i < Level.Game.GameReplicationInfo.PRIArray.Length; i++)
    {
        HC = HumanController(Level.Game.GameReplicationInfo.PRIArray[i].GetController());

        switch (HC.PlayerReplicationInfo.Team.TeamIndex)
        {
            case 0:
            SwapPlayer (HC,1) ;
            break;
            case 1:
            SwapPlayer (HC,0) ;
            break;
        }
    }
}

function SwapPlayer (HumanController HC, int NewTeam)
{
    ChangeTeam (HC,NewTeam) ;
    //AGP_TeamInfo(HC.PlayerReplicationInfo.Team).ClearPlayerRequests(HC.PlayerReplicationInfo);
    //AGP_TeamInfo(HC.PlayerReplicationInfo.Team).AddToNoRequestList(HC.PlayerReplicationInfo,False);
}

function bool ChangeTeam (HumanController C, int Team)
{
    local TeamInfo NewTeam;

    if (Team < 2)
    {
        NewTeam = AGP_GameTeamObjectives.Teams[PickTeam(Team,C)];
    } else
    {
        return false;
    }

    if (C.PlayerReplicationInfo.Team == NewTeam)
    {
        return false;
    }

    C.StartSpot= none;

    if (C.PlayerReplicationInfo.Team != None)
    {
        C.PlayerReplicationInfo.Team.RemoveFromTeam(C);
    }

    if (NewTeam.AddToTeam(C))
    {
        C.ClientMessage ("You Were Moved!") ;
    }

    return true;
}
« Last Edit: Thursday, January 29, 2015, 12:44:15 PM by LEEFFM »

Offline ELiZ

Re: Team Swap
« Reply #19 on: Thursday, January 29, 2015, 13:06:12 PM »
I've added a similar function to the next version.
Only main difference is that my function informs the user, it's because it uses an existing ADMIN command on all users(Just like AFC does).

Code: [Select]
final exec function ass()
{
local PlayerReplicationInfo PRI;
if (ViewportOwner !=None)
{
if (myLevel !=None)
{
ForEach myLevel.AllActors(Class'PlayerReplicationInfo',PRI)
{
if (! PRI.bIsSpectator || PRI.bWaitingPlayer)
{
log(ViewportOwner.Actor.ConsoleCommand("admin A_SwitchTeam" @ PRI.PlayerName));
}
}
}
}
}

Nothing extra need to be loaded in the ini, all an admin has to do is to type
Code: [Select]
assin the console, and all players will swap teams.

Function will hopefully be available tomorrow, when I release a new version of Antipoke.u.
Release was meant to be a cleanup job for the santa stuff that still was(is) included, but I can just as well include this.

« Last Edit: Thursday, January 29, 2015, 13:09:40 PM by ELiZ »

Offline LEEFFM

Re: Team Swap
« Reply #20 on: Thursday, January 29, 2015, 13:43:22 PM »
I found my error I for got to add EditPackages=AGP_GamePlay to my make file :P silly noob mistakes lol, however I get another error now, Looks nice Eliz cant wait to test it out tomorrow on the [BA]^ server

Offline teddy_grizzly_bear

  • Used to be known as nobody
  • Administrator
  • Epic Poster
  • *
  • Posts: 5,707
  • what are you looking at?
    • View Profile
  • AA: teddy_grizzIy_bear
Re: Team Swap
« Reply #21 on: Thursday, January 29, 2015, 15:05:45 PM »
I guess it's as good as it gets.

Everyone will still be able to click "Remain" if they wish, though.

One possibility to not let people get the "You're getting swapped!" notice, is to use an admin message right after the "ass" command.
<image removed due to imgur stuff - probably for the best>

"Mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true." Bertrand Russell

Offline LEEFFM

Re: Team Swap
« Reply #22 on: Saturday, January 31, 2015, 09:07:43 AM »
ok My SwapTeamsMod now works, an admin can type 'mutate switchsides' in console and it will swapteams (do this after the round has ended otherwise you will end the round by doing it) , The message "Changing to [ASSAULT/DEFENSE"] Next round!" still pops up but there is no remain button so everyone is forced to switch they can always try to switch back. There's a HalfTime
example:
If you set the game to 10 rounds assault wins 3 defense wins 2 after the round that makes assault score + defense score (3 + 2) (so after round 5) equal to the amount of rounds divided by 2 (so half, 10 / 2) so when the 6th round goes to start it will automatically end the round (no score no chance to spawn) , swap teams, then start the next round. when you swap teams theres also a red console message for everyone "[AA25] HalfTime... Switching Sides!" . There is also an ini file with 1 setting "bSwitchAtHalfTime" true is on false is off.

If anyone would like to download let me know ill upload it to the Brothers N Arms Download Gallery.

AdminSwitchTeams.uc:
Code: [Select]
class AdminTeamSwitch extends mutator config (ATS);

var config bool bSwitchAtHalftime;

event PreBeginPlay ()
{
Level.Game.BaseMutator.AddMutator(self);
Log("This mod is property of the [BA]^ Brothers N Arms Clan !",'LEEFFM');
Log("This mod is made by [BA]^LEEFFM",'LEEFFM');
Log("LEEFFM'S Switch Teams Mod Is Loaded",'LEEFFM');
}

function ModifyPlayer (Pawn Other)
{
    if (bSwitchAtHalfTime)
    {
        HalfTimeSwitchSides () ;
    } else
    {
        Log("HalfTime Disabled",'LEEFFM') ;
    }
}

function Mutate (string MutateString, PlayerController Sender)
{
    local array<string> Parts ;
local HumanController HC ;
    local string Command ;
    local string Option ;

    HC = HumanController(Sender);
    Split( MutateString, " ", Parts);
    Command = caps(Parts[0]) ;
    Option = caps(Parts[1]) ;

    if (HC.PlayerReplicationInfo.bAdmin)
    {
        switch (Command)
        {
            case "switchteams":
            SwitchSides () ;
            break;
            default:
            HC.ClientMessage ("Type 'mutate switchteams' to switch Team Sides!") ;
            break;
        }
    } else
    {
        HC.NotifyAdminMessage("'mutate switchteams' is an Administrator only command!") ;
    }
}

state HalfTime
{
    function BeginState ()
    {
        Level.Game.Endgame (none,"Switching Teams for HalfTime!") ;

        settimer(5,true);
    }

    function Timer ()
    {
        SwitchSides () ;
        settimer(0,true);
    }
}

function HalfTimeSwitchSides ()
{
    local int RoundsPerMatch;
    local int RemainingRounds;
    local int MidGame;
    local int HalfTime;

    RoundsPerMatch = Level.Game.GameReplicationInfo.RoundsPerMatch ;
    RemainingRounds = Level.Game.GameReplicationInfo.RemainingRounds ;
    MidGame = RoundsPerMatch / 2 ;
    HalfTime = Level.Game.GameReplicationInfo.Teams[0].TeamScore + Level.Game.GameReplicationInfo.Teams[1].TeamScore ;

    switch (HalfTime)
    {
        case MidGame:
        GoToState ('HalfTime');
        break;
        default:
        Log("Halftime is not equal to MidGame!",'LEEFFM');
        break;
    }
}

function SwitchSides ()
{
    local HumanController HC;
    local int PlayerID;
    local int i;

    PlayerID = HC.PlayerReplicationInfo.PlayerID ;

    for (i = 0; i < Level.Game.GameReplicationInfo.PRIArray.Length; i++)
    {
        HC = HumanController(Level.Game.GameReplicationInfo.PRIArray[i].GetController());

        switch (HC.PlayerReplicationInfo.Team.TeamIndex)
        {
            case 0:
            SwapPlayer (HC,1) ;
            break;
            case 1:
            SwapPlayer (HC,0) ;
            break;
        }
    }
}

function SwapPlayer (HumanController HC, int NewTeam)
{
    ChangeTeam (HC,NewTeam) ;
    AGP_TeamInfo(HC.PlayerReplicationInfo.Team).ClearPlayerRequests(HC.PlayerReplicationInfo);
    AGP_TeamInfo(HC.PlayerReplicationInfo.Team).AddToNoRequestList(HC.PlayerReplicationInfo,False);
}

function ChangeTeam (Controller C, int Team)
{
    local int OldTeam;
    local int NewTeam;

    if (Team < 2)
    {
        OldTeam = C.PlayerReplicationInfo.Team.TeamIndex ;
        NewTeam = Team;
    } else
    {
        return;
    }

    if (C.PlayerReplicationInfo.Team.TeamIndex == NewTeam)
    {
        return;
    }

    C.StartSpot= none;

    if (C.PlayerReplicationInfo.Team != None)
    {
        HumanController(C).PlayerReplicationInfo.Team.RemoveFromTeam(C);
        HumanController(C).RequestChangeTeam(NewTeam);
    }

    if (Level.Game.GameReplicationInfo.Teams[NewTeam].AddToTeam(C))
    {
        HumanController(C).ClientMessage ("?[AA25] HalfTime... Switching Sides!") ;
    }
}

defaultproperties
{
    bSwitchAtHalfTime = true
}

Offline Vanoke

  • Epic Poster
  • ******
  • Posts: 1,760
  • Real war is to a GAME!!
    • View Profile
  • AA: =PUF=Vanoke
Re: Team Swap
« Reply #23 on: Friday, February 13, 2015, 15:27:42 PM »
If  you do the ass  is it possible to led it say Teamswap,
 intead of you go to Assault ore Defence
so players know all go to other site !?

Offline Ganja

Re: Team Swap
« Reply #24 on: Friday, February 13, 2015, 15:55:54 PM »
If  you do the ass  is it possible to led it say Teamswap,
 intead of you go to Assault ore Defence
so players know all go to other site !?

I think that you can do something like this:
bind x ass | admin message TEAMSWAP
not sure though

Offline teddy_grizzly_bear

  • Used to be known as nobody
  • Administrator
  • Epic Poster
  • *
  • Posts: 5,707
  • what are you looking at?
    • View Profile
  • AA: teddy_grizzIy_bear
Re: Team Swap
« Reply #25 on: Friday, February 13, 2015, 18:26:53 PM »
I think that you can do something like this:
bind x ass | admin message TEAMSWAP
not sure though
You should be able to.
And it should just show the last message.
<image removed due to imgur stuff - probably for the best>

"Mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true." Bertrand Russell

Offline ~=W!CK!D=~

  • Epic Poster
  • ******
  • Posts: 1,614
    • View Profile
Re: Team Swap
« Reply #26 on: Friday, February 13, 2015, 21:11:50 PM »
Lol. I remember typing that in ass. In console and all those 1 sided noobsss  Players where crying

Offline Ganja

Re: Team Swap
« Reply #27 on: Friday, February 13, 2015, 21:31:07 PM »
Lol. I remember typing that in ass. In console and all those 1 sided noobsss  Players where crying

I"ve seen it happen on pipeline too, was awamzing. Some changed back team immediately after that, and some others just left the server ...

Offline [SWISS]Merlin

Re: Team Swap
« Reply #28 on: Monday, February 16, 2015, 05:27:49 AM »
it's a good feature. i do use it not that often, but good to have it. and it depends on which map you are using it.... maybe first inform the players befor you use it, not that much do leave then :)

Offline bollie

  • Dedicated Poster
  • *****
  • Posts: 1,120
    • View Profile
Re: Team Swap
« Reply #29 on: Monday, February 16, 2015, 06:15:03 AM »
I"ve seen it happen on pipeline too, was awamzing. Some changed back team immediately after that, and some others just left the server ...

I was laughing...but really its sad :/

 

Download Assist

×

Download Game Client

Important: Battletracker no longer exists. However, old Battletracker accounts may still work. You can create a new 25Assist account here

Download Server Manager