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 !
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 !
#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

Step 2:Then you Alt + Left Click on the PlayerDropPoints SimGroup, it should turn gray like this

Step3: Now go to World -> Add Selection to Instant Group

then it should be added like this :)

(Note: if you Alt + Left Click a group, when you add a new object it will already be in that group)
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)Step 2:Then you Alt + Left Click on the PlayerDropPoints SimGroup, it should turn gray like this
Step3: Now go to World -> Add Selection to Instant Group
then it should be added like this :)
(Note: if you Alt + Left Click a group, when you add a new object it will already be in that group)
#5
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
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 SimGroupfunction 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
Torque Owner Stefan Lundmark
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.