10 Newbie Questions
by Leo Gura · in Torque Game Builder · 09/18/2006 (5:51 am) · 7 replies
I'm spent the past few days learning Torque and need answers to the following questions. If you only know the anwser to one or two of them, please post what you know.
1. I can't seem to import Gifs and Jpegs into TGD, only PNGs show up in the image map builder. Why is this?
2. What functions/commands should I use for debugging? And I don't just mean showing the debug banner. For instance, I need to be able to check the values of my arrays and other variables. Is there a quick and easy way to paint them to the screen?
3. What is the function to convert strings to reals and reals to strings?
4. What functions are used to test if an object has entered a certain region. For instance, I need to test if an object of a certain type is within a circular region of radius R at a certain coordinate X,Y. Also I need to check if an object is intersecting a line with a certain slope and coordinate position.
5. I want to know all the timing fuctions available to me. So far I know Scheduling and OnTimer, are there any others?
6. Is there an easy way to scroll around in the level view? How do I efficiently place objects outside the camara view? Is there a way to move the camara with arrow keys or the mouse?
7. Are paths always absolute? What I mean is, can I draw a path anywhere in the level and set an object to execute this path but do so from the point where the object is currently standing, without having to jump to one of the path nodes? In other words I'm looking for relative pathing.
8. Is there a way to assign various speed to path nodes so that the object, while moving across the nodes, would gradually accelerate and deccelerate depending on the speeds I assign.
9. When I run a game in TGD, the play, stop, and pause widgets appears in the upper left hand corner of the screen. The problem is that they block the "number of objects" field in the debugger banner, so I can't see how many object I have in the scene. How can I move the banner or the widget?
10. Is there a way to track the number of particle effect objects existing at any given moment? I need to be sure that my particle systems are being properly destroyed after use.
Thanks for the help!
1. I can't seem to import Gifs and Jpegs into TGD, only PNGs show up in the image map builder. Why is this?
2. What functions/commands should I use for debugging? And I don't just mean showing the debug banner. For instance, I need to be able to check the values of my arrays and other variables. Is there a quick and easy way to paint them to the screen?
3. What is the function to convert strings to reals and reals to strings?
4. What functions are used to test if an object has entered a certain region. For instance, I need to test if an object of a certain type is within a circular region of radius R at a certain coordinate X,Y. Also I need to check if an object is intersecting a line with a certain slope and coordinate position.
5. I want to know all the timing fuctions available to me. So far I know Scheduling and OnTimer, are there any others?
6. Is there an easy way to scroll around in the level view? How do I efficiently place objects outside the camara view? Is there a way to move the camara with arrow keys or the mouse?
7. Are paths always absolute? What I mean is, can I draw a path anywhere in the level and set an object to execute this path but do so from the point where the object is currently standing, without having to jump to one of the path nodes? In other words I'm looking for relative pathing.
8. Is there a way to assign various speed to path nodes so that the object, while moving across the nodes, would gradually accelerate and deccelerate depending on the speeds I assign.
9. When I run a game in TGD, the play, stop, and pause widgets appears in the upper left hand corner of the screen. The problem is that they block the "number of objects" field in the debugger banner, so I can't see how many object I have in the scene. How can I move the banner or the widget?
10. Is there a way to track the number of particle effect objects existing at any given moment? I need to be sure that my particle systems are being properly destroyed after use.
Thanks for the help!
#2
2. Usually what I do is to echo the variables I need. This requires you to look at the console, though. Alternately, you could implement the t2dTextObject resource and use that.
3. Variables are typeless in TorqueScript, so you don't need to explicitly define a string or integer, for example. Arithmetic and concatenation operations work across the board.
4. There are numerous ways to do this. You can use a trigger, you can create a dummy object with a circular collision boundary, or you can simply have a continuously-looping distance check, for example.
5. Can't think of any other built-in ones, though I'm no expert.
6. Right-mouse-drag in the level builder will scroll you around. The mouse wheel can be used to zoom in and out (there are also hotkeys for this, but I can't remember them since I don't use them). View->zoom x% will bring you to a predefined zoom level.
edit: A caveat about Philip's point: If you have an object selected, the cursor keys will move that around instead of your view.
Not sure about the rest of the questions, though. Hope that helps somewhat.
edit: I'm a slow one, yeah? Lol.
09/18/2006 (6:30 am)
1. Not too sure. I could've sworn you used to be able to use gifs, but it's been a while since I've needed to. PNGs are better, anyways, and don't have that dodgy patent associated with them. :) Jpegs work, though.2. Usually what I do is to echo the variables I need. This requires you to look at the console, though. Alternately, you could implement the t2dTextObject resource and use that.
3. Variables are typeless in TorqueScript, so you don't need to explicitly define a string or integer, for example. Arithmetic and concatenation operations work across the board.
4. There are numerous ways to do this. You can use a trigger, you can create a dummy object with a circular collision boundary, or you can simply have a continuously-looping distance check, for example.
5. Can't think of any other built-in ones, though I'm no expert.
6. Right-mouse-drag in the level builder will scroll you around. The mouse wheel can be used to zoom in and out (there are also hotkeys for this, but I can't remember them since I don't use them). View->zoom x% will bring you to a predefined zoom level.
edit: A caveat about Philip's point: If you have an object selected, the cursor keys will move that around instead of your view.
Not sure about the rest of the questions, though. Hope that helps somewhat.
edit: I'm a slow one, yeah? Lol.
#3
09/18/2006 (3:22 pm)
Wow, Torque suddenly seems a lot more comprehensible now. Thanks for the execellent replies.
#4
09/18/2006 (11:06 pm)
7 & 8: I have done similar things like this the script, although I don't think my code would be any use to you. You could make an object do this sort of thing in script without too much work, but you'd probably have no control over it in the editor. On the other hand, the editor is now supports drop-in add-ons if your really need that functionality. That might also help you with question #9. I think the short answer for these three question, though, is no.
#5
6) You can right click anywhere on the Level Builder background and drag the entire level around. You can also zoom in and out with the mouse wheel.
09/18/2006 (11:31 pm)
Surprised this one didn't get mentioned:6) You can right click anywhere on the Level Builder background and drag the entire level around. You can also zoom in and out with the mouse wheel.
#6
09/19/2006 (12:35 am)
Stephen, see my response. ;)
#7
09/19/2006 (8:05 am)
Doh, I was tired, hehe. Sorry about that.
Torque Owner Philip Mansfield
Default Studio Name
2. You can use echo("%foo =" SPC %foo); to output stuff to the console.
3. TorqueScript is typeless.
4. You can either mount a sceneobject of the appropriate size with a collision poly and use the onCollision callbacks, or you could the maths and work out where things are using getPosition. There is also castCollision which you can use to see if things will collide in x amount of time.
5. That's about it. There are other timers you can read such as the amount of time the sim has been running.
6. Strangely, yes. The cursor keys do exactly that. It works fine in both Camera mode and Selection mode.
7 & 8. Don't know. I'm sure someone else will be along to answer that.
9. Not sure, but I agree it would be useful if this was converted to a draggable box so you could move it out of the way.
10. Check out the Debug banner PDF file, it explains all of the items on it, including which ones relate to particles.