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

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

Author:  TE-Krogoth [ Sat Dec 31, 2005 11:04 am ]
Post subject: 

I need someone to do it for me, because I have no knowledge about this stuff. I have three switches on this map, if you need names, just name them Switch1, Switch2, and Switch3, and I'll just rename them later.

Author:  TE-Shugo [ Sat Dec 31, 2005 2:23 pm ]
Post subject: 

is that the staticshape name?¿

Author:  TE-Krogoth [ Sat Dec 31, 2005 2:43 pm ]
Post subject: 

Here's the switches:

Code:
      instant StaticShape "Switch <!>" {
         dataBlock = "TowerSwitch";
         name = "";
         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 = "";
         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 = "";
         position = "256.278 741.218 184.239";
         rotation = "0 0 0";
         destroyable = "True";
         deleteOnDestroy = "False";
         objectiveLine = "19";
         scoreValue = "1";
      };


I want it so that if all three of those are held for ten secons, you win.

Author:  TE-Shugo [ Tue Jan 03, 2006 1:53 am ]
Post subject: 

10sec???

Author:  TE-Shugo [ Tue Jan 03, 2006 2:04 am ]
Post subject: 

I have no idea if this will work but you can try ;)

Code:
function TowerSwitch::onCollision(%this, %object)
{
   if(getObjectType(%object) != "Player")
            return;

      if(Player::isDead(%object))
            return;

   %playerTeam = GameBase::getTeam(%object);
     %oldTeam = GameBase::getTeam(%this);
      if(%oldTeam == %playerTeam)
            return;

   %client = Player::getClient(%object);
   %Team = Client::getTeam(%client);
   if(GameBase::getMapName(%this) == "Switch <!>")
   {
      messageAll(0,Client::getName(%client) @ " got the <!> Switch!!");
      messageAllExcept(Client::getTeam(%client), "Your team lost the <!> Switch!");
      %playerTeam.Switch1 = true;
   }
   if(GameBase::getMapName(%this) == "Switch |WAR|")
   {
      messageAll(0,Client::getName(%client) @ " got the |WAR| Switch!!");
      messageAllExcept(Client::getTeam(%client), "Your team lost the |WAR| Switch!");
      %playerTeam.Switch2 = true;
   }
   if(GameBase::getMapName(%this) == "Switch TE")
   {
      messageAll(0,Client::getName(%client) @ " got the TE Switch!!");
      messageAllExcept(Client::getTeam(%client), "Your team lost the TE Switch!");
      %playerTeam.Switch4 = true;
   }
   if(%playerTeam.Switch1 && %playerTeam.Switch2 && %playerTeam.Switch3)
   {
      ObjectiveMission::setObjectiveHeading();
      if(%playerTeam.Switch1 == "false" || %playerTeam.Switch2 == "false" || %playerTeam.Switch3 == "false")
      {
         return;
      }
      schedule("ObjectiveMission::missionComplete();", 10);//if ya want 10min type 10*60 where it just says 10
   }
}

Author:  TE-Krogoth [ Tue Jan 03, 2006 12:30 pm ]
Post subject: 

It didn't work. I changed it to function Territory so that the other switch would work. Right now, when you touch one of the three switches, nothing happens.

Author:  TE-Shugo [ Tue Jan 03, 2006 1:32 pm ]
Post subject: 

hmm go into objective.cs look for a function named TowerSwitch::onCollision(%this, %object)

and add it to the bottom sumwhere try it make a copy of objective.cs just incase it messes it up

Author:  TE-Noxwizard [ Tue Jan 03, 2006 2:41 pm ]
Post subject: 

If you're going to overwrite the existing function, you're going to need the original code plus yours.

My guess would be:

Code:
//fixed so cham can't claim for enemy team.. -Plasmatic
function TowerSwitch::onCollision(%this, %object)
{   
   if($debug)
      event::collision(%this,%object);

   %playerClient = Player::getClient(%object);
   if(getObjectType(%object) != "Player" || %playerClient.isSpy || Player::isDead(%object))
      return;

   %playerTeam = GameBase::getTeam(%object);
   %oldTeam = GameBase::getTeam(%this);
   if(%oldTeam == %playerTeam)
      return;

   %this.trainingObjectiveComplete = true;
   
   %touchClientName = Client::getName(%playerClient);
   %group = GetGroup(%this);
   Group::iterateRecursive(%group, GameBase::setTeam, %playerTeam);

   %dropPoints = nameToID(%group @ "/DropPoints");
   %oldDropSet = nameToID("MissionCleanup/TeamDrops" @ %oldTeam);
   %newDropSet = nameToID("MissionCleanup/TeamDrops" @ %playerTeam);

   $deltaTeamScore[%oldTeam] -= %this.deltaTeamScore;
   $deltaTeamScore[%playerTeam] += %this.deltaTeamScore;
   $teamScore[%oldTeam] -= %this.scoreValue;
   $teamScore[%playerTeam] += %this.scoreValue;

   if(%dropPoints != -1)
   {
      for(%i = 0; (%dropPoint = Group::getObject(%dropPoints, %i)) != -1; %i++)
      {
         if(%oldDropSet != -1)
            removeFromSet(%oldDropSet, %dropPoint);
         addToSet(%newDropSet, %dropPoint);
      }
   }

   if(%oldTeam == -1)
   {
      MessageAllExcept(%playerClient, 0, %touchClientName @ " claimed " @ %this.objectiveName @ " for the " @ getTeamName(%playerTeam) @ " team!");
      Client::sendMessage(%playerClient, 0, "You claimed " @ %this.objectiveName @ " for the " @ getTeamName(%playerTeam) @ " team!");
    }
   else
   {
      if(%this.objectiveLine)
      {
         MessageAllExcept(%playerClient, 0, %touchClientName @ " captured " @ %this.objectiveName @ " from the " @ getTeamName(%oldTeam) @ " team!");
         Client::sendMessage(%playerClient, 0, "You captured " @ %this.objectiveName @ " from the " @ getTeamName(%oldTeam) @ " team!");
         %this.numSwitchTeams++;
         schedule("TowerSwitch::timeLimitCheckPoints(" @ %this @ "," @ %playerClient @ "," @ %this.numSwitchTeams @ ");",60);
      }
   }
   if(%this.objectiveLine)
   {
      TeamMessages(1, %playerTeam, "Your team has taken an objective.~wCapturedTower.wav");
      TeamMessages(0, %playerTeam, "The " @ getTeamName(%playerTeam) @ " has taken an objective.");
      if(%oldTeam != -1)
         TeamMessages(1, %oldTeam, "The " @ getTeamName(%playerTeam) @ " team has taken your objective.~wLostTower.wav");
      ObjectiveMission::ObjectiveChanged(%this);
   }

// Start Shugo Code

   %client = Player::getClient(%object);
   %Team = Client::getTeam(%client);
   if(GameBase::getMapName(%this) == "Switch <!>")
   {
      messageAll(0,Client::getName(%client) @ " got the <!> Switch!!");
      messageAllExcept(Client::getTeam(%client), "Your team lost the <!> Switch!");
      %playerTeam.Switch1 = true;
   }
   if(GameBase::getMapName(%this) == "Switch |WAR|")
   {
      messageAll(0,Client::getName(%client) @ " got the |WAR| Switch!!");
      messageAllExcept(Client::getTeam(%client), "Your team lost the |WAR| Switch!");
      %playerTeam.Switch2 = true;
   }
   if(GameBase::getMapName(%this) == "Switch TE")
   {
      messageAll(0,Client::getName(%client) @ " got the TE Switch!!");
      messageAllExcept(Client::getTeam(%client), "Your team lost the TE Switch!");
      %playerTeam.Switch4 = true;
   }
   if(%playerTeam.Switch1 && %playerTeam.Switch2 && %playerTeam.Switch3)
   {
      ObjectiveMission::setObjectiveHeading();
      if(%playerTeam.Switch1 == "false" || %playerTeam.Switch2 == "false" || %playerTeam.Switch3 == "false")
      {
         return;
      }
      schedule("ObjectiveMission::missionComplete();", 10);//if ya want 10min type 10*60 where it just says 10
   }

// End Shugo Code

   ObjectiveMission::checkScoreLimit();
}


Just a guess though.

Author:  TE-Krogoth [ Tue Jan 03, 2006 3:12 pm ]
Post subject: 

Starting to get close here.

Right now, I have four switches, I only want it so that you have to control those three I listed. What it's doing now is ending the game as soon as I control all four, it's not even waiting ten seconds.

Author:  TE-Shugo [ Tue Jan 03, 2006 3:52 pm ]
Post subject: 

try
Code:
//fixed so cham can't claim for enemy team.. -Plasmatic
function TowerSwitch::onCollision(%this, %object)
{   
   if($debug)
      event::collision(%this,%object);

   %playerClient = Player::getClient(%object);
   if(getObjectType(%object) != "Player" || %playerClient.isSpy || Player::isDead(%object))
      return;

   %playerTeam = GameBase::getTeam(%object);
   %oldTeam = GameBase::getTeam(%this);
   if(%oldTeam == %playerTeam)
      return;

   %this.trainingObjectiveComplete = true;
   
   %touchClientName = Client::getName(%playerClient);
   %group = GetGroup(%this);
   Group::iterateRecursive(%group, GameBase::setTeam, %playerTeam);

   %dropPoints = nameToID(%group @ "/DropPoints");
   %oldDropSet = nameToID("MissionCleanup/TeamDrops" @ %oldTeam);
   %newDropSet = nameToID("MissionCleanup/TeamDrops" @ %playerTeam);

   $deltaTeamScore[%oldTeam] -= %this.deltaTeamScore;
   $deltaTeamScore[%playerTeam] += %this.deltaTeamScore;
   $teamScore[%oldTeam] -= %this.scoreValue;
   $teamScore[%playerTeam] += %this.scoreValue;

   if(%dropPoints != -1)
   {
      for(%i = 0; (%dropPoint = Group::getObject(%dropPoints, %i)) != -1; %i++)
      {
         if(%oldDropSet != -1)
            removeFromSet(%oldDropSet, %dropPoint);
         addToSet(%newDropSet, %dropPoint);
      }
   }

   if(%oldTeam == -1)
   {
      MessageAllExcept(%playerClient, 0, %touchClientName @ " claimed " @ %this.objectiveName @ " for the " @ getTeamName(%playerTeam) @ " team!");
      Client::sendMessage(%playerClient, 0, "You claimed " @ %this.objectiveName @ " for the " @ getTeamName(%playerTeam) @ " team!");
    }
   else
   {
      if(%this.objectiveLine)
      {
         MessageAllExcept(%playerClient, 0, %touchClientName @ " captured " @ %this.objectiveName @ " from the " @ getTeamName(%oldTeam) @ " team!");
         Client::sendMessage(%playerClient, 0, "You captured " @ %this.objectiveName @ " from the " @ getTeamName(%oldTeam) @ " team!");
         %this.numSwitchTeams++;
         schedule("TowerSwitch::timeLimitCheckPoints(" @ %this @ "," @ %playerClient @ "," @ %this.numSwitchTeams @ ");",60);
      }
   }
   if(%this.objectiveLine)
   {
      TeamMessages(1, %playerTeam, "Your team has taken an objective.~wCapturedTower.wav");
      TeamMessages(0, %playerTeam, "The " @ getTeamName(%playerTeam) @ " has taken an objective.");
      if(%oldTeam != -1)
         TeamMessages(1, %oldTeam, "The " @ getTeamName(%playerTeam) @ " team has taken your objective.~wLostTower.wav");
      ObjectiveMission::ObjectiveChanged(%this);
   }

// Start Shugo Code

   %client = Player::getClient(%object);
   %Team = Client::getTeam(%client);
   if(GameBase::getMapName(%this) == "Switch <!>")
   {
      messageAll(0,Client::getName(%client) @ " got the <!> Switch!!");
      messageAllExcept(Client::getTeam(%client), "Your team lost the <!> Switch!");
      %playerTeam.Switch1 = true;
   }
   if(GameBase::getMapName(%this) == "Switch |WAR|")
   {
      messageAll(0,Client::getName(%client) @ " got the |WAR| Switch!!");
      messageAllExcept(Client::getTeam(%client), "Your team lost the |WAR| Switch!");
      %playerTeam.Switch2 = true;
   }
   if(GameBase::getMapName(%this) == "Switch TE")
   {
      messageAll(0,Client::getName(%client) @ " got the TE Switch!!");
      messageAllExcept(Client::getTeam(%client), "Your team lost the TE Switch!");
      %playerTeam.Switch4 = true;
   }
   if(%playerTeam.Switch1 && %playerTeam.Switch2 && %playerTeam.Switch3)
   {
      //ObjectiveMission::setObjectiveHeading();
      if(%playerTeam.Switch1 == "false" || %playerTeam.Switch2 == "false" || %playerTeam.Switch3 == "false")
      {
         return;
      }
      schedule("ObjectiveMission::missionComplete();", 10);//if ya want 10min type 10*60 where it just says 10
   }

// End Shugo Code

   ObjectiveMission::checkScoreLimit();
}

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