two spawns
by Gary Roberson · in Torque Game Engine · 11/05/2011 (1:56 am) · 3 replies
I have 2 spawn markers by design.
I want to give the player a choice on where to start a mission
Which file do I place the code in
I want to give the player a choice on where to start a mission
Which file do I place the code in
About the author
#2
Thanks Mike. Let me describe my situation.
When I used 1 Spawnsphere, which was alright, the system was set to use that location to place the player in as it was the only sphere. When I placed the 2nd sphere, the system used that one instead, and not the first. When I looked at the code, Torque's coding structure is different enough from C++ to confuse me as to which keyword to look for when setting up these locations.
11/30/2011 (11:10 am)
@Michael,Thanks Mike. Let me describe my situation.
When I used 1 Spawnsphere, which was alright, the system was set to use that location to place the player in as it was the only sphere. When I placed the 2nd sphere, the system used that one instead, and not the first. When I looked at the code, Torque's coding structure is different enough from C++ to confuse me as to which keyword to look for when setting up these locations.
#3
1. Spawn the player as an observer in a default location, and send a commandToClient telling them to display the 'pick spawn' GUI.
2. Client picks a spawn point from the GUI, which sends a commandToServer telling it to spawn at a certain location.
3. Server spawns a player as usual, but looks up the location based on the client's preference.
12/02/2011 (8:13 am)
By default, Torque is set up to choose a random spawn sphere from within a certain group, if I remember right. The code should be towards the end of game.cs. To enable the player to choose, I'd do something like-1. Spawn the player as an observer in a default location, and send a commandToClient telling them to display the 'pick spawn' GUI.
2. Client picks a spawn point from the GUI, which sends a commandToServer telling it to spawn at a certain location.
3. Server spawns a player as usual, but looks up the location based on the client's preference.
Associate Michael Hall
Distracted...
Most likely since you'll be dealing with the spawns you'll need to replace/modify the existing spawn function... which for TGE was in game.cs if I recall correctly. I'm assuming that you'll be pushing a gui with the choice of location as buttons or some sort of selection control - just group this GUI script file with the others and make sure it gets exec'd with those as well - I think the GUI's are exec'd from the client/init.cs scripts.