Augustine: Despondent
Welcome to our Forums! Please login or register! You can introduce yourself here!







Augustine: Despondent

Welcome to the forums! We are the homeplace for Slender: Darkplaces, Augustine, Nightfall survival, and Revamped 1.


You are not connected. Please login or register

i need some help....

View previous topic View next topic Go down  Message [Page 1 of 1]

1 i need some help.... on Tue Jan 01, 2013 5:51 pm

drmabuse1981

avatar
Commander
Commander
i have some serious trouble with my quakemod "Cause of War"...
i want to add different team playermodels for each team, but i dont know HOW to do that...

I would really to know HOW quake does the entire teamplay thing, i still dont understand the whole
shirt/pants thing and i dont WaNT to udnerstand that because i want to have "hardcoded colors" for each team...

It would be a big help if somebody can help me with the code for this OR even send me a link to a other Quakemod
with this feature...

2 Re: i need some help.... on Tue Jan 01, 2013 10:48 pm

Supermario641996

avatar
Reclaimer
Reclaimer
I'm not sure who is still here that can still help you :/ I'd try to help but I don't know one single thing about coding so...




Shhh, it's Mario.  Don't forget to introduce yourself to our community here and our Discord group here. Very Happy
http://augustine.forumotion.com/

3 Re: i need some help.... on Wed Jan 02, 2013 12:55 am

thonglover

avatar
Hero
Hero
http://quakeone.com/
Maybe they can help

4 Re: i need some help.... on Wed Jan 02, 2013 3:07 pm

jastolze

avatar
Brigadier Grade 3
Brigadier Grade 3
http://www.4shared.com/file/FFODnroJ/teamplay.html

That QC file contains the auto teamplay assign, which should be what you're looking for. It came from the 3Wave CTF mod

5 Re: i need some help.... on Wed Mar 20, 2013 10:51 am

Mexicouger

avatar
Noble
Noble
I coded a feature similar into Augustine for teamplay. I just ended up coding my own teamplay system and didn't even look at Quakes Teamplay system.

Here's what I did to auto-assign a team in Augustine.

Code:
/*
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Team setting

Mexi: Beefed up, completely recoded, Team
sorting system. Much more proud of this
than the last one
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*/
void() SetTeam =
{
   //Team counter is used to give everyone a different team on non-team gamemodes
   team_counter += 1;

   if (TEAMS == 0)         //No Teamplay on
      {
         self.team = team_counter;
         self.skin = P_SKIN;
         return;
      }
   
   if (new_game == 1 && TEAMS > 0)   //Teams get randomized when the next game starts
      {
         if (random() < 0.5)   TEAMS = 1;
         else            TEAMS = 2;
      }

   switch(deathmatch)
   {
      case INFECTION:
         //puts first player in game based on "go_team" value
         if (num_humans == 0 && num_zombies == 0)
         {
            if (TEAMS == 1)
            {
               self.team = HUMAN;
               self.skin = P_SKIN;
               stuffcmd(self, "p_team 1\n");
            }
            else if (TEAMS == 2)
            {
               self.team = ZOMBIE;
               self.skin = S_P_SKIN;
               stuffcmd(self, "p_team 2\n");
            }
         }

         //If the original zombie count is less than the maximum zombie count,
         //put the player in as a zombie
         else if (num_zombies < NUMBER_ZOMBIES)
         {
            self.team = ZOMBIE;
            self.skin = S_P_SKIN;
            stuffcmd(self, "p_team 2\n");
         }

         //If the number of original zombies is above the max zombie count,
         //put the rest of the players in as humans
         else if (num_zombies >= NUMBER_ZOMBIES)
         {
            self.team = HUMAN;
            self.skin = P_SKIN;
            stuffcmd(self, "p_team 1\n");
         }
      break;
      case DARKSLAYER:
         //Players are put in on the "go_team" value at the start of a game
         if (num_lplayers == 0 && num_dplayers == 0)
         {
            if (TEAMS == 1)
            {
               self.team = LIGHT;
               self.skin = P_SKIN;
            }
            else if (TEAMS == 2)
            {
               self.team = DARK;
               self.skin = S_P_SKIN;
            }
         }

         //If the darkplayer count is less than the maximum number of darkplayers,
         //put the player in as a dark player
         else if (num_dplayers < NUM_DARKPLAYERS)
         {
            self.team = DARK;
            self.skin = S_P_SKIN;
         }

         //The Dark player max count is met, put the rest of the players in as light
         //players
         else if (num_dplayers >= NUM_DARKPLAYERS)
         {
            self.team = LIGHT;
            self.skin = P_SKIN;
         }
      break;
      case FIREFIGHT:
         self.team = TEAM1;
         self.skin = P_SKIN;
      break;
      default:
         //Players are put in on the "go_team" value at the start of a game
         if(num_rteam == 0 && num_bteam == 0)
         {
            if (TEAMS == 1)
            {
               self.team = TEAM1;
               self.skin = RED;
               num_rteam += 1;
            }
            else if (TEAMS == 2)
            {
               self.team = TEAM2;
               self.skin = BLUE;
               num_bteam += 1;
            }
         }   

         //This autobalances red/blue team players
         else if (num_rteam >= num_bteam)
         {
            self.team = TEAM2;
            self.skin = BLUE;
            num_bteam += 1;
         }

         //This autobalances red/blue team players
         else if (num_bteam >= num_rteam)
         {
            self.team = TEAM1;
            self.skin = RED;
            num_rteam += 1;
         }
   }
};

/*
===========
ClientConnect

called when a player connects to a server
============
*/
void() ClientConnect =
{
   if (self.connected_auto == 1)
      {
         self.team = ZOMBIE;
         self.skin = S_P_SKIN;
      }
   else
      {
         SetTeam();
      }

   //If another player joins that is human, and someone else is last man,
   //demote the last man
   if (self.team == HUMAN && num_humans == 1 && LAST_MAN == 1)
   {
      local entity man;
      man = player_head;
      while(man)
      {
         if (man.classname == "player")
         {
            if (man.team == HUMAN)
            {
               LAST_MAN = 0;
               man.skin = P_SKIN;
               if (man.health > (man.max_health-50))   //Set the health correctly
               {
                  man.max_health -= 50;
                  man.health = man.max_health;
               }
               else
               {
                  man.max_health -= 50;
               }
               centerprint(man, "You are no longer last man");
            }
         }
         man = man._next;
      }
   }

   ClientInRankings(); // FrikBot
   num_clients += 1;

   bprint (self.netname);
   bprint (" entered the game\n");
};


/*
===========
ClientDisconnect

called when a player disconnects from a server
============
*/
void() ClientDisconnect =
{
   ClientDisconnected(); // FrikBot

   if (gameover)
      return;

   if (TEAMS > 0)   //Take away the Counted team player so teamplay doesn't get messed up
   {
      if (self.team == TEAM1)      //Or human
      {
         if (deathmatch == INFECTION)
         {
            num_humans -= 1;
            UpdateTagHUD(1);
         }
         else
            num_rteam -= 1;
      }
      else if (self.team == TEAM2)      //Or Zombie
      {
         if (deathmatch == INFECTION)
         {
            num_zombies -= 1;
            zombie_counter -= 1;
            UpdateTagHUD(0);
         }
         else
            num_bteam -= 1;
      }
   }


   // let everyone else know
   num_clients -= 1;

   bprint (self.netname);
   bprint (" left the game with ");
   bprint (ftos(self.frags));
   bprint (" frags\n");

   set_suicide_frame ();
};

If you need some translation of this just ask




Contemplating on how to fix problems...
http://augustine.forumotion.com

6 Re: i need some help.... on Fri Mar 22, 2013 8:07 pm

drmabuse1981

avatar
Commander
Commander
hey,

thanks for the reply Wink

im currently re-coding my little mod using a scratch qc, so i might also do team assignment different from the quake 1.06 code Wink

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum