Multiple Teams + Chameleon Pack

Suggestions you have for the Annihilation mod.

Moderator: Moderators

Post Reply
Perrinoia
Suggestion bot 10,000
Posts: 11185
Joined: Sat May 04, 2002 11:00 pm
Location: Rhode Island

Multiple Teams + Chameleon Pack

Post by Perrinoia » Tue Sep 29, 2009 10:12 am

Don't you think it's time to make the chameleon pack capable of impersonating more than one team?

I'm thinking of 3 ways to select which team you'd like to impersonate.
    1) Automatically selected based on closest enemy flag.
    2) Manually select from the personal options menu in the tab menu.
    3) Multiple chameleon packs listed in the inventory station, one per team, buy which ever one you want.

Example #1:
I'm attacking the Blood Eagle base, I activate my pack, it detects the Blood Eagle flag at 100 meters, my own flag (which it ignores), and Diamond Sword's flag at 200 meters. My armor is now beagle.larmor.dts.

Example #2:

Code: Select all

Client::buildMenu(%client, "Impersonate which team?", "Spy", true);
for(%
= 0; %< getNumTeams() - 1; %t++)
    Client::addMenuItem(%client, %+ 1 @" "@ $Server::teamName[%t], %t);
if(
$Build)
    Client::addMenuItem(%client, %+ 1 @" Observer", -1); 


Example #3:
Chameleon Pack Category
    Blood Eagle
    Diamond Sword
    I'm one team2, thus no third pack is displayed.

Perhaps automatic could be an option in Example #2, and the default selection.

I was gonna suggest a random selection too, but decided that would be useless as you'd likely activate the pack while entering a base and get shot by a turret anyway.

User avatar
Nim Ayanami
your mom is primeth
Posts: 636
Joined: Wed May 25, 2005 1:43 pm

Re: Multiple Teams + Chameleon Pack

Post by Nim Ayanami » Tue Sep 29, 2009 11:07 am

awsome idea

Perrinoia
Suggestion bot 10,000
Posts: 11185
Joined: Sat May 04, 2002 11:00 pm
Location: Rhode Island

Re: Multiple Teams + Chameleon Pack

Post by Perrinoia » Tue Oct 13, 2009 10:39 pm

OK, I've figured it out!

You know how the transformers scan objects before they mimmic them in the movie?
We could use GameBase::getLOSInfo and get the team of the LOS::Object to determine which team for the chameleon pack to mimmic during a multiple team mission!

Here's how I would code it:

Code: Select all


function ChameleonPackImage
::onActivate(%player)
{
    if(!(%client = Player::getClient(%player))
        %client = Object::getControlClient(%player);
    %player.lastTeam = GameBase::getTeam(%player);
    if($TeamItemMax["Spy"] <= $TeamItemCount[%player.lastTeam @"Spy"])
        Client::sendMessage(%client, 2, "Your team spies too much!~wError_Message.wav");
    else if(getNumTeams() < 3)
        Spy(%player, !%player.lastTeam);
    else if(!GameBase::getLOSInfo(%player, 1000) || !Spy(%player, GameBase::getTeam($LOS::Object)))
        Client::sendMessage(%client, 2, "Scan an enemy object to mimmic!~wError_Message.wav");
}

function Spy(%player, %nextTeam)
{
    if(%player.lastTeam == %nextTeam || %nextTeam < 0)
        return false;
    if(!(%client = Player::getClient(%player))
        %client = Object::getControlClient(%player);
    Client::setInitialTeam(%client, %nextTeam);
    GameBase::setTeam(%player, %nextTeam);
    Client::setInitialTeam(%client, %player.lastTeam);
    Client::sendMessage(%client, 1, "Chameleon Pack Activated: Mimmicking "@ $Server::teamName[%nextTeam]);
    $TeamItemCount[%player.lastTeam @"Spy"]++;
    return true;
}

function ChameleonPackImage::onDeActivate(%player)
{
    if(!(%client = Player::getClient(%player))
        %client = Object::getControlClient(%player);
    GameBase::setTeam(%player, %player.lastTeam);
    $TeamItemCount[%player.lastTeam, "Spy"]--;
    Client::sendMessage(%client, 1, "Chameleon Pack DeActivated!");
}
  

Something like that anyway.
Last edited by Perrinoia on Sat Oct 31, 2009 9:48 am, edited 1 time in total.

bawb
Commander
Commander
Posts: 1203
Joined: Thu Apr 09, 2009 10:55 am

Re: Multiple Teams + Chameleon Pack

Post by bawb » Thu Oct 29, 2009 11:33 pm

much better now that the BS is gone lol

Post Reply