Adding a "join" button back to the GUI?
by Rick Austinson · in Torque 3D Professional · 12/30/2013 (10:41 pm) · 12 replies
So I have an interesting problem, and I need this working again fairly soon. I'm using the 3D Action Adventure Kit(quite a lovely piece). Now, it still has the option to host a network game and it appears to be running a server(my network-monitoring tools certainly thinks so). But there is no option to JOIN on another machine.
I believe the capability is still there, its just the required buttons have been removed from the UI. I've opened up the GUI editor but its not immediately obvious. All the documentation seems to assume you're starting with the FPS tutorial as a base and already have that button, so I'm at a loss.
EDIT:
Ok, to save future generations scrolling through this thread, here's what we figured out:
I did also figure out how to add it back. Well when I say "I figured out" I should clarify that someone else told me. But I'm going to post all the steps here anyway for posterity.
Step 1. Open the GUI editor and make a new button. I did this by copying and pasting an existing button and changing the name. Then you have to find the Command field for the button and change it to
Step 2. you will need to find the associated script file. The easiest way to get it is to download the Torque 3D FPS tutorial(if you haven't already) find the file JoinServerDlg.gui in the folder game/art/gui and move it to the same folder on your game.
Step 3. In Torsion, open the scripts/client/init.cs. Down somewhere between lines 70 and 90(it moves around a bit) you'll find a section with the comment // Load up the shell GUIs. Under that section add the line:
That should be all it takes. Credit goes to Richard Randft for figuring most of this out.
EDIT II:
Also, courtesy of the 3DAAK forums apparently without modifying your client at all you can join a network game with the following console command:
--------------------------------------------------------------------------------
connect(serverIP);
--------------------------------------------------------------------------------
You can find a computer's IP by opeing commandline and typing ipconfig. Alternatly if you know a remote PCs network name you can find the IP by going into command prompt and typing ping <computer name>.
Hopefully that should clear everything up and the next person seeking this information will have an easier time.
I believe the capability is still there, its just the required buttons have been removed from the UI. I've opened up the GUI editor but its not immediately obvious. All the documentation seems to assume you're starting with the FPS tutorial as a base and already have that button, so I'm at a loss.
EDIT:
Ok, to save future generations scrolling through this thread, here's what we figured out:
I did also figure out how to add it back. Well when I say "I figured out" I should clarify that someone else told me. But I'm going to post all the steps here anyway for posterity.
Step 1. Open the GUI editor and make a new button. I did this by copying and pasting an existing button and changing the name. Then you have to find the Command field for the button and change it to
Canvas.pushDialog(JoinServerDlg);
Step 2. you will need to find the associated script file. The easiest way to get it is to download the Torque 3D FPS tutorial(if you haven't already) find the file JoinServerDlg.gui in the folder game/art/gui and move it to the same folder on your game.
Step 3. In Torsion, open the scripts/client/init.cs. Down somewhere between lines 70 and 90(it moves around a bit) you'll find a section with the comment // Load up the shell GUIs. Under that section add the line:
exec("art/gui/joinServerDlg.gui");That should be all it takes. Credit goes to Richard Randft for figuring most of this out.
EDIT II:
Also, courtesy of the 3DAAK forums apparently without modifying your client at all you can join a network game with the following console command:
--------------------------------------------------------------------------------
connect(serverIP);
--------------------------------------------------------------------------------
You can find a computer's IP by opeing commandline and typing ipconfig. Alternatly if you know a remote PCs network name you can find the IP by going into command prompt and typing ping <computer name>.
Hopefully that should clear everything up and the next person seeking this information will have an easier time.
#2
Basically there is no error, just nothing happens when I click on my shiny new Join button.
Thanks! I think I'm on the right track.
12/31/2013 (5:27 pm)
What scripts are associated with JoinServerDlg? I copied that over(it is missing) but I can't tell what else needs to go with it.Basically there is no error, just nothing happens when I click on my shiny new Join button.
Thanks! I think I'm on the right track.
#3
12/31/2013 (7:29 pm)
Look inside the JoinServerDlg.gui, at the end of the file. The .gui files are actually just scripts.
#4
Unfortunately, despite all my futzing... nothing is happening. Maybe I'm wrong and the 3DAAK file doesn't actually have a running server?
12/31/2013 (9:24 pm)
Well, first thing I discovered: joinServerDlg.gui had a lower-case J, so I fixed that. Opening the file in Torsion revealed the entire file was commented out. I removed the commenting, and sifted through it looking for files. I also compared the two directories(from the FPS game and my game) and found a few other differences that concerned me, among them a "host" file, haha.Unfortunately, despite all my futzing... nothing is happening. Maybe I'm wrong and the 3DAAK file doesn't actually have a running server?
#5
You have to start a server to join one.
On the other hand, you should still be seeing a dialog that allows you to attempt to find and join a server when you click the Join button on the main menu.
01/01/2014 (12:43 am)
Time out.You have to start a server to join one.
On the other hand, you should still be seeing a dialog that allows you to attempt to find and join a server when you click the Join button on the main menu.
#6
copy the latest game folder to the other machine. Start it up checking the "host" box. Wait for it to load fully, take a few steps on the character. Then launch the other client and hit Join.
This is where nothing happens. Of course nothing happens anyway, no dialogue, just a button-push animation.
01/01/2014 (2:03 pm)
I have a server running on another computer on the network. My testing procedure is as follows:copy the latest game folder to the other machine. Start it up checking the "host" box. Wait for it to load fully, take a few steps on the character. Then launch the other client and hit Join.
This is where nothing happens. Of course nothing happens anyway, no dialogue, just a button-push animation.
#7
Time to learn some debugging skills.....
01/01/2014 (10:26 pm)
And the JoinServerDlg.gui file is being loaded? And the Command field of the button contains the code shown above? And the console doesn't show any errors?Time to learn some debugging skills.....
#8
When I push the join button I get:
pushDialog(): Invalid control: JoinServerDlg
Same error shows up both on the console and in the output window on torsion.
I honestly cannot tell which, if any scripts are being loaded. Apparently I am a lot worse at debugging than I thought, haha.
01/08/2014 (3:40 pm)
Oops, sorry, was hoping to get through this without needing to load Torsion. Now running the game in there.When I push the join button I get:
pushDialog(): Invalid control: JoinServerDlg
Same error shows up both on the console and in the output window on torsion.
I honestly cannot tell which, if any scripts are being loaded. Apparently I am a lot worse at debugging than I thought, haha.
#9
If you're using Torsion, use Ctrl-f to search the project for JoinServerDlg.gui - if you don't see it, it's not being exec'd.
If this is the case, open scripts/client/init.cs and around line 70 you should see the "shell gui" scripts being loaded. Add
01/08/2014 (4:45 pm)
Then that file isn't being loaded.If you're using Torsion, use Ctrl-f to search the project for JoinServerDlg.gui - if you don't see it, it's not being exec'd.
If this is the case, open scripts/client/init.cs and around line 70 you should see the "shell gui" scripts being loaded. Add
exec("art/gui/joinServerDlg.gui");in there and see if that works.
#10
Thank you again for your help.
01/08/2014 (5:56 pm)
That did the trick! Thank you so much! It seems to be as simple as adding the joinServerDlg.gui file and then making the script change. I am going to repeat the process later and create a complete tutorial in case anyone else gets stuck where I am.Thank you again for your help.
#11
01/08/2014 (9:15 pm)
The real question is this: Is the 3D AAK set up to handle multiplayer games? If so, you're in luck. If not, you have some work ahead....
#12
01/08/2014 (10:04 pm)
They never took out the server mode, just removed the join button and associated scripts. I was able to get it up and running with 2 players, then later joined a dedicated server I'd started up a few days ago. It certainly has the capability, its even discussed on the 3DAAK forums. It is a bit glitchy but it will work plenty well enough for my purposes.
Torque Owner Richard Ranft
Roostertail Games
Ensure that the JoinServerDlg and its associated scripts are present - if not, copy them from a FPS project.