Adding chat box and other question
by Alexander B · in Torque Game Engine · 06/06/2008 (10:49 pm) · 14 replies
I am having a lot of trouble adding the chatbox in my game. I have copied over the .cs files of the chathud but it's not showing in my game. So can someone please tell me what to do.
Also how do i add an online feature so it's like a normal online game. Like you click a button then it says connecting and then you see other players and can chat.
Thanks in advance.
Also how do i add an online feature so it's like a normal online game. Like you click a button then it says connecting and then you see other players and can chat.
Thanks in advance.
#2
06/08/2008 (7:18 pm)
What type of chatbox are you trying to add? Torque comes with a fully functional chatbox already installed.
#3
06/10/2008 (11:16 pm)
The chat box in the starter.fps
#4
You'll be looking for:
chatHud.gui
chatHudBorderArray.png
Those are required for the chat hud to work in the game.
06/11/2008 (3:10 am)
Quote:I have copied over the .cs filesDid you copy the gui and image files? They are located in "client/ui"
You'll be looking for:
chatHud.gui
chatHudBorderArray.png
Those are required for the chat hud to work in the game.
#5
06/11/2008 (4:17 am)
I have done as you said mike but still no chat window.
#6
06/11/2008 (5:26 am)
Did you add exec lines for the cs files?
#7
There are several things you have to do to add it, but we need to know where you started, and where you are now.
06/11/2008 (4:26 pm)
Can you give us a rundown of exactly what you have done? It's really hard to help someone when there is so little information.There are several things you have to do to add it, but we need to know where you started, and where you are now.
#8
06/12/2008 (5:09 pm)
I made a new game. I copied over chathud.gui and chatHudBorderArray.png from starter.fps to my games client\ui I go into my game and there is no chatbox. What have i done wrong?
#9
In client/scripts, there is a cs file that you need called chathud.cs. You need to copy it and init it in client/init.cs as well.
06/13/2008 (1:38 pm)
In client/init.cs, are you execing the chathud.gui?In client/scripts, there is a cs file that you need called chathud.cs. You need to copy it and init it in client/init.cs as well.
#10
06/13/2008 (3:17 pm)
How do i do that?
#11
Then, in your client folder, find init.cs and open it.
Find this block of code and add your gui to it (like it is here)
Further down, find // Client scripts
and add the ChatHud.cs there like this:
Exec'ing a file causes torque to compile it into a cs.dso file for use in your game. Without this step, torque doesn't know it exists.
06/13/2008 (3:29 pm)
Open the client/scripts folder in the starter.fps demo and copy over the chatHud.cs and messageHud.cs files to your client/scripts folder.Then, in your client folder, find init.cs and open it.
Find this block of code and add your gui to it (like it is here)
// Load up the Game GUIs
exec("./ui/defaultGameProfiles.cs");
exec("./ui/PlayGui.gui");
exec("./ui/ChatHud.gui"); // You have to add the ChatHud.gui here.
exec("./ui/playerList.gui");Further down, find // Client scripts
and add the ChatHud.cs there like this:
exec("./scripts/loadingGui.cs");
exec("./scripts/optionsDlg.cs");
exec("./scripts/chatHud.cs"); // your chatHud.cs is exec'd here
exec("./scripts/messageHud.cs"); // You need this as well or you won't be able to type any chat messages
exec("./scripts/playGui.cs");Once you have copied the files and exec'd them, you should have your chatbox. Exec'ing a file causes torque to compile it into a cs.dso file for use in your game. Without this step, torque doesn't know it exists.
#12
// Load up the shell and game GUIs
exec("./client/ui/PlayGui.gui");
exec("./client/ui/GetToTheTopScreen.gui");
exec("./client/ui/optionsDlg.gui");
exec("./client/ui/loadingGui.gui");
exec("./client/ui/ggSplash.gui");
exec("./client/ui/ChatHud.gui");
exec("./client/ui/logoSplash.gui");
// Client scripts
exec("./client/optionsDlg.cs");
exec("./client/missionDownload.cs");
exec("./client/serverConnection.cs");
exec("./client/chatHud.cs");
exec("./client/loadingGui.cs");
exec("./client/messageHud.cs");
exec("./client/playGui.cs");
exec("./client/splashScreen.cs");
06/14/2008 (11:29 pm)
Ok i have done as you said but still no chatbox. Have a look at what i have put in. Oh and i don't have a scripts folder. All my scripts are in my client folder.// Load up the shell and game GUIs
exec("./client/ui/PlayGui.gui");
exec("./client/ui/GetToTheTopScreen.gui");
exec("./client/ui/optionsDlg.gui");
exec("./client/ui/loadingGui.gui");
exec("./client/ui/ggSplash.gui");
exec("./client/ui/ChatHud.gui");
exec("./client/ui/logoSplash.gui");
// Client scripts
exec("./client/optionsDlg.cs");
exec("./client/missionDownload.cs");
exec("./client/serverConnection.cs");
exec("./client/chatHud.cs");
exec("./client/loadingGui.cs");
exec("./client/messageHud.cs");
exec("./client/playGui.cs");
exec("./client/splashScreen.cs");
#13
06/15/2008 (5:50 am)
You seem to have everything you need. The only thing left I can suggest is to compare your playGui.gui to the starter.fps playGui.gui to see if there are any differences. Aside from that, I don't know.
#14
06/15/2008 (6:18 am)
You need to attach the message box to play gui look at playGui::onwake()
Torque Owner Alexander B