Game Development Community

Scripting in Torque

by Marcel Boule · in Torque Game Engine · 02/15/2006 (11:57 am) · 3 replies

Just bought the TGE and reading the doc.

Not being a C++ developper, I wanted to try a few things in scripting.

For instance I wanted to change the third person camera for it to be at a fixed height, and independant from the player rotation.
I've found some example in C++, but could'nt find anything in script. Is it possible ?

I would have also liked to change the player model on the fly, like mutating from a man to a spider.

I also wanted to do a point and click kind of ergonomy.

And animate the gui (moving buttons from one position to another, chasing or running away from the cursor).

Do I have to go into C++ or is it possible in scripting ?

If it is, are the docs in
http://www.garagegames.com/developer/torque/tge/
all we have ?

Thx in advance

#1
02/15/2006 (3:29 pm)
@Marcel: Have you tried a search in TDN?

You can script lots of things in Torque. Scripting is used to test things then transfer it into C++ if you want. It is up to you really how you want to do things. Also, on the other questions, have you tried to search the forums and resources. There is lots of info here on GG... it just takes some time to find what you want. The search function is very useful tool to use on GG.
#2
02/20/2006 (9:14 am)
I tried TDN, but I still find it hard to get the info... I'll try harder then...
#3
02/20/2006 (9:27 am)
There are threads and articles about dealing with different Cameras, zone cameras, changing datablocks. Point and click interfaces etc.. An animated GUI should be fairly simple too.

Some of the resources you need require C++ changes so be prepared to do some heavy learning about TGE.
It's not an easy task for some of the stuff you want if you're just starting out but worthwhile.

With a 1.2 build I managed to get an advanced camera linked into static zones so that when the player walked into a certain area the camera changed to a fixed camera (good for adventure type games where you want a fixed camera tracking the player) then when you exit the zone, the camera changes back to a 3rd person fixed angle camera. My C++ wasn't too great then and I didn't really understand what I was changing but it worked. Most of the code was copy and paste.

1.4 changes some stuff so the older resources might not work out of the box, but they're nothing too major and a couple of small changes should be all that's needed.


A lot can be accomplished in script, but sometimes you need to get your hands dirty in C++, It's best to be prepared for this rather than shy away from it, afterall, it's where Torques real power comes from.