Game Development Community

-connect :

by Pauliver · in Torque Game Engine · 03/23/2005 (4:05 pm) · 10 replies

I'm playing around with directly launching torque into a server.. its done in torque script and its included in main.cs within the folder starter.fps the code snippet is

case "-connect":
$argUsed[%i]++;
if (%hasNextArg) {
$JoinGameAddress = %nextArg;
$argUsed[%i+1]++;
%i++;
}
else
error("Error: Missing Command Line argument. Usage: -connect ");


did i break something? or is it naturally broken?

#1
04/02/2005 (1:59 pm)
I don't understand what your situation is... is something not working properly?
#2
04/07/2005 (7:28 pm)
Our problem is that the client starts fine when using this, but the mission doesn't actually load, even though the server is up. No apparent errors.
#3
04/07/2005 (7:30 pm)
The problem is that when you call "torquedemo.exe -connect :"
it doesn't connect and i dont know where to start, because im not sure where its broke.
#4
04/08/2005 (6:13 am)
Quote:The problem is that when you call "torquedemo.exe -connect :"
it doesn't connect and i dont know where to start, because im not sure where its broke.

It's not broken, it just doesn't do what you think it does :)

-connect isn't used to bypass everything and jump right to setting up the connection, it's simply used to override the (default/hardcoded) $JoinGameAddress.

It's not going to do anything different than starting the game without the argument, except that if you use connect(), your $JoinGameAddress wil be what was supplied at the command line.
#5
04/09/2005 (8:32 pm)
Awsome, thanks :)
this settles why i was soo confused about it, (i remember that in tribes 2 it launched right to the server... so i just made the jump that t2 did it, and torque had it, so torque should work like t2... )

thanks for your help
#6
04/10/2005 (7:34 pm)
Is there a way to set up that connection so that we can automatically load the mission being hosted by the server, or am I missing something (I suspect I am)?
#7
04/10/2005 (9:40 pm)
My plan was to check what functions were called when you click the connect button [in the screen after it pings the master server and gets all of the servers] I was just going to figure out what functions that button click calls, and then place a call to that in there somwhere...

The plan sounds solid, however my knowledge of torque Script is minimal.
#8
04/10/2005 (9:49 pm)
You could edit the scripts to ...
Canvas.setContent(startMissionGui);

Instead of having it load the mainmenugui.gui file.
#9
04/11/2005 (5:10 am)
Quote:Is there a way to set up that connection so that we can automatically load the mission being hosted by the server, or am I missing something (I suspect I am)?

By definition it does (when you connect to a dedicated/remote server). Think about how the demo works when you query for other servers--while you get the opportunity to select which server you want to connect to, you don't get the option of picking a mission--the remote connect() automatically uses the mission the server tells it to.

If you remove the player's capability to choose which server to connect to, and have it auto-connect to a pre-set server address, the apparent "choice" about the mission will go away as well.
#10
04/12/2005 (4:42 am)
That clears things up quite a bit. :)