The Exiled

Shunned by Man, Accepted by Gods
* FAQ    * Search   * Members
* Login   * Register
It is currently Thu Feb 20, 2020 11:50 pm 

 View unanswered posts | View active topics


 Board index » General Area » Modding

Post new topic Reply to topic Users browsing this forum: No registered users and 1 guest
Author
Message
TE-Krogoth
King

User avatar
Joined: Tue Jun 07, 2005 8:01 am
Posts: 2078
Location: Texas
Post Posted: 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.


Image
Image
 Top Offline
Profile WWWYIM
Author
Message
TE-Shugo
Squire

User avatar
Joined: Mon Sep 05, 2005 12:21 am
Posts: 70
Location: YaY ArEa, CaLiForNia
Post Posted: Sat Dec 31, 2005 2:23 pm    Post subject:
 
is that the staticshape name?¿


Image

Image

Image
 Top Offline
Profile WWWYIM
Author
Message
TE-Krogoth
King

User avatar
Joined: Tue Jun 07, 2005 8:01 am
Posts: 2078
Location: Texas
Post Posted: 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.



Image
Image
 Top Offline
Profile WWWYIM
Author
Message
TE-Shugo
Squire

User avatar
Joined: Mon Sep 05, 2005 12:21 am
Posts: 70
Location: YaY ArEa, CaLiForNia
Post Posted: Tue Jan 03, 2006 1:53 am    Post subject:
 
10sec???


Image

Image

Image
 Top Offline
Profile WWWYIM
Author
Message
TE-Shugo
Squire

User avatar
Joined: Mon Sep 05, 2005 12:21 am
Posts: 70
Location: YaY ArEa, CaLiForNia
Post Posted: 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
   }
}



Image

Image

Image
 Top Offline
Profile WWWYIM
Author
Message
TE-Krogoth
King

User avatar
Joined: Tue Jun 07, 2005 8:01 am
Posts: 2078
Location: Texas
Post Posted: 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.


Image
Image
 Top Offline
Profile WWWYIM
Author
Message
TE-Shugo
Squire

User avatar
Joined: Mon Sep 05, 2005 12:21 am
Posts: 70
Location: YaY ArEa, CaLiForNia
Post Posted: 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



Image

Image

Image
 Top Offline
Profile WWWYIM
Author
Message
TE-Noxwizard
King

User avatar
Joined: Tue Jun 07, 2005 5:59 pm
Posts: 941
Location: Texas
Post Posted: 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.



Image
Image
 Top Offline
Profile WWWICQYIM
Author
Message
TE-Krogoth
King

User avatar
Joined: Tue Jun 07, 2005 8:01 am
Posts: 2078
Location: Texas
Post Posted: 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.



Image
Image
 Top Offline
Profile WWWYIM
Author
Message
TE-Shugo
Squire

User avatar
Joined: Mon Sep 05, 2005 12:21 am
Posts: 70
Location: YaY ArEa, CaLiForNia
Post Posted: 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();
}



Image

Image

Image
 Top Offline
Profile WWWYIM
Display posts from previous:  Sort by  
Post new topic Reply to topic Board index » General Area » Modding
Previous topic :: Next topic  
Go to page Previous  1, 2, 3  Next
Page 2 of 3
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group