Game Development Community

Scripting for TGB - I'm Frustrated

by Norman Potter · in General Discussion · 04/10/2007 (5:16 am) · 7 replies

I'm not a beginner where programming is concerned. I develop web-apps for a living. When I start to learn a new language I play about for a bit and eventually something clicks.

There's something about Torque Script that's not clicking though. I've been playing about with it for a week and I just can't seem to get my head around it at all.

There's more tutorials than you can shake a stick at but I still don't seem to be able to understand what the hell is going on.

I'm afraid I find the script reference a little bit lacking. For example: setCurrentCameraArea takes four parameters; top, left, width and height. What does it REALLY expect though. I've played and played and played about with it but just don't understand. How top and left work is beyond me but width and height seem to be some sort of percentages .

I know this all sounds a bit pathetic but I suppose I just asking for some help here. What sort of help, I don't know because there's nothing specific about the thing I can put my finger on.

#1
04/10/2007 (5:49 am)
Two things really speed up development.

1. Torsion. Try it. Buy it. Use it. Love it.
2. The console. While running the game you can press ~ and it'll popup the console. You can type in commands there which really makes trial and error easy and it will also tell you what errors have been encountered, etc. It really helps. Eval() is your friend here too.

The script reference could use with more direct examples from the reference itself, but what I'll do when I don't get enough info from the reference is to just search for the command among all the script that ships with TGB and 9 times out of 10 I'll find a perfect sample of using that method in the same context I wanted to. Alternatively, search for the method name using this website as it'll pull up a lot of good information as well.

It takes a little while to figure out the nuances but I'm sure it'll work out in the end.
#2
04/10/2007 (7:16 am)
We've actually been working on improving the reference... instead of hand created and updated it is now automatically dumped out of the engine based on a special style of "usage" string registered with all script accessible methods and functions... I have external example files parsing in as well so hopefully we can get just about everything exampled... :)

setCurrentCameraArea should be the entire area of the camera... basically the first two are the top left corner positions and the last two are the bottom right :) Unfortunately I think you found a bug in the reference. That is one reason we are changing the reference to be auto-generated, it is much easier to just keep the source code comments up to date rather than keeping a massive 2 meg reference file up to date.
#3
04/10/2007 (7:21 am)
Excellent news about the reference. I'm much more of a reference type of guy than a big reader of tutorials.

Any ball park ideas of when the new version might be available?
#4
04/10/2007 (7:55 am)
If you own a license to TGB then you can get access to the current TGB Open Beta which has a (very) early version of it... though as for the final release all I can really say is soon. I'm hoping to get the reference fully fleshed out via the internal comment system, though will depend on getting people either contracted to do so or some of us spending late nights getting it done lol (lots of stuff to comment).
#5
04/10/2007 (7:57 am)
Thanks, Matthew.

I'm using the trial version at the moment because of my struggling freelancer status :-o

Hopefully, I'll be able to splash out a few bucks and get myself a license very soon though.
#6
04/10/2007 (8:02 am)
How are you enjoying TGB so far? Sorry to hear you are struggling getting your head around TorqueScript. Are you used to game coding languages, if not then you will probably find that it takes a good couple weeks before you can usually wrap your head around the concepts of a new game engine (and it's scripting language) :)

Well if you decide to purchase TGB be sure to edit your forum subscriptions and add the TGB Private forums, lots of posts go on there every day. Also you may want to check out the TGB Public forums, will most likely get more answers there than here.
#7
04/10/2007 (9:23 am)
I'm very much enjoying TBG because I can see it's potential. It's been on my mind for quite a while now to make a game or two and Torque seems to have become a bit of favorite with hobbyists.

What I'd really like to do, once I've learned the nuts and bolts is to come up with an old school RPG. Something along the lines of the old Zelda games but with a sci-fi theme.

Not at all used to coding games. Querying databases and spewing out HTML is my forte. If browsers used cameras and sprites I might not be struggling quite so much :-D

I'll get there eventually. Hopefully sooner rather than later.