Titan Spawn Map

This is the development community to discuss tribes mod coding or to ask questions.

Moderator: Moderators

Post Reply
S_hift
Lt Commander
Lt Commander
Posts: 497
Joined: Sat Sep 26, 2009 7:35 pm

Titan Spawn Map

Post by S_hift » Sun Dec 07, 2014 12:45 am

I'm working on a Christmas mappack with new gametypes. I'm having trouble making a new gametype.

I was wondering if someone could help me make a variant of HIllking that spawns titans instead of the LT or Warrior Loadout. I'm kind of stuck on this map and I would like to move on to the other maps I have to work on. I would also like to keep this lowkey for the meantime as it is a xmas present to the anni community.

Desired loadout

Titan
Particle Beam
Rocket Launcher
Phase Disruptor
Mortar Launcher (base weapon)
Grenade Launcher (base weapon)
Energypack
Beacons(5)
Grenades(5)

User avatar
virus
Ensign
Ensign
Posts: 64
Joined: Wed Jun 12, 2013 1:20 am
Contact:

Re: Titan Spawn Map

Post by virus » Mon Dec 08, 2014 2:25 am

I believe that's a mod feature to change spawn for certain gametypes. such as deathmatch. See if Plasmatic/Crow can add a few lines of code to accommodate your gametype to spawn the desired armors in lieu of the default.

That would be fun though.

User avatar
EvanVolm
1st Lieutenant
1st Lieutenant
Posts: 288
Joined: Fri Jun 12, 2009 6:14 pm

Re: Titan Spawn Map

Post by EvanVolm » Mon Dec 08, 2014 2:34 am

Team 1: All Titans.
Team 2: All Angels.

Have fun.

S_hift
Lt Commander
Lt Commander
Posts: 497
Joined: Sat Sep 26, 2009 7:35 pm

Re: Titan Spawn Map

Post by S_hift » Wed Dec 10, 2014 5:43 am

I would be on team one. No problem. :cat:

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

Re: Titan Spawn Map

Post by Perrinoia » Sat Dec 13, 2014 4:31 pm

Copy the following code into the bottom of your MIS file, and replace all instances of the word "HillKing" with whatever you decide to name your map.

Code: Select all

function Game::playerSpawn(%clientId, %respawn)
{
   if(!$ghosting)
      return false;

   Client::clearItemShopping(%clientId);
   %spawnMarker = Game::pickPlayerSpawn(%clientId, %respawn);

   if(%spawnMarker)
   {
      %clientId.guiLock = "";
      %clientId.dead = "";
      if(%spawnMarker == -1)
      {
         %spawnPos = "0 0 300";
         %spawnRot = "0 0 0";
      }
      else
      {
         %spawnPos = GameBase::getPosition(%spawnMarker);
         // make sure the player doesnt end up with goofy rotation and screw up deploying items.. -plasmatic
         %spawnRot = "0 0 "@ getword(GameBase::getRotation(%spawnMarker),2);
      }
      //plasmatic 3.0
      if($build)
      {
         $DefaultArmor[Male] = armormBuilder;
         $DefaultArmor[Female] = armorfBuilder;
      }
      //perrinoia
      else if($missionName == "HillKing")
      {
         $DefaultArmor[Male] = armorTitan;
         $DefaultArmor[Female] = armorTitan;
      }
      else
      {
         $DefaultArmor[Male] = armormWarrior;
         $DefaultArmor[Female] = armorfWarrior;
      }
      %armor = $DefaultArmor[Client::getGender(%clientId)];

      %pl = spawnPlayer(%armor, %spawnPos, %spawnRot);
      echo("SPAWN: "@ Client::getName(%clientID)@ " cl:" @ %clientId @ " pl:" @ %pl @ " marker:" @ %spawnMarker @ " armor:" @ %armor @" rot: "@gamebase::getrotation(%pl));
      %pl.cloakable = true;   //for base cloaker -plasmatic

      %clientId.observerMode = "";
      %pl.teled = "";   // for teleporter 2.2 model -plasmatic
      %clientId.ConnectBeam = "";   //for zappy invs -plasmatic
      %clientId.InvTargetable = "";   //zap!
      %ClientId.InvConnect = "";   //Zap!

      if(%pl != -1)
      {
         //Client::clearItemShopping(%clientId);
         GameBase::setTeam(%pl, Client::getTeam(%clientId));
         Client::setOwnedObject(%clientId, %pl);
         Game::playerSpawned(%pl, %clientId, %armor, %respawn);
         %pl.cloakable = true;
         $jailed[%pl] = "";
         $released[%pl] = "";
         if($matchStarted)
         {
            Client::setControlObject(%clientId, %pl);
            %clientId.droid=false;
         }
         else
         {
            %clientId.observerMode = "pregame";
            Client::setControlObject(%clientId, Client::getObserverCamera(%clientId));
            Observer::setOrbitObject(%clientId, %pl, 3, 3, 3);
         }
//==================  respawn Invulnerable -plasmatic
      $respawnInvulnerableTime = 10;
      if(%respawn)
      {
         $respawnInvulnerableTime = 5;
         if($siegeFlag)   Siege::waypointClient(%clientId);
      }
      %damage = %armor.maxDamage - 0.001;
      GameBase::setEnergy(%pl, %armor.maxEnergy);   ///2);
      GameBase::setAutoRepairRate(%pl, %damage / $respawnInvulnerableTime);
      %pl.invulnerable = true;
      %pl.cloakable = true;   //fer base cloaker -plasmatic
      $jailed[%pl] = "";   //just to be certain for jail..
      $released[%pl] = "";

      incInvulnerable(%pl, 0);
         %weapon = Player::getMountedItem(%pl,$WeaponSlot);
         if(%weapon != -1)
         {
               %pl.lastWeapon = %weapon;
               Player::unMountItem(%pl,$WeaponSlot);
         }
          if(!%respawn)
   {
      // initial drop
      if($siegeFlag)
      {
         schedule("Client::sendMessage("@%clientId@", 0, \"Welcome to Siege! Capture or hold the switch to complete the mission.\");",5);
         schedule("Siege::InitialwaypointClient("@%clientId@");",5);
      }
      if(%clientId.SpecialMessage == true)
         CustomMessage(%clientId);
      ModSettingsInfo(%clientId, true);
      //echo("join team "@Client::getTeam(%clientId)@" old team = "@%clientId.lastteam);
      if(%clientId.LastTeam != -1 && %clientId.LastTeam != Client::getTeam(%clientId))
      {
         if($annihilation::DisableTurretsOnTeamChange)
            Turret::DisableClients(%clientId);
      }

      %clientId.LastTeam = Client::getTeam(%clientId);
   }

      }
      return true;
   }
   else
   {
      Client::sendMessage(%clientId,0,"Sorry No Respawn Positions Are Empty - Try again later ");
      return false;
   }
}

function Game::playerSpawned(%pl, %clientId, %armor)
{
   // hard coded here -plasmatic
   
   schedule("Client::clearItemShopping("@%clientId@");",1);
   
   if($Annihilation::UsePersonalSkin)
      Client::setSkin(%clientId, $Client::info[%clientId, 0]);
   else Client::setSkin(%clientId, $Server::teamSkin[Client::getTeam(%clientId)]);
   if($Annihilation::uber)
      %m = 10;
   else %m = 1;
   if($build)
   {
      Annihilation::setItemCount(%clientId, iarmorBuilder, 1);   
      Annihilation::setItemCount(%clientId, Railgun, 1);
      Annihilation::setItemCount(%clientId, Grabbler, 1);
      Annihilation::setItemCount(%clientId, RocketLauncher, 1);
      Annihilation::setItemCount(%clientId, TargetingLaser, 1);
      Annihilation::setItemCount(%clientId, slapper, 1);
         
      Annihilation::setItemCount(%clientId, RailAmmo, 300);         
      Annihilation::setItemCount(%clientId, RocketAmmo, 300);    
      Player::useItem(%pl,Grabbler);
      
      
      
   }
   //perrinoia
   else if($missionName == "HillKing")
   {
      %item[1] = "iarmorTitan";
      %item[2] = "ParticleBeamWeapon";
      %item[3] = "RocketLauncher";
      %item[4] = "RocketAmmo";
      %item[5] = "PhaseDisrupter";
      %item[6] = "PhaseAmmo";
      %item[7] = "Mortar";
      %item[8] = "MortarAmmo";
      %item[9] = "GrenadeLauncher";
      %item[10] = "GrenadeAmmo";
      %item[11] = "Energypack";
      %item[12] = "Beacon";
      %item[13] = "Grenade";
      %item[14] = "mine";
      %item[15] = "repairkit";
      while(%item[%i++] != "")
         Annihilation::setItemCount(%clientId, %item[%i], $ItemMax[armorTitan, (%item[%i])]);
   }
   else
   {   
      Annihilation::setItemCount(%clientId, iarmorWarrior, 1);   
      Annihilation::setItemCount(%clientId, DiscLauncher, 1);
      Annihilation::setItemCount(%clientId, PlasmaGun, 1);
      Annihilation::setItemCount(%clientId, Shotgun, 1);
      Annihilation::setItemCount(%clientId, TargetingLaser, 1);
         
      Annihilation::setItemCount(%clientId, discammo, 30*%m);         
      Annihilation::setItemCount(%clientId, PlasmaAmmo, 30*%m);    
      Annihilation::setItemCount(%clientId, ShotgunShells, 30*%m);
         
      Annihilation::setItemCount(%clientId, RepairKit, 1);
      Annihilation::setItemCount(%clientId, Beacon, 5*%m);
      Annihilation::setItemCount(%clientId, Grenade, 8);      
      Annihilation::setItemCount(%clientId, MineAmmo, 3);
               
      Annihilation::setItemCount(%clientId, EnergyPack, 1);
      Player::useItem(%pl,EnergyPack);      
      Player::useItem(%pl,PlasmaGun);
   }
}

User avatar
virus
Ensign
Ensign
Posts: 64
Joined: Wed Jun 12, 2013 1:20 am
Contact:

Re: Titan Spawn Map

Post by virus » Mon Dec 15, 2014 12:43 am

Game On! I can't wait.

DaJ4ck3L
Crow{OZ}
Posts: 118
Joined: Tue Feb 03, 2009 7:18 pm

Re: Titan Spawn Map

Post by DaJ4ck3L » Mon Dec 15, 2014 1:44 am

EvanVolm wrote:Team 1: All Titans.
Team 2: All Angels.

Have fun.

lol this sounds fun.

and the titan LT i already got covered. i told shift i had planned to do this. lol

i also told him it wouldn't work from the map, and has to be done serverside. too much stuff would get overwritten with that.

User avatar
Plasmatic
Lead Developer
Lead Developer
Posts: 8376
Joined: Mon Apr 29, 2002 11:00 pm
Location: 4th State of matter.
Contact:

Re: Titan Spawn Map

Post by Plasmatic » Mon Jan 05, 2015 11:12 pm

Missed this post as I was slammed at work for December.

Simple way would be a named trigger in a doorway that flips loadout and armors. ;)
This wouldn't require a server mod, and wouldn't love up the mod like overwriting functions. Perr, I'm looking at you. :cat:

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

Re: Titan Spawn Map

Post by Perrinoia » Wed Feb 04, 2015 1:35 am

I know, but I modified the function from the old copy of BR that I have, so it shouldn't mess up too much...

Plus the modification of the function only runs when the server is hosting that map.

Post Reply