Game Development Community

EDIT: Thread closed

by Tyler Slabinski · in Technical Issues · 08/25/2007 (9:33 pm) · 8 replies

I know that TorqueScript is based off of C++ language. But is it possible to use C++ instead? Here's an example:

Almost everyone knows of the famous "Hello world!" script. So, in TorqueScript you use the following line:

echo ("blah blah blah");
Ok so it's not exactly that way you type it but you get the point.

Can I do this instead?

cout << "Blah blah blah";
or do I need to use the other one?

#1
08/25/2007 (10:26 pm)
Con::printf("bleh");

Stdlib like string formatting is supported (%d, %s, %x...).
#2
08/26/2007 (12:05 am)
What the??? What are you saying? I'm just asking for a yes or no answer. What does that mean?
#3
08/26/2007 (7:00 am)
Quote:I'm just asking for a yes or no answer.

Without owning Torque the answer is no.
#4
08/26/2007 (7:10 am)
When asking "can I?" if you have the source the answer is always "Yes" or "If your talents allows." As far as the particular question you are asking, I am not sure what you are really asking. Its not very clear in my mind.

As a result I will answer a couple of different question in hopes that one was what you were asking.

#1 - Can I use straight C++ in the Torque Script Files (CS) instead of TorqueScript syntax?
Answer = Not out of the box. Sure you could but it would involve re-writing the TorqueScript to be C++ compliant. A waste of time in my mind. TorqueScript only has "C like" syntax. It is not a stripped down version of a C compiler.

#2 - Can I skip using TorqueScript files (.cs) and just code everything in the Engine?
Answer - Yes - But would you want to?

There have been several threads on this already. For example Topic: If I don't use script...

Also further question regarding the Engine Source should be placed in the Private SDK forums.
#5
09/15/2007 (11:58 am)
He's just asking if it's possible to script in c++ instead of torque script (i wouldn't).
#6
09/16/2007 (8:25 am)
If you're using C++ with the engine, you're not really scripting...unless you write your own c++ compiler for C++ scripts. Which would be like Quake-C but not as intuitive.
#7
09/16/2007 (10:31 am)
No, you can't use C++.
#8
09/16/2007 (12:35 pm)
Ok thread closed last week.