team spawnpoints

Discuss programming in the QuakeC language.
Post Reply
pud
Posts: 5
Joined: Fri Jun 17, 2005 3:05 pm

team spawnpoints

Post by pud »

NOTE: I posted this at quakesrc already, but I figured a forum of qc coders could answer my question better. I apologize to anyway who's seen this twice now!

okay, having some trouble with spawning a player at a team specific spawnpoint. I want the player to enter the server and appear at a regular spawnpoint, then select a team from an centerprint/impulse menu, then spawn for real at a team specific spawnpoint. teamfortress i know does this. lots of ctf mods probably do too. here's how i'm doing it and its not working:

in PutClientInServer, I leave the spawn code unchanged, but set the player to MOVETYPE_NONE, SOLID_NOT, and DAMAGE_NO. I have tried lots of movetype/solid combinations, as well as setting model to "" (both ways). Also in PutClientInServer I set a timer, self.menutime to time + 3. In PlayerPreThink, I check the timer and if its been three seconds I do the centerprint, but only if self.loyal is true (loyal as in they are loyal to a side, so if they haven't picked a team its false, putclientinserver sets this false on spawn.)

In ImpulseCommands I have this code: (and everything else is commented out)

Code: Select all

if (self.loyal == FALSE)
      {
      if (self.impulse == 1)
         {
         self.team = 1;
         self.loyal = TRUE;
         
         spot = find (world, classname, "info_team1_start");         
         setorigin(self, spot.origin);
         self.angles = spot.angles;
         }
   
      if (self.impulse == 2)
         {
         self.team = 2;
         self.loyal = TRUE;
         
         spot = find (world, classname, "info_team2_start");
         setorigin(self, spot.origin);
         self.angles = spot.angles;
         }
      }
when I enter the server, the info_player_start is high from the ground (in my test map) and I hear grunting as if I had fallen to the grounf, but I haven't. I stay at the player_start. Then when I select a team, the menu goes away, and I can shoot. (w_attack is set up to return if self.loyal == false) The shooting doesn't come from me though, it comes from the place where I want to be, the info_team1_start! has anyone had this problem before?
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Post by Dr. Shadowborg »

This is a fairly complex subject.

Basically, I recommend you instead modify selectspawnpoint() to figure out where you're supposed to go, and modify respawn() as well, and just use respawn() to place the player.
r00k
Posts: 1111
Joined: Sat Nov 13, 2004 10:39 pm

Post by r00k »

ok for ctf, team spawn points are predetermined in the map, by
info_player_team1 or info_player_team2. These are included in the bsp. I'd suggest the point that u use for spawns prior to team choice be info_player_deathmatch or info_player_start (if its an id map).
If you only need 2 teams just download 3wave 4.2 and convert the id maps yourself, and use the teamspawns there?

edit: and yes this would require changing entity () SelectSpawnPoint
Post Reply