Game Development Community

SpawnSphere Question

by John Eric Miller · in Torque Game Engine · 04/14/2003 (7:42 am) · 4 replies

Is there a way to uniquely identify a specific spawn sphere in a mission? I want be able to specify which spawn sphere is used to spawn the player when a mission loads instead of randomly selecting it. Is this possible?

Thanks!

#1
04/14/2003 (9:46 am)
yup name it.
and modify the code to first grab the group.
then parse out the properly named point and use it.
#2
04/14/2003 (2:04 pm)
How do I name it? Is there a property for this? Or do I need to add this to the datablock? Is the name something I can change when I place the spawn sphere in the mission?

Thanks for your help!
#3
04/14/2003 (2:21 pm)
Open the editor, and select the spawnshpere.
Look to the right of the Apply button. There is an editfield.
Enter a name for the sphere, eg: PrimarySpawn.
Hit the Apply button.
Go to the File menu, choose Save or Save As... to save the change.

Now you can refer to that object by name, in scripts:
function pickSpawnPoint()
{ 
 %mat = PrimarySpawn.getTransform();
 return %mat;
}


fyi, that process sets the .name property of the object. Also usable by obj.setName("foobar") .
#4
04/14/2003 (2:42 pm)
Ok, but is there a way to loop through the spawnsphere group and based on which spawnsphere name I pass, it will use its location to spawn the player? Is there a obj.getName() or obj.Name? I need to be able to pass the sphere name then have it loop through the group to find which Spawn sphere to use.

Let me explain why I want to do this. I want to be able to create a trigger that is used to "zone" the player to another mission and place him at a specific point in that mission without hardcoding it. I want to be able to go into "mission1" and add a zone trigger. This zone trigger will define which mission to zone to and which spawn sphere to use in the destination mission. In this case "mission2" . I could then place a spawn sphere in "mission2" with the name I defined in the zone trigger in "mission1". I hope this makes sense:) I appreciate your help.