Find a specific spawn point?..
by Jan Sorensen · in Torque Game Engine · 08/03/2008 (12:55 am) · 7 replies
Hi here. Question move from "General Discussion" :-).
Hope for a good hint with TGE.
Question:
Is it possible to make it so, the player spawns on a specific spawn point among a number of other, when he login to a server. Is there a kind of an "addressing method" to the spawn point in the server call?
Example from a "Server shift trigger" in a .mis file:
serverIp = "100.200.300.14:28000 >Something maybe here, name/number or ???<";
Jan :-).
Hope for a good hint with TGE.
Question:
Is it possible to make it so, the player spawns on a specific spawn point among a number of other, when he login to a server. Is there a kind of an "addressing method" to the spawn point in the server call?
Example from a "Server shift trigger" in a .mis file:
serverIp = "100.200.300.14:28000 >Something maybe here, name/number or ???<";
Jan :-).
About the author
My 'little hobby project': http://www.virtuchat.com/
#2
Teams Resource
08/03/2008 (8:59 am)
I'm not sure exactly what you are trying to do, but this might help you. Pay attention to the spawn code and how it allows players to spawn at their own team's spawn points.Teams Resource
#3
I will try to explain the idea (my idea) behind my addressable spawn points. I hope I do it in understandable English :-).
Example:
You stand in front of a door; in the door is there a server shift trigger to another "Zone / Server". You go into the door, shift server and show up in the new zone with "a copy" of the door behind you.
You do something in the new zone and will go back again. You go back to the door (still in the new zone) and a trigger there brings you back to the old zone and you show up there with the door behind you, that door you go into from the start. There must of cause be a kind of space between your spawn point and your trigger, so you don't "go in orbit" between the two Zones :-D.
The problem is (if you have more than one "server shift door / gate in a Zone), to find the right door to go back to, maybe there are many "miles" between the doors. Therefore a common or a sim group of spawn points don't do it, you must have the possibility to choose the right spawn point under the server call, therefore I look for a addressing method (or something like this) to a specific spawn point in a Zone.
I hope there is "parameter space" for an extra parameter in the server call line?
Jan :-).
08/04/2008 (12:23 am)
Hi and thanks for answers :-).I will try to explain the idea (my idea) behind my addressable spawn points. I hope I do it in understandable English :-).
Example:
You stand in front of a door; in the door is there a server shift trigger to another "Zone / Server". You go into the door, shift server and show up in the new zone with "a copy" of the door behind you.
You do something in the new zone and will go back again. You go back to the door (still in the new zone) and a trigger there brings you back to the old zone and you show up there with the door behind you, that door you go into from the start. There must of cause be a kind of space between your spawn point and your trigger, so you don't "go in orbit" between the two Zones :-D.
The problem is (if you have more than one "server shift door / gate in a Zone), to find the right door to go back to, maybe there are many "miles" between the doors. Therefore a common or a sim group of spawn points don't do it, you must have the possibility to choose the right spawn point under the server call, therefore I look for a addressing method (or something like this) to a specific spawn point in a Zone.
I hope there is "parameter space" for an extra parameter in the server call line?
Jan :-).
#4
then in \common\server
clientConnection.cs
find
and change it to:
Scroll down in this function and then add your destination to the client somewhere like:
Then change your spawning code to use %client.destination something like this:
I haven't tested this code but it should get you close to what you want to do.
08/04/2008 (6:52 am)
Add something like this to each trigger.%destination = "0 0 300 1 0 0 0"(wherever you want the player to spawn); %conn.setConnectArgs($pref::Player::Name, %destination);
then in \common\server
clientConnection.cs
find
//----------------------------------------------------------------------------- // This script function is the first called on a client accept // function GameConnection::onConnect( %client, %name )
and change it to:
function GameConnection::onConnect( %client, %name, [b]%destination[/b])
{Scroll down in this function and then add your destination to the client somewhere like:
// Save client preferences on the connection object for later use. %client.gender = "Male"; %client.armor = "Light"; %client.race = "Human"; %client.skin = addTaggedString( "base" ); %client.setPlayerName(%name); %client.score = 0; [b]%client.destination = %destination;[/b] }
Then change your spawning code to use %client.destination something like this:
function GameConnection::spawnPlayer(%this)
{
// Combination create player and drop him somewhere
%spawnPoint = [b]%this.destination[/b];
%this.createPlayer(%spawnPoint);
}I haven't tested this code but it should get you close to what you want to do.
#5
Its looks very exciting, I think this is very close to the solution. I will work on it and come back with a "rapport".
Thanks, Jan :-).
08/04/2008 (12:36 pm)
Hi Bruce and thanks for answers :-).Its looks very exciting, I think this is very close to the solution. I will work on it and come back with a "rapport".
Thanks, Jan :-).
#6
We have made our version on basic of your script proposal and its works very fine.
I will not bring our solution here, because we have made many modifications in our system and I think therefore, it wills "confusing people".
It was necessary for us to make modifications in "clientConnection.cs", ServerConnection.cs, client/scripts/game.cs, server/scripts/game.cs and Triggers.cs. The addressing of a Spawn point are now only based on a "name call" in the trigger (spawnPoint = "Name"), simply, :-D.
Thanks for help, Jan :-).
08/06/2008 (2:14 am)
Hi Bruce :-).We have made our version on basic of your script proposal and its works very fine.
I will not bring our solution here, because we have made many modifications in our system and I think therefore, it wills "confusing people".
It was necessary for us to make modifications in "clientConnection.cs", ServerConnection.cs, client/scripts/game.cs, server/scripts/game.cs and Triggers.cs. The addressing of a Spawn point are now only based on a "name call" in the trigger (spawnPoint = "Name"), simply, :-D.
Thanks for help, Jan :-).
#7
08/06/2008 (8:41 am)
You are welcome, I am happy you got it working.
Torque Owner Mike Rowley
Mike Rowley