Going from C++ to Torque Script?
by Ozi · in Torque 2D Beginner · 06/23/2013 (5:32 pm) · 6 replies
Well, I've gotten a pretty awesome understanding of C++. I've made a few programs lately and now I think I'm finally ready to make a simple 2D game, though, since it will be my first, I want to use an engine, and Torque seems like the best right now.
The only issue is I don't think Torque really uses C++. I'm willing to learn TorqueScript, I just want to know what the learning curve is if I already have C++ understanding down pact (most of it, I know classes, arrays, objects, functions, etc.)
The only issue is I don't think Torque really uses C++. I'm willing to learn TorqueScript, I just want to know what the learning curve is if I already have C++ understanding down pact (most of it, I know classes, arrays, objects, functions, etc.)
#2
Most of the things you want to do are done through scripts. TorqueScript is more like C than C++, really. You should do fine. If you look at the existing scripts and follow along you should be able to pick it up quickly.
06/23/2013 (6:00 pm)
Of course Torque uses C++. It's written in C++.Most of the things you want to do are done through scripts. TorqueScript is more like C than C++, really. You should do fine. If you look at the existing scripts and follow along you should be able to pick it up quickly.
#3
Still, you can write your game play in C++. You simply need to know where to inject your code.
06/24/2013 (4:59 am)
Like Simon and Richard, I encourage you to take a look at TorqueScript. It's quite easy to pick up, especially if you are experienced in C++. The scripting language is C-like in nature, though not entirely. We have some extensive guides on TorqueScript that will help.Still, you can write your game play in C++. You simply need to know where to inject your code.
#4
Also, where would I start to gain an understanding of TS and how to use C++ in Torque? Thanks for the replies guys. I honestly didn't know that ++ and Torque were so much alike.
06/24/2013 (8:12 am)
So what would be more beneficial for me? Mostly C++, mosty TS, or a bit of both?Also, where would I start to gain an understanding of TS and how to use C++ in Torque? Thanks for the replies guys. I honestly didn't know that ++ and Torque were so much alike.
#5
As Simon pointed out, check out the Torque 2D Wiki. On that page, there are four very useful links: TorqueScript Overview, TorqueScript Syntax, Scripting Tutorial, and Behavior Tutorial.
06/24/2013 (8:22 am)
Due to Torque 2D's architecture, I would say mix the two evenly. Use C++ to add new functionality, use TorqueScript to build your levels and game play.As Simon pointed out, check out the Torque 2D Wiki. On that page, there are four very useful links: TorqueScript Overview, TorqueScript Syntax, Scripting Tutorial, and Behavior Tutorial.
#6
I'll check it out right now, really can't wait to get started, heard some great things about Torque 2D's engine.
@Simon
Thanks for the tip man! They really are similar, I can probably pick this up quickly. xD
06/24/2013 (8:34 am)
@MichaelI'll check it out right now, really can't wait to get started, heard some great things about Torque 2D's engine.
@Simon
Thanks for the tip man! They really are similar, I can probably pick this up quickly. xD
Associate Simon Love
If you look at The official Torque2d repository, you'll find the C++ engine, ready to compile with your favorite compiler.
Any function accessible from TorqueScript is defined in a ConsoleFunction or ConsoleMethod, which you will find in files which end in _ScriptBinding.h.
For all script functions related to the SceneObject, for instance, you'd look in SceneObject_Scriptbinding.h.
Take a look at thewiki for a quick rundown of how TorqueScript works.
If you're strong in C++, you should have no problem leveraging the engine's scripting system.