Game Development Community

Communicating with other applications

by JW · in Torque Game Engine · 02/02/2005 (5:46 am) · 10 replies

I am a new user to TGE and was wondering how complex it would be to communicate messages / events from TGE to another C# application or vice-a-versa.

I had quickly looked at the available documentation but am not getting any straight pointers. You can call C++ game and engine code from the scripts and the game code can also be called into script but can the same concept be extended to other applications i.e. calling / passing information to and from other application.

Both the applications (TGE and C# application) will be running on the same standalone machine and does not require communicating on network.

Highly appreciate any help on the same. Thanks

#1
02/02/2005 (6:07 am)
I don't know how to do it myself, but I've heard examples of other people doing it. Someone refered to a Torque/Python interface as PyTorque. Apparently they were writing their game mostly in Python, with Python calling TorqueScript commands. I don't know how they did it, but search the forums and find out who so you can ask them.

A more common thing to do is just make a dll (in C# for example) and have Torque use the dll. That sort of thing is done all the time. It is no different doing this in Torque than in any other c++ app, so you don't need Torque specific documentation for it.
#2
02/02/2005 (8:14 am)
Also you can use any of the other windows inter process communication stuff

like SendMessage/PostMessage to the other app is probably the most simple
#3
02/02/2005 (11:44 am)
You can telnet into the server console on Torque and send/receive messages from there. It would be pretty simple to have an ActiveX/COM plugin that telnets in and reads/writes the appropriate information off the console. You can do some amazing things with this method.
#4
02/02/2005 (9:50 pm)
And since it's a local connection, it's comparable in speed/overhead to most IPC methods.
#5
02/03/2005 (1:43 am)
Telnet into the server console looks like a cool solution. Can you point me to some resources/articles, which further explain on how to connect to Server Console.

How is the server console configured to listen to a client request from another application i.e. configuring the port, username, pwd etc. ? (or am I on a wrong track!)

I did find a good resource "TorqueScript based custom chat client & server (http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5457)" but this seems to be a scripting client connecting to server. I still have to study this resource and hope it provides the required direction to start.

Thanks for the help. Any other pointers would be a life saver.
#6
02/03/2005 (3:22 pm)
Just put (without <>'s)

telnetSetParameters(<port #>, <read/write password>, <read only password>);

somewhere in your scripts (generally in the appropriate place in server/init.cs is a good place).
#7
02/13/2005 (11:36 pm)
1. Where can I find details(detailed documentation) on the Console Functions & Commands; I have searched the Online and Getting Started Documentation but without any success. (Is there a download version of documentation available?)

2. I had written the following line of code in server/init.cs, in function initServer():

telnetSetParameters(port 8000, "rwpassword", "rpassword");

- assuming that the last 2 arguments are any strings to be passed for password!

The following error is shown in the console:

>>> Advanced script error report. Line 121
>>> Some error context, with ## on sides of error halt:
telnetSetParameters(port 8000, ## ##"rwpassword", "rpassword");
#8
02/13/2005 (11:39 pm)
Remove the word "port" from the first parameter.

There is a relatively recent resource that is a windows help file (.chm) auto-generated from the script files themselves.
#9
02/13/2005 (11:40 pm)
Try

telnetSetParameters(8000, "rwpassword", "rpassword");
#10
02/13/2005 (11:48 pm)
Thanks people! you are life saver. might disturb you with some more questions on Telnet :-)