Accessing Variables
by Diego Castaneda · in Torque 3D Professional · 07/10/2009 (12:30 pm) · 4 replies
in my game, i want to acces to variables from an other program like Borland C++, and i have to write over them or take the value they already have. does Torque 3D have an index for his variables or something that can help me do this in my game?,like a direction on memory or something?
About the author
#2
From there on, you can read and write this variable from within TorqueScript.
Be careful to use the correct console type (look in console/consoleTypes.h).
//Edit: parallel post, but just noticed that my post is nonsense as you obviously meant crossing process borders here. Listen to Manoel.
07/10/2009 (2:00 pm)
You can expose variables from C++ using Con::addVariable like soCon::addVariable( "foobar", TypeBool, &myBoolVariable );
From there on, you can read and write this variable from within TorqueScript.
Be careful to use the correct console type (look in console/consoleTypes.h).
//Edit: parallel post, but just noticed that my post is nonsense as you obviously meant crossing process borders here. Listen to Manoel.
#3
07/13/2009 (11:47 pm)
You could also make use of the telnet interface to the console system (Torsion and other TorqueScript IDE's use this for debugging for example).
#4
thanks for the help
07/18/2009 (2:50 pm)
thanks guys for the help, i solved it writing the value of the variable in a txt file from borland, and then reading the txt file from torque and asigning the value to the variable i wanted in this case the value that you send to the function yaw and pitch.thanks for the help
Associate Manoel Neto
Default Studio Name
I believe there are better ways for communicating between two programs on the same machine. I got two torque applications to talk in the same machine using the TCPObject, but you could use a lower level socket or something.