The Exiled
http://theexiled.pwnageservers.com/forum/

Territories/Zones
http://theexiled.pwnageservers.com/forum/viewtopic.php?f=4&t=921
Page 3 of 3

Author:  TE-Braveskin [ Tue Jan 03, 2006 4:09 pm ]
Post subject: 

I guess I'll do this, but I need you to do 3 things. Change your towers with these:

Code:
instant StaticShape "Switch <!>" {
         dataBlock = "TowerSwitch";
         name = "PushSwitch";
         position = "-176.681 -348.192 184.242";
         rotation = "0 0 0";
         destroyable = "True";
         deleteOnDestroy = "False";
         objectiveLine = "17";
         scoreValue = "1";
      };
      instant StaticShape "Switch |WAR|" {
         dataBlock = "TowerSwitch";
         name = "WARSwitch";
         position = "908.315 -20.5509 184.241";
         rotation = "0 0 0";
         destroyable = "True";
         deleteOnDestroy = "False";
         objectiveLine = "18";
         scoreValue = "1";
      };
      instant StaticShape "Switch TE" {
         dataBlock = "TowerSwitch";
         name = "TESwitch";
         position = "256.278 741.218 184.239";
         rotation = "0 0 0";
         destroyable = "True";
         deleteOnDestroy = "False";
         objectiveLine = "19";
         scoreValue = "1";
      };


then add this to the bottom:
Code:
$teamScoreLimit = 1337;

function CheckOwnedTowers(%team)
{
if($OwnsPushSwitch == %team && $OwnsPushSwitch == %team && $OwnsTESwitch == %team)
{
teammessages(3,gamebase::getteam(%client),"Your team has won!");
messageall(1,"The "@getTeamName(%team)@" has won!");      
$TeamScore[%team] = 1337;
ObjectiveMission::checkScoreLimit();   
}   
}   

function TESwitch::onCollision(%this,%object)
{
%tower = %this;// Confusion, Be gone! -Braveskin
%firstTeam = gamebase::getteam(%tower);   
if(getObjectType(%object) == "Player")
{
%client = player::getclient(%object);   
if(gamebase::getteam(%client)!=gamebase::getteam(%tower))
{
teammessages(3,gamebase::getteam(%client),"Your team is now in control of the TE Switch.~wCapturedTower.wav");   
if(%firstteam != -1)
{
teammessages(3,%firstteam,client::getname@" has stolen the TE Switch from your team!");   
}
messageall(0,"The "@getTeamName(gamebase::getteam(%client))@" team is now in control of the TE Switch.");
gamebase::setteam(%tower,gamebase::getteam(%client));   
$OwnsTESwitch = gamebase::getteam(%client);
if($OwnsPushSwitch == gamebase::getteam(%client) && $OwnsWarSwitch == gamebase::getteam(%client))
{
messageall(1,"The "@getTeamName(gamebase::getteam(%client))@" team has 20 seconds to win! Take those towers!");
%team = gamebase::getteam(%client);
schedule("CheckOwnedTowers("@%team@");",20);   
}   
}   
}
}

function WARSwitch::onCollision(%this,%object)
{
%tower = %this;// Confusion, Be gone! -Braveskin
%firstTeam = gamebase::getteam(%tower);   
if(getObjectType(%object) == "Player")
{
%client = player::getclient(%object);   
if(gamebase::getteam(%client)!=gamebase::getteam(%tower))
{
teammessages(3,gamebase::getteam(%client),"Your team is now in control of the |WAR| Switch.~wCapturedTower.wav");   
if(%firstteam != -1)
{
teammessages(3,%firstteam,client::getname@" has stolen the |WAR| Switch from your team!");   
}
messageall(0,"The "@getTeamName(gamebase::getteam(%client))@" team is now in control of the |WAR| Switch.");
gamebase::setteam(%tower,gamebase::getteam(%client));   
$OwnsWARSwitch = gamebase::getteam(%client);
if($OwnsPushSwitch == gamebase::getteam(%client) && $OwnsWarSwitch == gamebase::getteam(%client))
{
messageall(1,"The "@getTeamName(gamebase::getteam(%client))@" team has 20 seconds to win! Take those towers!");
%team = gamebase::getteam(%client);
schedule("CheckOwnedTowers("@%team@");",20);   
}   
}   
}
}

function PushSwitch::onCollision(%this,%object)
{
%tower = %this;// Confusion, Be gone! -Braveskin
%firstTeam = gamebase::getteam(%tower);   
if(getObjectType(%object) == "Player")
{
%client = player::getclient(%object);   
if(gamebase::getteam(%client)!=gamebase::getteam(%tower))
{
teammessages(3,gamebase::getteam(%client),"Your team is now in control of the <!> Switch.~wCapturedTower.wav");   
if(%firstteam != -1)
{
teammessages(3,%firstteam,client::getname@" has stolen the <!> Switch from your team!");   
}
messageall(0,"The "@getTeamName(gamebase::getteam(%client))@" team is now in control of the <!> Switch.");
gamebase::setteam(%tower,gamebase::getteam(%client));   
$OwnsPushSwitch = gamebase::getteam(%client);
if($OwnsPushSwitch == gamebase::getteam(%client) && $OwnsWarSwitch == gamebase::getteam(%client))
{
messageall(1,"The "@getTeamName(gamebase::getteam(%client))@" team has 20 seconds to win! Take those towers!");
%team = gamebase::getteam(%client);
schedule("CheckOwnedTowers("@%team@");",20);   
}   
}   
}
}

Author:  TE-Braveskin [ Tue Jan 03, 2006 4:09 pm ]
Post subject: 

I know it works, I tested it myself.

Author:  TE-Krogoth [ Tue Jan 03, 2006 7:43 pm ]
Post subject: 

It works more than the other one did, but not exactly.

It seems to start the count down whenever I have control of any two switches.

Code:
MSG: "=**TE**=Krogoth joined team The Exiled."
Executing missions\Copy of Damn_Tarts.dsc.
teamMessages 1, 0, Your team has taken an objective.~wCapturedTower.wav, , ,
teamMessages 0, 0, The The Exiled has taken an objective., , ,
MSG: "You claimed The Defense Platform for the The Exiled team!"
MSG: "Your team has taken an objective."
MSG: "The The Exiled has taken an objective."
teamMessages 3, 0, Your team is now in control of the TE Switch.~wCapturedTower.wav, , ,
MSG: "Your team is now in control of the TE Switch."
MSG: "The The Exiled team is now in control of the TE Switch."
MSG: "The The Exiled team has 20 seconds to win! Take those towers!"
Syntax error in input.
teamMessages 3, -1, Your team has won!, , ,
GAME: teamfinalscore 0 1337
GAME: teamfinalscore 1 0
GAME: teamfinalscore 2 0
Changing to mission D R O P Z O N E_2 0 0 5.


The defense platform switch isn't supposed to be part of the territories.

Author:  TE-Noxwizard [ Tue Jan 03, 2006 7:55 pm ]
Post subject: 

I see it.


Code:
function CheckOwnedTowers(%team)
{
if($OwnsPushSwitch == %team && $OwnsPushSwitch == %team && $OwnsTESwitch == %team)
{
teammessages(3,gamebase::getteam(%client),"Your team has won!");
messageall(1,"The "@getTeamName(%team)@" has won!");     
$TeamScore[%team] = 1337;
ObjectiveMission::checkScoreLimit();   
}   
}


He's got the PushSwitch twice, it needs to be:
Code:
function CheckOwnedTowers(%team)
{
    if($OwnsPushSwitch == %team && $OwnsWARSwitch == %team && $OwnsTESwitch == %team)
    {
        teammessages(3,gamebase::getteam(%client),"Your team has won!");
        messageall(1,"The "@getTeamName(%team)@" has won!");
        $TeamScore[%team] = 1337;
        ObjectiveMission::checkScoreLimit();
    }
}

Author:  TE-Noxwizard [ Tue Jan 03, 2006 8:43 pm ]
Post subject: 

Just noticed some more duplicate areas. Try this:
Code:
// Territory/Zone Map Code created by Braveskin

$teamScoreLimit = 1337;

function CheckOwnedTowers(%team)
{
    if($OwnsPushSwitch == %team && $OwnsWARSwitch == %team && $OwnsTESwitch == %team)
    {
        teammessages(3,gamebase::getteam(%client),"Your team has won!");
        messageall(1,"The "@getTeamName(%team)@" has won!");
        $TeamScore[%team] = 1337;
        ObjectiveMission::checkScoreLimit();
    }
}

function TESwitch::onCollision(%this,%object)
{
    %tower = %this;// Confusion, Be gone! -Braveskin
    %firstTeam = gamebase::getteam(%tower);
   
    if(getObjectType(%object) == "Player")
    {
        %client = player::getclient(%object);
       
        if(gamebase::getteam(%client)!=gamebase::getteam(%tower))
        {
            teammessages(3,gamebase::getteam(%client),"Your team is now in control of the TE Switch.~wCapturedTower.wav");
        }
           
        if(%firstteam != -1)
        {
        teammessages(3,%firstteam,client::getname@" has stolen the TE Switch from your team!");
        }
       
        messageall(0,"The "@getTeamName(gamebase::getteam(%client))@" team is now in control of the TE Switch.");
        gamebase::setteam(%tower,gamebase::getteam(%client));
        $OwnsTESwitch = gamebase::getteam(%client);

        if($OwnsPushSwitch == gamebase::getteam(%client) && $OwnsWarSwitch == gamebase::getteam(%client))
        {
            messageall(1,"The "@getTeamName(gamebase::getteam(%client))@" team has 20 seconds to win! Take those towers!");
            %team = gamebase::getteam(%client);
            schedule("CheckOwnedTowers("@%team@");",20);
        }
    }
}

function WARSwitch::onCollision(%this,%object)
{
    %tower = %this;// Confusion, Be gone! -Braveskin
    %firstTeam = gamebase::getteam(%tower);

    if(getObjectType(%object) == "Player")
    {
        %client = player::getclient(%object);

        if(gamebase::getteam(%client)!=gamebase::getteam(%tower))
        {
            teammessages(3,gamebase::getteam(%client),"Your team is now in control of the |WAR| Switch.~wCapturedTower.wav");
        }
       
        if(%firstteam != -1)
        {
            teammessages(3,%firstteam,client::getname@" has stolen the |WAR| Switch from your team!");
        }
           
        messageall(0,"The "@getTeamName(gamebase::getteam(%client))@" team is now in control of the |WAR| Switch.");
        gamebase::setteam(%tower,gamebase::getteam(%client));
        $OwnsWARSwitch = gamebase::getteam(%client);

        if($OwnsPushSwitch == gamebase::getteam(%client) && $OwnsTESwitch == gamebase::getteam(%client))
        {
            messageall(1,"The "@getTeamName(gamebase::getteam(%client))@" team has 20 seconds to win! Take those towers!");
            %team = gamebase::getteam(%client);
            schedule("CheckOwnedTowers("@%team@");",20);
        }
    }
}

function PushSwitch::onCollision(%this,%object)
{
    %tower = %this;// Confusion, Be gone! -Braveskin
    %firstTeam = gamebase::getteam(%tower);
   
    if(getObjectType(%object) == "Player")
    {
        %client = player::getclient(%object);
       
        if(gamebase::getteam(%client)!=gamebase::getteam(%tower))
        {
        teammessages(3,gamebase::getteam(%client),"Your team is now in control of the <!> Switch.~wCapturedTower.wav");
        }

        if(%firstteam != -1)
        {
            teammessages(3,%firstteam,client::getname@" has stolen the <!> Switch from your team!");
        }

        messageall(0,"The "@getTeamName(gamebase::getteam(%client))@" team is now in control of the <!> Switch.");
        gamebase::setteam(%tower,gamebase::getteam(%client));
        $OwnsPushSwitch = gamebase::getteam(%client);

        if($OwnsTESwitch == gamebase::getteam(%client) && $OwnsWARSwitch == gamebase::getteam(%client))
        {
            messageall(1,"The "@getTeamName(gamebase::getteam(%client))@" team has 20 seconds to win! Take those towers!");
            %team = gamebase::getteam(%client);
            schedule("CheckOwnedTowers("@%team@");",20);
        }
    }
}

Author:  TE-Hammy [ Tue Jan 03, 2006 9:36 pm ]
Post subject: 

nox... ^.^

Author:  TE-Braveskin [ Tue Jan 03, 2006 10:49 pm ]
Post subject: 

Yeah, just rip credit out of my hands. I would've seen it.

Author:  TE-Krogoth [ Wed Jan 04, 2006 8:49 am ]
Post subject: 

No worries Brave, you'll still get full credit it for it.

Three points go to Shugo for helping with this.
Five points go to Braveskin for getting it to work.

Thanks for looking into this, I posted it on the Anni forum, but no one helped me.

Thanks to those points, that gave you each enough for a promotion.

Braveskin and Shugo are now Squires. Weird, Braveskin should have been a Squire now, not sure why you weren't informed. Brave, you need five more points for your next promotion to Knight, and Shugo, you need 15 points for your next promotion to Knight.

Author:  TE-Noxwizard [ Wed Jan 04, 2006 8:55 am ]
Post subject: 

There we go, I gave you credit at the top. All I did was space it out so I could see where the missing } needed to go.

Page 3 of 3 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/