misc > " spawnspheremarker", but it's not a start, because I fall, I sink ... Sorry for my language ! I am a young french ! ;-) Thanks !"> No start for my player ? | Torque Game Engine | Forums | Community | GarageGames.com

Game Development Community

No start for my player ?

by Lecourtier Benoit · in Torque Game Engine · 06/26/2005 (6:13 am) · 5 replies

Hello !

I have a new map.
I want a point to start my player.

I create a " spawnSphereMarker" > misc > " spawnspheremarker",
but it's not a start, because I fall, I sink ...

Sorry for my language ! I am a young french ! ;-)

Thanks !

#1
06/26/2005 (6:27 am)
You need to make it a child of the SpawnGroup.

The spawngroup is used in game.cs (server) when selecting a coordinate to spawn the player on, and is randomly chosen between all the available spawnmarkers.
#2
06/27/2005 (8:29 am)
.
#3
06/27/2005 (9:07 am)
Well, by default whenever you start a new mission, you start with a spawnsphere. Did you delete yours or something? Anyway, you have to make it a child of the spawngroup that was said earlier. Now, I think you can do this in the .mis file.
#4
06/27/2005 (9:59 am)
Step 1: Ok first you add it to your new mission, it will add to the end like this (and select it)

www.razedskyz.com/games/torque/tutorials/spawn/spawn1.JPG
Step 2:Then you Alt + Left Click on the PlayerDropPoints SimGroup, it should turn gray like this

www.razedskyz.com/games/torque/tutorials/spawn/spawn2.JPG
Step3: Now go to World -> Add Selection to Instant Group

www.razedskyz.com/games/torque/tutorials/spawn/spawn3.JPG
then it should be added like this :)

www.razedskyz.com/games/torque/tutorials/spawn/spawn4.JPG
(Note: if you Alt + Left Click a group, when you add a new object it will already be in that group)
#5
06/27/2005 (10:02 am)
In game.cs this is the function that chooses the spawnpoint ... it chooses a random point out of the PlayerDropPoints SimGroup


function pickSpawnPoint() 
{
   %groupName = "MissionGroup/PlayerDropPoints";
   %group = nameToID(%groupName);

   if (%group != -1) {
      %count = %group.getCount();
      if (%count != 0) {
         %index = getRandom(%count-1);
         %spawn = %group.getObject(%index);
         return %spawn.getTransform();
      }
      else
         error("No spawn points found in " @ %groupName);
   }
   else
      error("Missing spawn points group " @ %groupName);

   // Could be no spawn points, in which case we'll stick the
   // player at the center of the world.
   return "0 0 300 1 0 0 0";
}

You can change this :)... an easy way to make a save position system is to have the spawn sphere be referenced to a variable and you set that variable at some sort of "load" screen