Game Development Community

Sparse TXB documentation, or am I missing something?

by Mick Orbik · in Torque X 2D · 01/20/2008 (3:09 am) · 2 replies

The TDN page for the Torque X Builder looks Very sparsely done, save for the Very incredible greenRobot tutorial series... But those don't really answer what I need.

Does there exist for TorqueX a standard documentation, like one generated by doxygen, or something like that, that overviews the classes in TX, and details like that? I am having a hard time doing ANYTHING that I don't know how to do (jumping off, if you will) and that is pretty much EVERYTHING.

So, am I missing an area of the site that has some more C# Specific and TXB specific information, or is that really all there is.


Also, the reason I am looking for this information, is because for right now, I am trying to do two things that really shouldn't be that difficult. I am trying to make it to where when I press the move buttons, in the MovementComponent code pick up on that and make it play my "Walking" animation. Its a 2D side scroller, so It is only 1 animation that needs to be loaded. In the greenRobot's MovementComponent, it had some interesting lines. I copied where it declared _sceneSprite as owner, which made me have a local var, that should be whatever the MC was assigned to, and then called _sceneSprite.PlayAnimation(TorqueObjectDatabase.Instance.FindObject("chWalking"));
where chWalking is the name of my walking animation in the list to the right in TXB. Now I run it, and move, the movement works, but the animation doesn't play...

The other thing is, when my player reaches its "world limits", I want the scroller's scrolling speed to change (from 0 to about 10). How would one accomplish this? How do you "grab" a scene object and use it to access properties and functions from in the code?

#1
01/20/2008 (4:29 am)
As for the question of getting the Animation working properly... I got it working. It is just a tad hackish for me. Instead of any of these "stick" vectors that I have to work with, Is it possible to get a straight read on like if a key is pressed? Like in Just keep an array of booleans, one for each key, Like I used to do in OpenGL? If there is that would be great, else I will just have to keep with my hack.

As for the Scroller problem, after tinkering around a bit more, I thought I would try something like this...

T2DScroller bg1 = TorqueObjectDatabase.Instance.FindObject("levelonefg1Material");

But, that doesn't work. It doesn't work because that value can't be found so my bg1 var is null. So where do I specify the "name" of the SceneObject? Is it the name field in Scripting? Or what do I put in the quotes when I place the object into the scene in TXB.
#2
01/20/2008 (8:37 am)
The reference documentation is in the "Torque X API.chm" file that gets installed along with Torque X. More general documentation, including tutorials, is in the "Torque X User's Guide" document. If you're using the released version rather than the beta, there are also additional tutorials available here. TDN is a community-maintained site, not an official GG documentation site.

If you map your input as buttons rather than sticks, your move data structure will tell you whether they're pressed or not.

Yes, you set the name of an object in its Scripting rollout. You can either hard-code your name in the code, as you've been doing, or you can set up a T2DScroller-typed property of your component, and assign it in TXB.